Skip to content

Commit

Permalink
Fix "Cannot declare class because the name is already in use" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jul 19, 2019
1 parent a4f7000 commit e80877a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Flex.php
Expand Up @@ -95,10 +95,10 @@ public function activate(Composer $composer, IOInterface $io)
}

// to avoid issues when Flex is upgraded, we load all PHP classes now
// that way, we are sure to use all files from the same version
// that way, we are sure to use all classes from the same version
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(__DIR__, \FilesystemIterator::SKIP_DOTS)) as $file) {
if ('.php' === substr($file, -4)) {
require_once $file;
class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__), -4)));
}
}

Expand Down

0 comments on commit e80877a

Please sign in to comment.