@@ -221,6 +221,9 @@ discard block |
||
| 221 | 221 | return $this->getService()->update($entity); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | + /** |
|
| 225 | + * @param string|null $subresource |
|
| 226 | + */ |
|
| 224 | 227 | protected function listSubresource($entity, $subresource, $page = 1, $perPage = 50) |
| 225 | 228 | { |
| 226 | 229 | $propertyAccessor = $this->container->get('property_accessor'); |
@@ -238,6 +241,9 @@ discard block |
||
| 238 | 241 | return Inflector::tableize($this->getClassMetadata()->reflection->getShortName()); |
| 239 | 242 | } |
| 240 | 243 | |
| 244 | + /** |
|
| 245 | + * @return string |
|
| 246 | + */ |
|
| 241 | 247 | protected function getServiceId() |
| 242 | 248 | { |
| 243 | 249 | return $this->getCurrentRequest()->attributes->get('_service'); |
@@ -303,6 +309,9 @@ discard block |
||
| 303 | 309 | $this->assertRightGranted($entity, $right); |
| 304 | 310 | } |
| 305 | 311 | |
| 312 | + /** |
|
| 313 | + * @param string|null $subresource |
|
| 314 | + */ |
|
| 306 | 315 | protected function assertSubresourceListGranted($entity, $subresource) |
| 307 | 316 | { |
| 308 | 317 | $classMetadata = $this->getClassMetadata(); |
@@ -316,6 +325,9 @@ discard block |
||
| 316 | 325 | $this->assertRightGranted($entity, $right); |
| 317 | 326 | } |
| 318 | 327 | |
| 328 | + /** |
|
| 329 | + * @param string|null $subresource |
|
| 330 | + */ |
|
| 319 | 331 | protected function assertSubresourcePostGranted($entity, $subresource) |
| 320 | 332 | { |
| 321 | 333 | $classMetadata = $this->getClassMetadata(); |
@@ -341,6 +353,9 @@ discard block |
||
| 341 | 353 | return $classMetaData; |
| 342 | 354 | } |
| 343 | 355 | |
| 356 | + /** |
|
| 357 | + * @param string|null $subresource |
|
| 358 | + */ |
|
| 344 | 359 | protected function getSubResourceEntityClass($subresource) |
| 345 | 360 | { |
| 346 | 361 | /** @var PropertyMetadata $propertyMetadata */ |
@@ -349,6 +364,9 @@ discard block |
||
| 349 | 364 | return $propertyMetadata->getTargetClass(); |
| 350 | 365 | } |
| 351 | 366 | |
| 367 | + /** |
|
| 368 | + * @param string $propertyPath |
|
| 369 | + */ |
|
| 352 | 370 | protected function resolveSubject($entity, $propertyPath) |
| 353 | 371 | { |
| 354 | 372 | if ('this' === $propertyPath) { |
@@ -375,6 +393,7 @@ discard block |
||
| 375 | 393 | } |
| 376 | 394 | |
| 377 | 395 | /** |
| 396 | + * @param string|null $subresource |
|
| 378 | 397 | * @return string[] |
| 379 | 398 | */ |
| 380 | 399 | protected function getSubresourceSerializationGroups($subresource) |
@@ -67,6 +67,9 @@ |
||
| 67 | 67 | $event->setResponse($response); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | + /** |
|
| 71 | + * @param Request $request |
|
| 72 | + */ |
|
| 70 | 73 | private function isInterceptionPath(?Request $request): bool |
| 71 | 74 | { |
| 72 | 75 | if (null === $request) { |
@@ -95,6 +95,10 @@ |
||
| 95 | 95 | return null; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + /** |
|
| 99 | + * @param string $currentPath |
|
| 100 | + * @param string[] $includes |
|
| 101 | + */ |
|
| 98 | 102 | private function isIncluded($currentPath, array $paths, ?array $includes): bool |
| 99 | 103 | { |
| 100 | 104 | if (null === $includes) { |
@@ -164,6 +164,9 @@ |
||
| 164 | 164 | return false; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | + /** |
|
| 168 | + * @param string $type |
|
| 169 | + */ |
|
| 167 | 170 | private function convert( |
| 168 | 171 | $type, |
| 169 | 172 | $value |