8000 bug #11234 [ClassLoader] fixed PHP warning on PHP 5.3 (fabpot) · symfony/symfony@8a68e6c · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a68e6c

Browse files
committed
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
2 parents 3b9902a + 7b2e3d9 commit 8a68e6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/ClassLoader/ClassMapGenerator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
namespace Symfony\Component\ClassLoader;
1313

14+
if (!defined('T_TRAIT')) {
15+
define('T_TRAIT', 0);
16+
}
17+
1418
/**
1519
* ClassMapGenerator
1620
*
@@ -84,7 +88,6 @@ private static function findClasses($path)
8488
{
8589
$contents = file_get_contents($path);
8690
$tokens = token_get_all($contents);
87-
$T_TRAIT = version_compare(PHP_VERSION, '5.4', '<') ? -1 : T_TRAIT;
8891

8992
$classes = array();
9093

@@ -111,7 +114,7 @@ private static function findClasses($path)
111114
break;
112115
case T_CLASS:
113116
case T_INTERFACE:
114-
case $T_TRAIT:
117+
case T_TRAIT:
115118
// Find the classname
116119
while (($t = $tokens[++$i]) && is_array($t)) {
117120
if (T_STRING === $t[0]) {

0 commit comments

Comments
 (0)
0