:crystal_ball: Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.

Overview

Better Reflection

Mutation testing badge Type Coverage Latest Stable Version License

Better Reflection is a reflection API that aims to improve and provide more features than PHP's built-in reflection API.

Why is it better?

  • You can reflect on classes that are not already loaded, without loading them
  • Ability to reflect on classes directly from a string of PHP code
  • Better Reflection analyses the DocBlocks (using phpdocumentor/type-resolver)
  • Reflecting directly on closures
  • Ability to extract AST from methods and functions
  • Ability to return AST representation of a class or function
  • Fetch return type declaration and parameter type declarations in PHP 7 code
  • Change or remove PHP 7 parameter type and return type declarations from methods and functions
  • Change the body of a function or method to do something different
  • Moar stuff coming soon!

Typically you would use Better Reflection for static analysis tooling. It can serve as a baseline to access type information (e.g. doc blocks, type declarations), method/function body AST fetching etc. for static analysis.

Better Reflection is NOT suited to runtime usage, since performance is much worse than PHP built-in reflection. If you do not want to do anything that native PHP reflection can't do, then just use native PHP reflection! The "Better" in Better Reflection refers to feature, not speed!

Be sure to read more in the feature documentation.

Installation

Require using composer:

$ composer require roave/better-reflection

Usage

<?php

use Roave\BetterReflection\BetterReflection;

$classInfo = (new BetterReflection())
    ->classReflector()
    ->reflect(\Foo\Bar\MyClass::class);

Documentation

Upgrading

Please refer to the Upgrade Documentation documentation to see what is required to upgrade your installed BetterReflection version.

Limitations

  • PHP cannot autoload functions, therefore we cannot statically reflect functions

License

This package is released under the MIT license.

Contributing

If you wish to contribute to the project, please read the CONTRIBUTING notes.

Comments
  • PHP 8 compatibility

    PHP 8 compatibility

    I already did most of these steps in my fork because I want PHPStan to be ready for PHP 8 on day one or sonner.

    This is what needs to be done in BetterReflection in order to fully support PHP 8:

    • [x] Adapter signatures compatibility (https://github.com/ondrejmirtes/BetterReflection/commit/0acd4522bd500547cf2574acb3b1a04b177869ae)
    • [x] mixed type (https://github.com/ondrejmirtes/BetterReflection/commit/fabd25923c2a1ec96e3bedbdd09267d88a150f15)
    • [x] static type (https://github.com/ondrejmirtes/BetterReflection/commit/e6f9b722e8af66566caad705cd541c213bd4d106)
    • [x] Reflecting union types (https://github.com/ondrejmirtes/BetterReflection/commit/ce858eba391542639e8d2ea725df27ffaeca4e01 - this commit needs to be broken up because it mixes more things)
    • [x] ReflectionType::__toString breaking change in PHP 8 - nullable type includes ? again (https://3v4l.org/CmTA1)
    • [x] ReflectionSourceStubber misses to generate return types (https://github.com/ondrejmirtes/BetterReflection/commit/6a87721f5c95792d754b30931b283c91897995a6)
    • [x] isBuiltin() is supposed to be only on ReflectionNamedType in PHP 8 (https://github.com/ondrejmirtes/BetterReflection/commit/86c5ce76560c561209cc36f05d576d0bc761ede0)
    • [x] Stringable (https://github.com/ondrejmirtes/BetterReflection/commit/e9f99da6586dab440cc4117379fdbdb912a1697e)
    • [x] PhpStormStubsSourceStubberTest will fail a lot when building on PHP 8 because a lot of stuff changed between PHP 8 and PHP 7
    • [x] Promoted properties in constructor - I plan to solve this by making ReflectionProperty an interface with two implementations - one based on Property node, the other based on Param node.
    • [x] Only __construct methods can be considered constructors
    • [x] Support for reading Attributes
    • [x] Constant of value null as a default parameter value no longer makes the parameter type nullable

    The Stringable commit and the obsoleted old-style constructors require an if based on the PHP version. I did that with a public static property on BetterReflection but a different way can be fine too.

    Some of these items require a new major version, but some of them can be done in a minor version before that.

    I'm creating this issue because I plan to send PRs for these (in case someone isn't faster than me) but I'd like to hear your opinions first :)

    enhancement dependencies 
    opened by ondrejmirtes 51
  • Last call for `5.0.0` BC breaks

    Last call for `5.0.0` BC breaks

    This is just a placeholder to make sure everyone is aware that 5.0.0 is around the corner: if nobody replies to this issue within a couple days, I will release 5.0.0 from 5.0.x (after attempting to put together some release notes @_@ )

    If you need to break BC further, now is the time.

    enhancement 
    opened by Ocramius 23
  • Prevent memory leaks by not holding onto AST nodes

    Prevent memory leaks by not holding onto AST nodes

    Hi, I'm in the process of reducing the memory amount consumed by PHPStan, and I have some promising results.

    Current stable version consumes ~850 MB when runing PHPStan on PHPStan.

    After I removed the NodeConnectingVisitor (this isn't related to BetterReflection) that creates cycles between nodes by setting parent/previous/next attributes, I saved around 100 MB. So now we're at ~750 MB.

    I continued to debug the problem by using php-meminfo but there was a lot of noise because of CachedParser (equivalent of MemoizingParser). So I removed parser caching to see what else holds onto AST nodes. I also removed static reflection capabilities altogether to see if there's something else in PHPStan that leaks. I consider the floor of what's possible to achieve at around ~200 MB.

    When I returned static reflection capabilities, it went back to ~750 MB. And most of the memory is held in AST nodes held by various reflection classes like ReflectionClass etc.

    So I refactored some classes to extract all of the needed information in constructor so that the AST node is not saved in a property: https://github.com/ondrejmirtes/BetterReflection/compare/cc581ecece6e69674181ec456ecc5d846ad312d1...35db84f1abff5b3416daca4804901b0750da7610 (the work isn't done, there's still more to do)

    Right now PHPStan consumes around 340 MB without a CachingParser and around 430 MB with a CachingParser.

    The best part is that there's very little performance impact time-wise so it looks really promising. I don't have production-ready code yet as there are some problems to work out but I hope this will make PHPStan much more resource-effective.

    One downside is that I had to remove some features that need the AST after a Reflection class is created - it can be seen in the diff.

    Is this something you'd like to do here too?

    enhancement BC break 
    opened by ondrejmirtes 21
  • Release 2.0.0?

    Release 2.0.0?

    We accumulated a few major improvements over the last months. @asgrim is anything worth holding off a release?

    As far as I can see, we're pretty much on par with 7.2 once the current PRs are handled.

    3.0.0 (or 2.1.0) could focus on performance, maybe.

    question 
    opened by Ocramius 19
  • Extend core \ReflectionClass etc.

    Extend core \ReflectionClass etc.

    Adapter for core Reflection classes, e.g.

    <?php
    
    namespace BetterReflection\CompatibleReflection;
    
    use \ReflectionClass as CoreReflectionClass;
    use BetterReflection\Reflection\ReflectionClass as BetterReflectionClass;
    
    class ReflectionClass extends CoreReflectionClass
    {
        /**
         * @var BetterReflectionClass
         */
        private $betterReflection;
    
        public function __construct()
        {
            throw new \Exception("Cannot instantiate like this...");
        }
    
        public static function createFromNode(
            ClassNode $node,
            NamespaceNode $namespace = null,
            $filename = null
        ) {
            $reflection = new self();
            $reflection->betterReflection = BetterReflectionClass::createFromNode($node, $namespace, $filename);
        }
    
        // Implement all the core methods
    }
    

    Alternatively, just make \BetterReflection\Reflection\ReflectionClass extend \ReflectionClass and ensure every method is implemented...

    Why? So that something that is (incorrectly) type hinting for \ReflectionClass instead of \Reflector can use this library...

    reflection compatibility 
    opened by asgrim 19
  • [PHP 7.1] Add support for ReflectionClassConstant (#281)

    [PHP 7.1] Add support for ReflectionClassConstant (#281)

    https://github.com/Roave/BetterReflection/issues/281

    Note: I did not understand how testReflectionObjectOverridesAllMethodsInReflectionClass works, therefore I missed it.

    enhancement 
    opened by POPSuL 18
  • Result of `BetterReflection\ReflectionParameter::isDefaultValueAvailable()` not similar to `\ReflectionParameter::isDefaultValueAvailable()`

    Result of `BetterReflection\ReflectionParameter::isDefaultValueAvailable()` not similar to `\ReflectionParameter::isDefaultValueAvailable()`

    class Demo
    {
        public function test($value = null)
        {
        }
        public function isDefaultValueAvailable(): bool
        {
            return (new \ReflectionParameter([$this, 'test'], 0))->isDefaultValueAvailable();
        }
    }
    
    $demo = new Demo();
    var_dump($demo->isDefaultValueAvailable()); // result: true
    

    Roave\BetterReflection\Reflection\ReflectionParameter::isDefaultValueAvailable(): https://github.com/Roave/BetterReflection/blob/74aaf7e9a446590f5a461203c379d0580c614faa/src/Reflection/ReflectionParameter.php#L278

    bug invalid needs more info 
    opened by WinterSilence 17
  • Cannot determine default value for internal classes

    Cannot determine default value for internal classes

    Currently ~150 tests are marked incomplete for the following reason:

    152) BetterReflectionTest\SourceLocator\PhpInternalSourceLocatorTest::testCanReflectInternalClasses with data set "DateTimeInterface" ('DateTimeInterface')
    Can't reflect class "DateTimeInterface" due to an internal reflection exception: "Cannot determine default value for internal functions". Consider adding a stub class
    
    /home/james/workspace/better-reflection/test/unit/SourceLocator/PhpInternalSourceLocatorTest.php:61
    

    This should be considered a bug and incompatibility.

    bug easypick 
    opened by asgrim 17
  • Tests consuming alot memory right now

    Tests consuming alot memory right now

    At the moment the test are consuming a huge amount of memory. Local the test are consuming 2.5GB:

    $ vendor/bin/phpunit
    PHPUnit 9.1.5 by Sebastian Bergmann and contributors.
    
    .............................................................   61 / 7358 (  0%)
    .............................................................  122 / 7358 (  1%)
    .............................................................  183 / 7358 (  2%)
    .............................................................  244 / 7358 (  3%)
    .............................................................  305 / 7358 (  4%)
    .............................................................  366 / 7358 (  4%)
    .............................................................  427 / 7358 (  5%)
    .............................................................  488 / 7358 (  6%)
    .............................................................  549 / 7358 (  7%)
    .............................................................  610 / 7358 (  8%)
    .............................................................  671 / 7358 (  9%)
    .............................................................  732 / 7358 (  9%)
    .............................................................  793 / 7358 ( 10%)
    .............................................................  854 / 7358 ( 11%)
    .............................................................  915 / 7358 ( 12%)
    .............................................................  976 / 7358 ( 13%)
    ............................................................. 1037 / 7358 ( 14%)
    ............................................................. 1098 / 7358 ( 14%)
    ...............................................S............. 1159 / 7358 ( 15%)
    ............................................................. 1220 / 7358 ( 16%)
    ............................................................. 1281 / 7358 ( 17%)
    ............................................................. 1342 / 7358 ( 18%)
    ............................................................. 1403 / 7358 ( 19%)
    ............................................................. 1464 / 7358 ( 19%)
    ............................................................. 1525 / 7358 ( 20%)
    ............................................................. 1586 / 7358 ( 21%)
    ............................................................. 1647 / 7358 ( 22%)
    ............................................................. 1708 / 7358 ( 23%)
    ............................................................. 1769 / 7358 ( 24%)
    ............................................................. 1830 / 7358 ( 24%)
    ............................................................. 1891 / 7358 ( 25%)
    ............................................................. 1952 / 7358 ( 26%)
    ............................................................. 2013 / 7358 ( 27%)
    ............................................................. 2074 / 7358 ( 28%)
    ............................................................. 2135 / 7358 ( 29%)
    ............................................................. 2196 / 7358 ( 29%)
    ............................................................. 2257 / 7358 ( 30%)
    ............................................................. 2318 / 7358 ( 31%)
    ............................................................. 2379 / 7358 ( 32%)
    ............................................................. 2440 / 7358 ( 33%)
    ............................................................. 2501 / 7358 ( 33%)
    ............................................................. 2562 / 7358 ( 34%)
    ............................................................. 2623 / 7358 ( 35%)
    ............................................................. 2684 / 7358 ( 36%)
    ............................................................. 2745 / 7358 ( 37%)
    ............................................................. 2806 / 7358 ( 38%)
    ............................................................. 2867 / 7358 ( 38%)
    ............................................................. 2928 / 7358 ( 39%)
    ............................................................. 2989 / 7358 ( 40%)
    ............................................................. 3050 / 7358 ( 41%)
    ............................................................. 3111 / 7358 ( 42%)
    ............................................................. 3172 / 7358 ( 43%)
    ............................................................. 3233 / 7358 ( 43%)
    ............................................................. 3294 / 7358 ( 44%)
    ............................................................. 3355 / 7358 ( 45%)
    ............................................................. 3416 / 7358 ( 46%)
    ............................................................. 3477 / 7358 ( 47%)
    ............................................................. 3538 / 7358 ( 48%)
    ............................................................. 3599 / 7358 ( 48%)
    ............................................................. 3660 / 7358 ( 49%)
    ............................................................. 3721 / 7358 ( 50%)
    ............................................................. 3782 / 7358 ( 51%)
    ............................................................. 3843 / 7358 ( 52%)
    ............................................................. 3904 / 7358 ( 53%)
    ............................................................. 3965 / 7358 ( 53%)
    ............................................................. 4026 / 7358 ( 54%)
    ............................................................. 4087 / 7358 ( 55%)
    ............................................................. 4148 / 7358 ( 56%)
    ............................................................. 4209 / 7358 ( 57%)
    ............................................................. 4270 / 7358 ( 58%)
    ............................................................. 4331 / 7358 ( 58%)
    ............................................................. 4392 / 7358 ( 59%)
    ............................................................. 4453 / 7358 ( 60%)
    ............................................................. 4514 / 7358 ( 61%)
    ............................................................. 4575 / 7358 ( 62%)
    ............................................................. 4636 / 7358 ( 63%)
    ............................................................. 4697 / 7358 ( 63%)
    ............................................................. 4758 / 7358 ( 64%)
    ............................................................. 4819 / 7358 ( 65%)
    ............................................................. 4880 / 7358 ( 66%)
    ............................................................. 4941 / 7358 ( 67%)
    ............................................................. 5002 / 7358 ( 67%)
    ............................................................. 5063 / 7358 ( 68%)
    ............................................................. 5124 / 7358 ( 69%)
    ............................................................. 5185 / 7358 ( 70%)
    ............................................................. 5246 / 7358 ( 71%)
    ............................................................. 5307 / 7358 ( 72%)
    ............................................................. 5368 / 7358 ( 72%)
    ............................................................. 5429 / 7358 ( 73%)
    ............................................................. 5490 / 7358 ( 74%)
    ............................................................. 5551 / 7358 ( 75%)
    ............................................................. 5612 / 7358 ( 76%)
    ............................................................. 5673 / 7358 ( 77%)
    ............................................................. 5734 / 7358 ( 77%)
    ............................................................. 5795 / 7358 ( 78%)
    ............................................................. 5856 / 7358 ( 79%)
    ............................................................. 5917 / 7358 ( 80%)
    ............................................................. 5978 / 7358 ( 81%)
    ............................................................. 6039 / 7358 ( 82%)
    ............................................................. 6100 / 7358 ( 82%)
    ............................................................. 6161 / 7358 ( 83%)
    ............................................................. 6222 / 7358 ( 84%)
    ............................................................. 6283 / 7358 ( 85%)
    ............................................................. 6344 / 7358 ( 86%)
    ............................................................. 6405 / 7358 ( 87%)
    ............................................................. 6466 / 7358 ( 87%)
    ............................................................. 6527 / 7358 ( 88%)
    ............................................................. 6588 / 7358 ( 89%)
    ............................................................. 6649 / 7358 ( 90%)
    ............................................................. 6710 / 7358 ( 91%)
    ............................................................. 6771 / 7358 ( 92%)
    ............................................................. 6832 / 7358 ( 92%)
    ............................................................. 6893 / 7358 ( 93%)
    ............................................................. 6954 / 7358 ( 94%)
    ............................................................. 7015 / 7358 ( 95%)
    ............................................................. 7076 / 7358 ( 96%)
    ............................................................. 7137 / 7358 ( 96%)
    ............................................................. 7198 / 7358 ( 97%)
    ............................................................. 7259 / 7358 ( 98%)
    ............................................................. 7320 / 7358 ( 99%)
    ......................................                        7358 / 7358 (100%)
    
    Time: 00:24.055, Memory: 2.50 GB
    

    I just checked some CI jobs from the last days: 2.55 GB: https://github.com/Roave/BetterReflection/runs/717137271?check_suite_focus=true 1.41 GB: https://github.com/Roave/BetterReflection/pull/622/checks?check_run_id=716753844 212 MB: https://github.com/Roave/BetterReflection/pull/607/checks?check_run_id=714702198

    Right now i could not pin down the culprit but I will investigate further..

    feature request 
    opened by DanielBadura 16
  • Crash when asking for default value of LevelDB::__construct() $options parameter

    Crash when asking for default value of LevelDB::__construct() $options parameter

    UnableToCompileNode: Could not locate constant "LEVELDB_SNAPPY_COMPRESSION" while evaluating expression in LevelDB at line 22
    

    The constant is defined in PhpStorm stubs in the same file as LevelDB class.

    The problem is when I get ReflectionParameter for the $options parameter and ask for the default value.

    The resolution does not go through ConstantReflector at all.

    bug 
    opened by ondrejmirtes 16
  • Fixed stubs searching

    Fixed stubs searching

    Build is failing because a lot of stubs is out of date...

    The stubs searching is broken since https://github.com/Roave/BetterReflection/commit/3f9a4b317a6c1bc29ab207e4a6b259622bca5813 so it doesn't work almost two years.

    May I remove the stubs functionality?

    bug 
    opened by kukulich 16
  • Lock file maintenance

    Lock file maintenance

    Mend Renovate

    This PR contains the following updates:

    | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed |

    🔧 This Pull Request updates lock files to use the latest dependency versions.


    Configuration

    📅 Schedule: Branch creation - "before 2am" in timezone UTC, Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    Read more about the use of Renovate Bot within ocramius/* projects.

    renovate 
    opened by renovate[bot] 1
  • Update all non-major dependencies

    Update all non-major dependencies

    | datasource | package | from | to | | ---------- | --------------- | ------ | ------ | | packagist | phpstan/phpstan | 1.8.11 | 1.8.11 | | packagist | phpunit/phpunit | 9.5.25 | 9.5.26 |

    Note: just realized that we only run CI on: [pr], which is NOT okay for renovate to perform background CI checks

    enhancement dependencies 
    opened by Ocramius 4
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    Edited/Blocked

    These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

    • [ ] Update all non-major dependencies (nikic/php-parser, phpstan/phpstan, phpstan/phpstan-phpunit, phpunit/phpunit, ramsey/composer-install, roave/backward-compatibility-check, roave/infection-static-analysis-plugin, vimeo/psalm)

    Open

    These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

    Detected dependencies

    composer
    composer.json
    • php ~8.1.0 || ~8.2.0
    • jetbrains/phpstorm-stubs 2022.3
    • nikic/php-parser ^4.15.1
    • roave/signature ^1.7
    • doctrine/coding-standard ^11.0.0
    • phpstan/phpstan ^1.8.10
    • phpstan/phpstan-phpunit ^1.2.2
    • phpunit/phpunit ^9.5.25
    • vimeo/psalm ^5.1.0
    • roave/infection-static-analysis-plugin ^1.26.0
    tools/roave-backward-compatibility-check/composer.json
    • roave/backward-compatibility-check ^8.0.0
    github-actions
    .github/workflows/continuous-integration.yml
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    • actions/checkout v3
    • shivammathur/setup-php v2
    • ramsey/composer-install 2.1.0
    .github/workflows/release-on-milestone-closed-triggering-release-event.yml
    • actions/checkout v3
    • laminas/automatic-releases v1
    • laminas/automatic-releases v1
    • laminas/automatic-releases v1
    • laminas/automatic-releases v1
    • laminas/automatic-releases v1

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Consider making `Roave\BetterReflection\Reflection\ReflectionClass#getMethod()` non-nullable?

    Consider making `Roave\BetterReflection\Reflection\ReflectionClass#getMethod()` non-nullable?

    We currently have:

    • Roave\BetterReflection\Reflection\ReflectionClass#getMethod(): ReflectionMethod|null
    • Roave\BetterReflection\Reflection\ReflectionClass#hasMethod(): bool

    This API is kinda dumb-ish, and we kinda went back on it in 6.0.0, IMO: an exception being thrown was probably a much nicer API here.

    Either we make getMethod() throw, or we remove hasMethod() here. Relying on getMethod() throwing is not so bad here, but either way could work.

    enhancement BC break 
    opened by Ocramius 3
  • AutoloadSourceLocator should know all symbols from a file once a class is autoloaded from that file

    AutoloadSourceLocator should know all symbols from a file once a class is autoloaded from that file

    Let's say we have a file that looks like this:

    class A
    {
    }
    
    function b()
    {
    }
    
    const C = 1;
    

    Once the PHP runtime autoloads the class A, it also knows about b() and C which traditionally cannot be autoloaded and wouldn't be discovered otherwise.

    AutoloadSourceLocator should parse the file with A before creating the Reflection and when asked about b() and C, it should report them as known.

    I understand if you don't want this change - it makes the behaviour non-deterministic - if the user asks first about b(), it will not be known. But I needed this to make the static reflection's behaviour as close to runtime reflection as possible.

    PoC implementation: https://github.com/phpstan/phpstan-src/commit/25c779159e528dfabde191731e6472a123dfecba#diff-b84fb81e70db3cdb6b4495c80b475a44

    enhancement feature request needs more info 
    opened by ondrejmirtes 6
Releases(6.5.0)
Owner
Roave, LLC
Roave, LLC
PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

PHPMD PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly

PHP Mess Detector 2.1k Jan 8, 2023
Search PHP source code for function & method calls, variables, and more from PHP.

Searching PHP source code made easy Search PHP source code for function & method calls, variable assignments, classes and more directly from PHP. Inst

Permafrost Software 22 Nov 24, 2022
Anticheat for PocketMine-MP API-3.0.0.

Lunar AntiCheat for PocketMine-MP API 3.0.0 This project is in fast-development mode, anything may change. This anticheat is used in production server

TinyRick 19 Jan 4, 2023
Skeleton Application for Laminas API Tools

Laminas API Tools Skeleton Application Requirements Please see the composer.json file. Installation Via release tarball Grab the latest release via th

Laminas API Tools 43 Dec 8, 2022
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

About PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a define

Squiz Labs 9.9k Jan 4, 2023
Beautiful and understandable static analysis tool for PHP

PhpMetrics PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report. Documentation | Twitter | Contributing

PhpMetrics 2.3k Dec 22, 2022
Compares two source sets and determines the appropriate semantic versioning to apply.

PHP Semantic Versioning Checker PHP Semantic Versioning Checker is a console/library which allows you to inspect a set of before and after source code

Tom Rochette 418 Dec 30, 2022
A set of tools for lexical and syntactical analysis written in pure PHP.

Welcome to Dissect! master - this branch always contains the last stable version. develop - the unstable development branch. Dissect is a set of tools

Jakub Lédl 221 Nov 29, 2022
PHP completion, refactoring, introspection tool and language server.

Phpactor This project aims to provide heavy-lifting refactoring and introspection tools which can be used standalone or as the backend for a text edit

Phpactor 882 Jan 1, 2023
Instant Upgrades and Instant Refactoring of any PHP 5.3+ code

Rector - Speedup Your PHP Development Rector helps you with 2 areas - major code changes and in daily work. Do you have a legacy code base? Do you wan

RectorPHP 6.5k Jan 8, 2023
PHP Functional Programming library. Monads and common use functions.

Functional PHP PHP Functional Programming library. Monads and common use functions. Documentation Functions Monads Installation Composer $ composer re

Alexander Sv. 169 Dec 27, 2022
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects

Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.

QOSSMIC GmbH 2.2k Dec 30, 2022
Symfony kafka bundle to produce and consume messages.

Technology stack Quick start Example project Basic Configuration Consuming messages Retrying failed messages Handling offsets Decoders Denormalizers V

STS Gaming Group 25 Oct 3, 2022
phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code

phpcs-security-audit v3 About phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in

Floe design + technologies 655 Jan 3, 2023
TypeResolver - A PSR-5 based resolver of Class names, Types and Structural Element Names

TypeResolver and FqsenResolver The specification on types in DocBlocks (PSR-5) describes various keywords and special constructs but also how to stati

phpDocumentor 9k Dec 29, 2022
A simple, standalone, modern PHP class inspector and mapper library, wrapping PHPs native reflection in a fluent interface

A simple, standalone, modern PHP class inspector and mapper library, wrapping PHPs native reflection in a fluent interface.

smpl 9 Sep 1, 2022
(Hard) Fork of WordPress Plugin Boilerplate, actively taking PRs and actively maintained. Following WordPress Coding Standards. With more features than the original.

Better WordPress Plugin Boilerplate This is a Hard Fork of the original WordPress Plugin Boilerplate. The Better WordPress Plugin Boilerplate actively

Beda Schmid 46 Dec 7, 2022
Create material deisgn avatars for users just like Google Messager. It may not be unique but looks better than Identicon or Gravatar.

Material-Design-Avatars Create material deisgn avatars for users just like Google Messager. It may not be unique but looks better than Identicon or Gr

Canbin Lin 268 Sep 14, 2022
There is no better way to learn than by watching other developers code live. Find out who is streaming next in the Laravel world.

Larastreamers This is the repository of https://larastreamers.com. It shows you who is live coding next in the Laravel world. Installation Steps clone

Christoph Rumpel 201 Nov 24, 2022
A fluent extension to PHPs DateTime class.

Expressive Date A fluent extension to PHPs DateTime class. Table of Contents Installation Composer Manually Laravel 4 Usage Getting Instances Quick He

Jason Lewis 258 Oct 9, 2021