-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Use PSR-4 everywhere instead of PSR-0 #11199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,30 @@ | |
|
||
use Symfony\Component\Debug\Exception\FatalErrorException; | ||
use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler; | ||
use Symfony\Component\Debug\DebugClassLoader; | ||
use Composer\Autoload\ClassLoader as ComposerClassLoader; | ||
|
||
class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public static function setUpBeforeClass() | ||
{ | ||
foreach (spl_autoload_functions() as $function) { | ||
if (!is_array($function)) { | ||
continue; | ||
} | ||
|
||
// get class loaders wrapped by DebugClassLoader | ||
if ($function[0] instanceof DebugClassLoader) { | ||
$function = $function[0]->getClassLoader(); | ||
} | ||
|
||
if ($function[0] instanceof ComposerClassLoader) { | ||
$function[0]->add('Symfony\Component\Debug\Tests\Fixtures', dirname(dirname(dirname(dirname(dirname(__DIR__)))))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity : Why so many There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to give it an absolute path directly, but yeah maybe this isn't so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I could but is there really a difference? Either way is fairly unreadable junk that forces you to count dir levels. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is not more readable using the standard unix '../' instead of dirname? Just asking. |
||
break; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @dataProvider provideClassNotFoundData | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPrefixesPsr4
only exists in the Composer ClassLoader, not in the Symfony oneThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right I missed the second part of the if above, will fix :)