fixed typos

This commit is contained in:
Fabien Potencier
2015-11-02 15:47:58 +01:00
parent 20249a0320
commit 04d6738ddf
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -732,12 +732,12 @@ class Twig_Environment
{
$this->runtimeInitialized = true;
foreach ($this->getExtensions() as $extension) {
foreach ($this->getExtensions() as $name => $extension) {
if (!$extension instanceof Twig_Extension_InitRuntimeInterface) {
$m = new ReflectionMethod($extension, 'initRuntime');
if ('Twig_Extension' !== $m->getDeclaringClass()->getName()) {
@trigger_error(sprintf('Defining the initRuntime() method in an extension is deprecated. Use the `needs_environment` option to get the Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig_Extension_InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED);
@trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated. Use the `needs_environment` option to get the Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig_Extension_InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED);
}
}
@@ -1264,12 +1264,12 @@ class Twig_Environment
protected function initGlobals()
{
$globals = array();
foreach ($this->extensions as $extension) {
foreach ($this->extensions as $name => $extension) {
if (!$extension instanceof Twig_Extension_GlobalsInterface) {
$m = new ReflectionMethod($extension, 'getGlobals');
if ('Twig_Extension' !== $m->getDeclaringClass()->getName()) {
@trigger_error(sprintf('Defining the getGlobals() method in an extension is deprecated without explicitly implementing Twig_Extension_GlobalsInterface.', $name), E_USER_DEPRECATED);
@trigger_error(sprintf('Defining the getGlobals() method in the "%s" extension is deprecated without explicitly implementing Twig_Extension_GlobalsInterface.', $name), E_USER_DEPRECATED);
}
}
+2 -2
View File
@@ -288,7 +288,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
$this->assertArrayHasKey('foo_global', $twig->getGlobals());
$this->assertCount(1, $this->deprecations);
$this->assertContains('Defining the getGlobals() method in an extension is deprecated', $this->deprecations[0]);
$this->assertContains('Defining the getGlobals() method in the "environment_test" extension is deprecated', $this->deprecations[0]);
restore_error_handler();
}
@@ -350,7 +350,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
$twig->initRuntime();
$this->assertCount(1, $this->deprecations);
$this->assertContains('Defining the initRuntime() method in an extension is deprecated.', $this->deprecations[0]);
$this->assertContains('Defining the initRuntime() method in the "with_deprecation" extension is deprecated.', $this->deprecations[0]);
restore_error_handler();
}