bug #11234 [ClassLoader] fixed PHP warning on PHP 5.3 (fabpot)
This PR was merged into the 2.3 branch.
Discussion
----------
[ClassLoader] fixed PHP warning on PHP 5.3
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
7b2e3d9
[ClassLoader] fixed PHP warning on PHP 5.3
This commit is contained in:
commit
8a68e6c77e
@ -11,6 +11,10 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\ClassLoader;
|
namespace Symfony\Component\ClassLoader;
|
||||||
|
|
||||||
|
if (!defined('T_TRAIT')) {
|
||||||
|
define('T_TRAIT', 0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClassMapGenerator
|
* ClassMapGenerator
|
||||||
*
|
*
|
||||||
@ -84,7 +88,6 @@ class ClassMapGenerator
|
|||||||
{
|
{
|
||||||
$contents = file_get_contents($path);
|
$contents = file_get_contents($path);
|
||||||
$tokens = token_get_all($contents);
|
$tokens = token_get_all($contents);
|
||||||
$T_TRAIT = version_compare(PHP_VERSION, '5.4', '<') ? -1 : T_TRAIT;
|
|
||||||
|
|
||||||
$classes = array();
|
$classes = array();
|
||||||
|
|
||||||
@ -111,7 +114,7 @@ class ClassMapGenerator
|
|||||||
break;
|
break;
|
||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
case T_INTERFACE:
|
case T_INTERFACE:
|
||||||
case $T_TRAIT:
|
case T_TRAIT:
|
||||||
// Find the classname
|
// Find the classname
|
||||||
while (($t = $tokens[++$i]) && is_array($t)) {
|
while (($t = $tokens[++$i]) && is_array($t)) {
|
||||||
if (T_STRING === $t[0]) {
|
if (T_STRING === $t[0]) {
|
||||||
|
Reference in New Issue
Block a user