wrk-flow / larastrict

Opinionated extension of a Laravel framework to help you build type safe, testable and reusable code.
https://larastrict.com
MIT License
5 stars 2 forks source link

PHPStan rules #12

Open pionl opened 2 years ago

pionl commented 2 years ago
pionl commented 1 year ago

Something like:

$constructor = $node->getMethod('__construct');
        if (!$constructor) {
            return [];
        }

        foreach ($constructor->getParams() as $param) {
            $paramType = $param->type;

            // TODO: Check if $paramType can be resolved by Laravel container
            // You might need to consider Laravel-specific annotations or patterns
            // to determine if the type can be resolved.
        }

Some of the rules can be contributed to larastan

pionl commented 1 year ago

How to configure phpstan rules examples https://github.com/shipmonk-rnd/phpstan-rules

pionl commented 1 year ago

Check if command signature is valid:

channel-manager:%s:fetch {%s = Schedule fetching in queue in parallel} {--m|channel-manager-id=* : Channel manager ids}%s

is invalid. Valid is:

channel-manager:%s:fetch {%s : Schedule fetching in queue in parallel} {--m|channel-manager-id=* : Channel manager ids}%s