@@ -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|null $type |
|
| 169 | + */ |
|
| 167 | 170 | private function convert(?string $type, $value) |
| 168 | 171 | { |
| 169 | 172 | if (null === $value) { |
@@ -354,6 +354,9 @@ |
||
| 354 | 354 | return $this; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | + /** |
|
| 358 | + * @param boolean $value |
|
| 359 | + */ |
|
| 357 | 360 | protected function getBool(?bool $value, bool $default) |
| 358 | 361 | { |
| 359 | 362 | if (null === $value) { |
@@ -317,6 +317,9 @@ discard block |
||
| 317 | 317 | return $this->getService()->findAssociationPaginated($entity, $property, $page, $perPage); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | + /** |
|
| 321 | + * @return string |
|
| 322 | + */ |
|
| 320 | 323 | protected function getEntityClass() |
| 321 | 324 | { |
| 322 | 325 | return $this->getCurrentRequest()->attributes->get('_entityClass'); |
@@ -327,6 +330,9 @@ discard block |
||
| 327 | 330 | return Inflector::tableize($this->getClassMetadata()->reflection->getShortName()); |
| 328 | 331 | } |
| 329 | 332 | |
| 333 | + /** |
|
| 334 | + * @return string |
|
| 335 | + */ |
|
| 330 | 336 | protected function getServiceId() |
| 331 | 337 | { |
| 332 | 338 | return $this->getCurrentRequest()->attributes->get('_service'); |
@@ -386,6 +392,9 @@ discard block |
||
| 386 | 392 | $this->assertRightGranted($entity, $right); |
| 387 | 393 | } |
| 388 | 394 | |
| 395 | + /** |
|
| 396 | + * @param string|null $subresource |
|
| 397 | + */ |
|
| 389 | 398 | protected function assertSubresourceListGranted($entity, $subresource) |
| 390 | 399 | { |
| 391 | 400 | $classMetadata = $this->getClassMetadata(); |
@@ -399,6 +408,9 @@ discard block |
||
| 399 | 408 | $this->assertRightGranted($entity, $right); |
| 400 | 409 | } |
| 401 | 410 | |
| 411 | + /** |
|
| 412 | + * @param string|null $subresource |
|
| 413 | + */ |
|
| 402 | 414 | protected function assertSubresourcePostGranted($entity, $subresource) |
| 403 | 415 | { |
| 404 | 416 | $classMetadata = $this->getClassMetadata(); |
@@ -412,6 +424,9 @@ discard block |
||
| 412 | 424 | $this->assertRightGranted($entity, $right); |
| 413 | 425 | } |
| 414 | 426 | |
| 427 | + /** |
|
| 428 | + * @param string|null $subresource |
|
| 429 | + */ |
|
| 415 | 430 | protected function assertSubresourcePutGranted($entity, $subresource) |
| 416 | 431 | { |
| 417 | 432 | $classMetadata = $this->getClassMetadata(); |
@@ -425,6 +440,9 @@ discard block |
||
| 425 | 440 | $this->assertRightGranted($entity, $right); |
| 426 | 441 | } |
| 427 | 442 | |
| 443 | + /** |
|
| 444 | + * @param string|null $subresource |
|
| 445 | + */ |
|
| 428 | 446 | protected function assertSubresourceDeleteGranted($entity, $subresource) |
| 429 | 447 | { |
| 430 | 448 | $classMetadata = $this->getClassMetadata(); |
@@ -450,6 +468,9 @@ discard block |
||
| 450 | 468 | return $classMetaData; |
| 451 | 469 | } |
| 452 | 470 | |
| 471 | + /** |
|
| 472 | + * @param string|null $subresource |
|
| 473 | + */ |
|
| 453 | 474 | protected function getSubResourceEntityClass($subresource) |
| 454 | 475 | { |
| 455 | 476 | /** @var PropertyMetadata $propertyMetadata */ |
@@ -458,6 +479,9 @@ discard block |
||
| 458 | 479 | return $propertyMetadata->getType(); |
| 459 | 480 | } |
| 460 | 481 | |
| 482 | + /** |
|
| 483 | + * @param string $propertyPath |
|
| 484 | + */ |
|
| 461 | 485 | protected function resolveSubject($entity, $propertyPath) |
| 462 | 486 | { |
| 463 | 487 | if ('this' === $propertyPath) { |
@@ -44,6 +44,9 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public $methods; |
| 46 | 46 | |
| 47 | + /** |
|
| 48 | + * @param string $name |
|
| 49 | + */ |
|
| 47 | 50 | public function __construct($name) |
| 48 | 51 | { |
| 49 | 52 | parent::__construct($name); |
@@ -177,6 +180,9 @@ discard block |
||
| 177 | 180 | $this->methods = $methods; |
| 178 | 181 | } |
| 179 | 182 | |
| 183 | + /** |
|
| 184 | + * @return \Metadata\PropertyMetadata |
|
| 185 | + */ |
|
| 180 | 186 | public function getPropertyMetadata(string $property): ?PropertyMetadata |
| 181 | 187 | { |
| 182 | 188 | if (array_key_exists($property, $this->propertyMetadata)) { |