1 | <?php |
||
17 | class LinksRelation extends AbstractRelation implements RelationInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var UrlGeneratorInterface |
||
21 | */ |
||
22 | private $urlGenerator; |
||
23 | |||
24 | /** |
||
25 | * @var ObjectManager |
||
26 | */ |
||
27 | private $objectManager; |
||
28 | |||
29 | /** |
||
30 | * @var RequestStack |
||
31 | */ |
||
32 | private $requestStack; |
||
33 | |||
34 | /** |
||
35 | * @var ClassMetadata |
||
36 | */ |
||
37 | private $classMetadata; |
||
38 | |||
39 | /** |
||
40 | * @var \ReflectionClass |
||
41 | */ |
||
42 | private $reflectionClass; |
||
43 | |||
44 | /** |
||
45 | * AbstractRelation constructor. |
||
46 | * |
||
47 | * @param Reader $annotationReader |
||
48 | * @param UrlGeneratorInterface $urlGenerator |
||
49 | * @param ObjectManager $objectManager |
||
50 | * @param RequestStack $requestStack |
||
51 | */ |
||
52 | public function __construct( |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function getName() |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function getRelation($resource) |
||
93 | |||
94 | /** |
||
95 | * @param \ReflectionProperty $property |
||
96 | * @param object $relationContent |
||
97 | * |
||
98 | * @return string|null |
||
99 | * |
||
100 | * @throws \Doctrine\ORM\Mapping\MappingException |
||
101 | */ |
||
102 | private function getRelationLink(\ReflectionProperty $property, $relationContent) |
||
114 | |||
115 | /** |
||
116 | * Get the url of an entity based on the 'get_entity' route pattern. |
||
117 | * |
||
118 | * @param $resource |
||
119 | * @param \ReflectionClass $reflectionClass |
||
|
|||
120 | * |
||
121 | * @return array|null |
||
122 | */ |
||
123 | private function getSelfLink($resource) |
||
136 | |||
137 | /** |
||
138 | * Get the links of a collection. |
||
139 | * |
||
140 | * @param \ReflectionProperty $property |
||
141 | * @param $relationContent |
||
142 | * |
||
143 | * @return array|void |
||
144 | */ |
||
145 | private function getRelationLinks(\ReflectionProperty $property, $relationContent) |
||
158 | |||
159 | /** |
||
160 | * Returns entity single identifier. |
||
161 | * This is a compatibility-limiting feature as it will not be able to get the identity |
||
162 | * of an entity which has multiple identifiers. |
||
163 | * |
||
164 | * @param $entity |
||
165 | */ |
||
166 | private function getEntityId($entity) |
||
173 | } |
||
174 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.