Conditions | 6 |
Paths | 9 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function getSubresource(string $resourceClass, array $identifiers, array $context, string $operationName = null) |
||
39 | { |
||
40 | foreach ($this->dataProviders as $dataProvider) { |
||
41 | try { |
||
42 | if ($dataProvider instanceof RestrictedDataProviderInterface && !$dataProvider->supports($resourceClass, $operationName, $context)) { |
||
43 | continue; |
||
44 | } |
||
45 | |||
46 | return $dataProvider->getSubresource($resourceClass, $identifiers, $context, $operationName); |
||
47 | } catch (ResourceClassNotSupportedException $e) { |
||
48 | @trigger_error(sprintf('Throwing a "%s" in a data provider is deprecated in favor of implementing "%s"', ResourceClassNotSupportedException::class, RestrictedDataProviderInterface::class), E_USER_DEPRECATED); |
||
49 | continue; |
||
50 | } |
||
51 | } |
||
52 | |||
53 | return ($context['collection'] ?? false) ? [] : null; |
||
|
|||
54 | } |
||
56 |