Skip to content

Commit

Permalink
[RedirectBundle] Cleanup redirect adminlist deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Mar 31, 2024
1 parent db42da6 commit df89e61
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,27 @@

namespace Kunstmaan\RedirectBundle\Controller;

use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface;
use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface;
use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController;
use Kunstmaan\RedirectBundle\AdminList\RedirectAdminListConfigurator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class RedirectAdminListController extends AbstractAdminListController
{
/**
* @var DomainConfigurationInterface|AdminListConfiguratorInterface
* @var AdminListConfiguratorInterface
*/
private $configurator;

/**
* @param DomainConfigurationInterface|AdminListConfiguratorInterface $configurator
*/
public function __construct(/**AdminListConfiguratorInterface*/ $configurator)
public function __construct(AdminListConfiguratorInterface $configurator)
{
$this->configurator = $configurator;
if (!$configurator instanceof AdminListConfiguratorInterface) {
trigger_deprecation('kunstmaan/redirect-bundle', '6.4', 'Passing a "DomainConfigurationInterface" instance for the first parameter in "%s" is deprecated and a AdminListConfiguratorInterface instance will be required in 7.0.', __METHOD__);
}
}

public function getAdminListConfigurator(): AdminListConfiguratorInterface
{
if ($this->configurator instanceof AdminListConfiguratorInterface) {
return $this->configurator;
}

return new RedirectAdminListConfigurator($this->getEntityManager(), null, $this->configurator);
return $this->configurator;
}

#[Route(path: '/', name: 'kunstmaanredirectbundle_admin_redirect')]
Expand Down

0 comments on commit df89e61

Please sign in to comment.