Skip to content

Commit

Permalink
Testing removal of PHPCS from the composer autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Feb 5, 2017
1 parent 4fc2515 commit 566a0cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 5 additions & 4 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ class Autoload
*/
public static function load($class)
{
// Include the composer autoloader if there is one, but unregister it
// as we need to include all files so we can figure out what
// the class/interface/trait name is.
// Include the composer autoloader if there is one, but re-register it
// so this autoloader runs before the composer one as we need to include
// all files so we can figure out what the class/interface/trait name is.
if (self::$composerAutoloader === null) {
if (strpos(__DIR__, 'phar://') !== 0
&& file_exists(__DIR__.'/../../autoload.php') === true
) {
self::$composerAutoloader = include __DIR__.'/../../autoload.php';
if (self::$composerAutoloader instanceof \Composer\Autoload\ClassLoader) {
self::$composerAutoloader->unregister();
#self::$composerAutoloader->unregister();
#self::$composerAutoloader->register();
} else {
// Something went wrong, so keep going without the autoloader
// although namespaced sniffs might error.
Expand Down
7 changes: 0 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
"dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"PHP_CodeSniffer\\": "src/",
"PHP_CodeSniffer\\Tests\\": "tests/"
},
"files": ["autoload.php"]
},
"require": {
"php": ">=5.4.0",
"ext-tokenizer": "*",
Expand Down

0 comments on commit 566a0cd

Please sign in to comment.