You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor symfony#25568 [Debug] Skip DebugClassLoader checks for already parsed files (nicolas-grekas)
This PR was merged into the 3.4 branch.
Discussion
----------
[Debug] Skip DebugClassLoader checks for already parsed files
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Perf. fix for the dev mode only: I propose to run the checks done by DebugClassLoader only once, when the file is changed/parsed.
This should improve DX much, by making the dev env faster. Here is a bench on the hello world of the standard edition (class inlining by the DIC disabled, but still):

https://blackfire.io/profiles/compare/31ff0792-9992-4658-9707-cac87a320d1f/graph
Commits
-------
f0c1223 [Debug] Skip DebugClassLoader checks for already parsed files
@trigger_error(sprintf('The "%s" class is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $name), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" %s %s "%s" that is deprecated%s.', $name, $type, $verb, $use, self::$deprecated[$use]), E_USER_DEPRECATED);
200
227
}
201
-
if (isset(self::$internal[$use]) && strncmp($ns, $use, $len)) {
228
+
if (isset(self::$internal[$use]) && \strncmp($ns, $use, $len)) {
202
229
@trigger_error(sprintf('The "%s" %s is considered internal%s. It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $name), E_USER_DEPRECATED);
203
230
}
204
231
}
@@ -209,12 +236,12 @@ public function loadClass($class)
@trigger_error(sprintf('The "%s::%s()" method is considered internal%s. It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED);
238
265
}
239
266
}
@@ -245,14 +272,14 @@ public function loadClass($class)
if (in_array(strtolower($refl->getShortName()), self::$php7Reserved)) {
282
+
if (isset(self::$php7Reserved[\strtolower($refl->getShortName())])) {
256
283
@trigger_error(sprintf('The "%s" class uses the reserved name "%s", it will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED);
257
284
}
258
285
}
@@ -350,8 +377,6 @@ public function loadClass($class)
350
377
thrownew \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1)));
The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod()" method is considered final since version 3.3. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".
0 commit comments