1 | <?php |
||
20 | class UnderscoredNamerCollection implements NamingStrategy |
||
21 | { |
||
22 | /** |
||
23 | * @var NamingStrategy |
||
24 | */ |
||
25 | protected $defaultNamingStrategy; |
||
26 | |||
27 | /** |
||
28 | * @var NamingStrategy[] |
||
29 | */ |
||
30 | protected $concurrentNamingStrategies; |
||
31 | |||
32 | /** |
||
33 | * @var bool |
||
34 | */ |
||
35 | protected $joinTableFieldSuffix; |
||
36 | |||
37 | /** |
||
38 | * UnderscoredNamerCollection constructor. |
||
39 | * |
||
40 | * @param NamingStrategy $defaultNamingStrategy |
||
41 | * @param NamingStrategy[] $concurrentNamingStrategies |
||
42 | * @param array $configuration |
||
43 | */ |
||
44 | 8 | public function __construct(NamingStrategy $defaultNamingStrategy, array $concurrentNamingStrategies = [], array $configuration = []) |
|
60 | |||
61 | /** |
||
62 | * Register naming strategy. |
||
63 | * |
||
64 | * @param NamingStrategy $namingStrategy |
||
65 | * |
||
66 | * @return UnderscoredNamerCollection $this |
||
67 | * |
||
68 | * @throws \RunOpenCode\Bundle\DoctrineNamingStrategy\Exception\InvalidArgumentException |
||
69 | */ |
||
70 | 8 | public function registerNamingStrategy(NamingStrategy $namingStrategy) |
|
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | 2 | public function classToTableName($className) |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 2 | public function propertyToColumnName($propertyName, $className = null) |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 1 | public function embeddedFieldToColumnName($propertyName, $embeddedColumnName, $className = null, $embeddedClassName = null) |
|
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | 1 | public function referenceColumnName() |
|
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | 1 | public function joinColumnName($propertyName, $className = null) |
|
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | 1 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
|
137 | |||
138 | /** |
||
139 | * {@inheritdoc} |
||
140 | */ |
||
141 | 1 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
|
147 | |||
148 | |||
149 | /** |
||
150 | * Find applicable naming strategy for given class. |
||
151 | * |
||
152 | * @param string $className |
||
153 | * |
||
154 | * @return NamingStrategy |
||
155 | */ |
||
156 | 6 | private function findNamer($className) |
|
173 | } |
||
174 |
This check compares calls to functions or methods with their respective definitions. If the call has more 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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.