Skip to content

Commit

Permalink
Merge commit 'd943eeb14557c0468720e4cfddef5eb6950b264b'
Browse files Browse the repository at this point in the history
  • Loading branch information
Artjom Kurapov committed Dec 3, 2014
2 parents 483f363 + d943eeb commit 2aca0fd
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions PHPCI/Plugin/Util/FilesPluginInformation.php
Expand Up @@ -67,7 +67,7 @@ protected function loadPluginInfo()
$this->pluginInfo = array();
foreach ($this->files as $fileInfo) {
if ($fileInfo instanceof \SplFileInfo) {
if ($fileInfo->isFile()) {
if ($fileInfo->isFile() && $fileInfo->getExtension()=='php') {
$this->addPluginFromFile($fileInfo);
}
}
Expand All @@ -93,12 +93,17 @@ protected function getFullClassFromFile(\SplFileInfo $fileInfo)

$matches = array();
preg_match('#class +([A-Za-z]+) +implements#i', $contents, $matches);
$className = $matches[1];

$matches = array();
preg_match('#namespace +([A-Za-z\\\\]+);#i', $contents, $matches);
$namespace = $matches[1];

return $namespace . '\\' . $className;
if(isset($matches[1])){
$className = $matches[1];

$matches = array();
preg_match('#namespace +([A-Za-z\\\\]+);#i', $contents, $matches);
$namespace = $matches[1];

return $namespace . '\\' . $className;
}
else{
echo 'Unable to load plugin info from '.$fileInfo->getRealPath();
}
}
}

0 comments on commit 2aca0fd

Please sign in to comment.