Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 0e4979f

Browse files
gszyweierophinney
authored andcommitted
Use ::class instead of string to identify Zend\Authentication classes
1 parent 966894c commit 0e4979f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Helper/Service/IdentityFactory.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
namespace Zend\View\Helper\Service;
1111

1212
use Interop\Container\ContainerInterface;
13+
use Zend\Authentication\AuthenticationService;
14+
use Zend\Authentication\AuthenticationServiceInterface;
1315
use Zend\ServiceManager\FactoryInterface;
1416
use Zend\ServiceManager\ServiceLocatorInterface;
1517
use Zend\View\Helper\Identity;
@@ -31,10 +33,10 @@ public function __invoke(ContainerInterface $container, $name, array $options =
3133
$container = $container->getServiceLocator();
3234
}
3335
$helper = new Identity();
34-
if ($container->has('Zend\Authentication\AuthenticationService')) {
35-
$helper->setAuthenticationService($container->get('Zend\Authentication\AuthenticationService'));
36-
} elseif ($container->has('Zend\Authentication\AuthenticationServiceInterface')) {
37-
$helper->setAuthenticationService($container->get('Zend\Authentication\AuthenticationServiceInterface'));
36+
if ($container->has(AuthenticationService::class)) {
37+
$helper->setAuthenticationService($container->get(AuthenticationService::class));
38+
} elseif ($container->has(AuthenticationServiceInterface::class)) {
39+
$helper->setAuthenticationService($container->get(AuthenticationServiceInterface::class));
3840
}
3941
return $helper;
4042
}

0 commit comments

Comments
 (0)