xsolve-pl /
xsolve-associate
| 1 | <?php |
||
| 2 | |||
| 3 | use Xsolve\Associate\DoctrineOrm\Association\Path\Builder\AssociationPathBuilder; |
||
| 4 | |||
| 5 | require_once __DIR__ . '/vendor/autoload.php'; |
||
| 6 | |||
| 7 | $doctrineOrmAssociationPathBuilder = new AssociationPathBuilder(); |
||
| 8 | |||
| 9 | $doctrineOrmAssociationPath = $doctrineOrmAssociationPathBuilder |
||
| 10 | ->associate('bar') |
||
| 11 | ->aliasAs('bars') |
||
| 12 | ->loadFull() |
||
| 13 | ->associate('baz') |
||
| 14 | ->aliasAs('bazs') |
||
| 15 | ->create(); |
||
| 16 | |||
| 17 | dump($doctrineOrmAssociationPath); |
||
|
0 ignored issues
–
show
|
|||
| 18 | |||
| 19 | $doctrineOrmAssociationPathBuilder = new AssociationPathBuilder(); |
||
| 20 | |||
| 21 | $doctrineOrmAssociationPath = $doctrineOrmAssociationPathBuilder |
||
| 22 | ->associate('bar') |
||
| 23 | ->associate('baz') |
||
| 24 | ->create(); |
||
| 25 | |||
| 26 | dump($doctrineOrmAssociationPath); |
||
| 27 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.