Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix test, inline method and fix typo

  • Loading branch information...
commit a8fd92edf8b632e3ee4b7e220deb313ad1d98ac6 1 parent 678eddf
@GromNaN authored
View
2  src/Symfony/Bridge/Twig/CHANGELOG.md
@@ -4,7 +4,7 @@ CHANGELOG
2.5.0
-----
- * added command `twig:lint` from `TwigBundle`
+ * moved command `twig:lint` from `TwigBundle`
2.4.0
-----
View
5 src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php
@@ -63,8 +63,11 @@ private function createCommandTester()
{
$twig = new \Twig_Environment(new \Twig_Loader_Filesystem());
+ $command = new LintCommand();
+ $command->setTwigEnvironment($twig);
+
$application = new Application();
- $application->add(new LintCommand($twig));
+ $application->add($command);
$command = $application->find('twig:lint');
return new CommandTester($command);
View
18 src/Symfony/Bundle/TwigBundle/Command/LintCommand.php
@@ -23,18 +23,6 @@ class LintCommand extends BaseLintCommand implements ContainerAwareInterface
private $container;
/**
- * @return ContainerInterface
- */
- protected function getContainer()
- {
- if (null === $this->container) {
- $this->container = $this->getApplication()->getKernel()->getContainer();
- }
-
- return $this->container;
- }
-
- /**
* {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = null)
@@ -47,6 +35,10 @@ public function setContainer(ContainerInterface $container = null)
*/
public function getTwigEnvironment()
{
- return $this->getContainer()->get('twig');
+ if (null === $this->container) {
+ $this->container = $this->getApplication()->getKernel()->getContainer();
+ }
+
+ return $this->container->get('twig');
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.