mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 03:16:34 +00:00
fixed typos
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user