Вход Регистрация
Файл: symfony-2.7/src/Symfony/Bundle/TwigBundle/Command/DebugCommand.php
Строк: 121
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace SymfonyBundleTwigBundleCommand;

use 
SymfonyBridgeTwigCommandDebugCommand as BaseDebugCommand;
use 
SymfonyComponentConsoleInputInputInterface;
use 
SymfonyComponentConsoleOutputOutputInterface;
use 
SymfonyComponentDependencyInjectionContainerInterface;
use 
SymfonyComponentDependencyInjectionContainerAwareInterface;

/**
 * Lists twig functions, filters, globals and tests present in the current project
 *
 * @author Jordi Boggiano <j.boggiano@seld.be>
 */
class DebugCommand extends BaseDebugCommand implements ContainerAwareInterface
{
    
/**
     * @var ContainerInterface|null
     */
    
private $container;

    
/**
     * {@inheritdoc}
     */
    
public function setContainer(ContainerInterface $container null)
    {
        
$this->container $container;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function getTwigEnvironment()
    {
        return 
$this->container->get('twig');
    }

    
/**
     * {@inheritdoc}
     */
    
protected function configure()
    {
        
parent::configure();

        
$this->setAliases(array('twig:debug'));
    }

    protected function 
execute(InputInterface $inputOutputInterface $output)
    {
        if (
false !== strpos($input->getFirstArgument(), ':d')) {
            
$output->writeln('<comment>The use of "twig:debug" command is deprecated since version 2.7 and will be removed in 3.0. Use the "debug:twig" instead.</comment>');
        }

        
parent::execute($input$output);
    }
}
Онлайн: 1
Реклама