Skip to content

Commit

Permalink
Coding Standards Fixer Bot
Browse files Browse the repository at this point in the history
  • Loading branch information
Pimcore Bot committed May 15, 2019
1 parent 1afa5e7 commit e2515cd
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 361 deletions.
@@ -1,50 +1,49 @@
<?php
/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Enterprise License (PEL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PEL
*/

namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler;

use Pimcore\Bundle\CoreBundle\EventListener\LegacyTemplateListener;
use Pimcore\Bundle\CoreBundle\Templating\LegacyTemplateGuesser;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

class LegacyTemplatePass implements CompilerPassInterface
{
/**
* Replace SensioFrameworkExtraBundle template guesser & view listener with our implementation to support PHP templates
*
* @inheritDoc
*/
public function process(ContainerBuilder $container)
{
if ($container->hasDefinition('sensio_framework_extra.view.guesser')) {
$definition = $container->getDefinition('sensio_framework_extra.view.guesser');
$definition
->setPublic(true)
->setClass(LegacyTemplateGuesser::class)
->addArgument(new Reference('templating'));
}


if ($container->hasDefinition('sensio_framework_extra.view.listener')) {
$definition = $container->getDefinition('sensio_framework_extra.view.listener');
$definition
->setClass(LegacyTemplateListener::class)
->addMethodCall('setTemplateEngine', [
new Reference('templating')
]);
}
}
}
<?php
/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Enterprise License (PEL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PEL
*/

namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler;

use Pimcore\Bundle\CoreBundle\EventListener\LegacyTemplateListener;
use Pimcore\Bundle\CoreBundle\Templating\LegacyTemplateGuesser;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

class LegacyTemplatePass implements CompilerPassInterface
{
/**
* Replace SensioFrameworkExtraBundle template guesser & view listener with our implementation to support PHP templates
*
* @inheritDoc
*/
public function process(ContainerBuilder $container)
{
if ($container->hasDefinition('sensio_framework_extra.view.guesser')) {
$definition = $container->getDefinition('sensio_framework_extra.view.guesser');
$definition
->setPublic(true)
->setClass(LegacyTemplateGuesser::class)
->addArgument(new Reference('templating'));
}

if ($container->hasDefinition('sensio_framework_extra.view.listener')) {
$definition = $container->getDefinition('sensio_framework_extra.view.listener');
$definition
->setClass(LegacyTemplateListener::class)
->addMethodCall('setTemplateEngine', [
new Reference('templating')
]);
}
}
}
@@ -1,41 +1,42 @@
<?php
/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Enterprise License (PEL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PEL
*/

namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler;

use Pimcore\Routing\Loader\AnnotatedRouteControllerLoader;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* Set annotation loader to our own implementation normalizing admin routes: converts the prefix
* pimcore_pimcoreadmin_ to just pimcore_admin_
*
*/
class RoutingLoaderPass implements CompilerPassInterface
{
/**
* Replace Annotated Routing loader with your implementation to normalizes autogenerated admin routes
* @inheritDoc
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('routing.loader.annotation')) {
return;
}

$definition = $container->getDefinition('routing.loader.annotation');
$definition->setClass(AnnotatedRouteControllerLoader::class);
}
}
<?php
/**
* Pimcore
*
* This source file is available under two different licenses:
* - GNU General Public License version 3 (GPLv3)
* - Pimcore Enterprise License (PEL)
* Full copyright and license information is available in
* LICENSE.md which is distributed with this source code.
*
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
* @license http://www.pimcore.org/license GPLv3 and PEL
*/

namespace Pimcore\Bundle\CoreBundle\DependencyInjection\Compiler;

use Pimcore\Routing\Loader\AnnotatedRouteControllerLoader;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

/**
* Set annotation loader to our own implementation normalizing admin routes: converts the prefix
* pimcore_pimcoreadmin_ to just pimcore_admin_
*
*/
class RoutingLoaderPass implements CompilerPassInterface
{
/**
* Replace Annotated Routing loader with your implementation to normalizes autogenerated admin routes
*
* @inheritDoc
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('routing.loader.annotation')) {
return;
}

$definition = $container->getDefinition('routing.loader.annotation');
$definition->setClass(AnnotatedRouteControllerLoader::class);
}
}
Expand Up @@ -35,7 +35,6 @@
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
Expand Down

0 comments on commit e2515cd

Please sign in to comment.