Skip to content

Commit

Permalink
Php5 3 syntax (#114)
Browse files Browse the repository at this point in the history
* fix for PHP<7.0 syntax
  • Loading branch information
juliangut authored and markitosgv committed Sep 19, 2018
1 parent ab63298 commit 3071923
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions DependencyInjection/Compiler/DoctrineMappingsCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class DoctrineMappingsCompilerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
$config = $container->getExtensionConfig('gesdinet_jwt_refresh_token')[0];
$config = ($container->getExtensionConfig('gesdinet_jwt_refresh_token'))[0];

if (!class_exists('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass')
&& (isset($config['manager_type']) && 'mongodb' === strtolower($config['manager_type']))
Expand Down Expand Up @@ -60,13 +60,13 @@ protected function getORMCompilerPass(array $config)
{
$nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Entity';
$mappings = array(
realpath(dirname(__DIR__, 2).'/Resources/config/orm/doctrine-orm') => $nameSpace,
realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-orm') => $nameSpace,
);

if (isset($config['refresh_token_class']) || isset($config['refresh_token_entity'])) {
$mappings[realpath(dirname(__DIR__, 2).'/Resources/config/orm/doctrine-superclass')] = $nameSpace;
$mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-superclass')] = $nameSpace;
} else {
$mappings[realpath(dirname(__DIR__, 2).'/Resources/config/orm/doctrine-entity')] = $nameSpace;
$mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-entity')] = $nameSpace;
}

return DoctrineOrmMappingsPass::createYamlMappingDriver($mappings);
Expand All @@ -85,9 +85,9 @@ protected function getODMCompilerPass(array $config)
);

if (isset($config['refresh_token_class']) || isset($config['refresh_token_entity'])) {
$mappings[realpath(dirname(__DIR__, 2).'/Resources/config/mongodb/doctrine-superclass')] = $nameSpace;
$mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/mongodb/doctrine-superclass')] = $nameSpace;
} else {
$mappings[realpath(dirname(__DIR__, 2).'/Resources/config/mongodb/doctrine-document')] = $nameSpace;
$mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/mongodb/doctrine-document')] = $nameSpace;
}

return DoctrineMongoDBMappingsPass::createYamlMappingDriver($mappings, array());
Expand Down

0 comments on commit 3071923

Please sign in to comment.