akeneo / php-coupling-detector

[Experimental] Detect all the coupling issues of your project with respect to the coupling rules you have defined.
MIT License
42 stars 6 forks source link

it should not be possible to create a rule with an empty string as pattern #59

Open jjanvier opened 4 years ago

jjanvier commented 4 years ago

the config

$builder->only([''])->in('Foo'),

the error

jjanvier:lambdas$ vendor/bin/php-coupling-detector detect --config-file=.phpcd                                                        ≠ ? {master}

Parsing 11 nodes...
Checking 3 rules...
PHP Warning:  strpos(): Empty needle in /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/src/RuleChecker.php on line 122
PHP Stack trace:
PHP   1. {main}() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/bin/php-coupling-detector:0
PHP   2. Akeneo\CouplingDetector\Console\Application->run() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/bin/php-coupling-detector:18
PHP   3. Akeneo\CouplingDetector\Console\Application->doRun() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/symfony/console/Application.php:140
PHP   4. Akeneo\CouplingDetector\Console\Application->doRunCommand() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/symfony/console/Application.php:264
PHP   5. Akeneo\CouplingDetector\Console\Command\DetectCommand->run() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/symfony/console/Application.php:912
PHP   6. Akeneo\CouplingDetector\Console\Command\DetectCommand->execute() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/symfony/console/Command/Command.php:255
PHP   7. Akeneo\CouplingDetector\CouplingDetector->detect() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/src/Console/Command/DetectCommand.php:111
PHP   8. Akeneo\CouplingDetector\RuleChecker->check() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/src/CouplingDetector.php:78
PHP   9. Akeneo\CouplingDetector\RuleChecker->checkOnlyRule() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/src/RuleChecker.php:43
PHP  10. Akeneo\CouplingDetector\RuleChecker->doesTokenRespectOnlyRule() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/src/RuleChecker.php:102
PHP  11. strpos() /home/jjanvier/workspaces/phpstorm/perso/c2p/lambdas/vendor/akeneo/php-coupling-detector/src/RuleChecker.php:122