Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function getItem(string $resourceClass, $id, string $operationName = null, array $context = []) |
||
39 | { |
||
40 | foreach ($this->dataProviders as $dataProvider) { |
||
41 | try { |
||
42 | if ($dataProvider instanceof RestrictedDataProviderInterface |
||
43 | && !$dataProvider->supports($resourceClass, $operationName)) { |
||
44 | continue; |
||
45 | } |
||
46 | |||
47 | return $dataProvider->getItem($resourceClass, $id, $operationName, $context); |
||
48 | } catch (ResourceClassNotSupportedException $e) { |
||
49 | @trigger_error(sprintf('Throwing a "%s" is deprecated in favor of implementing "%s"', get_class($e), RestrictedDataProviderInterface::class), E_USER_DEPRECATED); |
||
|
|||
50 | continue; |
||
51 | } |
||
52 | } |
||
53 | |||
54 | return null; |
||
55 | } |
||
56 | } |
||
57 |
If you suppress an error, we recommend checking for the error condition explicitly: