for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Silverback API Components Bundle Project
*
* (c) Daniel West <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Silverback\ApiComponentsBundle\ApiPlatform\Api;
use ApiPlatform\Api\IriConverterInterface;
use ApiPlatform\Api\UrlGeneratorInterface;
use ApiPlatform\Metadata\Operation;
use Silverback\ApiComponentsBundle\Entity\Core\Route;
/**
* @author Daniel West <[email protected]>
class IriConverter implements IriConverterInterface
{
public function __construct(private IriConverterInterface $decorated)
}
public function getResourceFromIri(string $iri, array $context = [], ?Operation $operation = null): object
return $this->decorated->getResourceFromIri($iri, $context, $operation);
public function getIriFromResource($resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): ?string
if ($resource instanceof Route && ($path = $resource->getPath())) {
return '/_/routes/' . $path;
return $this->decorated->getIriFromResource($resource, $referenceType, $operation, $context);