| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function getIriFromResource($resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): ?string |
||
| 36 | { |
||
| 37 | $iri = $this->decorated->getIriFromResource($resource, $referenceType, $operation, $context); |
||
| 38 | |||
| 39 | if (\is_string($resource)) { |
||
| 40 | return $iri; |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($this->publishableStatusChecker->getAnnotationReader()->isConfigured($resource) && !$this->publishableStatusChecker->isActivePublishedAt($resource)) { |
||
| 44 | $iri .= '?draft=1'; |
||
| 45 | } |
||
| 46 | |||
| 47 | return $iri; |
||
| 48 | } |
||
| 50 |