@@ -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) { |
@@ -144,6 +144,10 @@ |
||
| 144 | 144 | return $data; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | + /** |
|
| 148 | + * @param string $currentPath |
|
| 149 | + * @param string[] $includes |
|
| 150 | + */ |
|
| 147 | 151 | private function isIncluded($currentPath, array $paths, ?array $includes): bool |
| 148 | 152 | { |
| 149 | 153 | if (null === $includes) { |
@@ -237,11 +237,17 @@ discard block |
||
| 237 | 237 | return $entity; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | + /** |
|
| 241 | + * @return string |
|
| 242 | + */ |
|
| 240 | 243 | protected function getEntityClass() |
| 241 | 244 | { |
| 242 | 245 | return $this->getCurrentRequest()->attributes->get('_entityClass'); |
| 243 | 246 | } |
| 244 | 247 | |
| 248 | + /** |
|
| 249 | + * @param string $subresource |
|
| 250 | + */ |
|
| 245 | 251 | protected function getSubResourceEntityClass($subresource) |
| 246 | 252 | { |
| 247 | 253 | /** @var PropertyMetadata $propertyMetadata */ |
@@ -291,6 +297,9 @@ discard block |
||
| 291 | 297 | return $classMetaData; |
| 292 | 298 | } |
| 293 | 299 | |
| 300 | + /** |
|
| 301 | + * @param string $propertyPath |
|
| 302 | + */ |
|
| 294 | 303 | protected function resolveSubject($entity, $propertyPath) |
| 295 | 304 | { |
| 296 | 305 | if ('this' === $propertyPath) { |
@@ -333,6 +342,9 @@ discard block |
||
| 333 | 342 | return array_merge($defaultIncludes, $includes); |
| 334 | 343 | } |
| 335 | 344 | |
| 345 | + /** |
|
| 346 | + * @param string[] $attributes |
|
| 347 | + */ |
|
| 336 | 348 | protected function denyAccessUnlessGranted($attributes, $object = null, $message = 'Access Denied.') |
| 337 | 349 | { |
| 338 | 350 | $authorizationChecker = $this->getAuthorizationChecker(); |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Dontdrinkandroot\RestBundle\Metadata\RestMetadataFactory; |
| 11 | 11 | use Dontdrinkandroot\RestBundle\Service\Normalizer; |
| 12 | 12 | use Dontdrinkandroot\RestBundle\Service\RestRequestParserInterface; |
| 13 | -use Metadata\MetadataFactoryInterface; |
|
| 14 | 13 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 15 | 14 | use Symfony\Component\HttpFoundation\Request; |
| 16 | 15 | use Symfony\Component\HttpFoundation\RequestStack; |