Permalink
Browse files

Fix issue in getting dependencies

Getting dependencies for classes implementing multiple interfaces was
broken.
  • Loading branch information...
1 parent ba5de1d commit 00f46248ecc9cbddc79d6b5b4c77d4579bfa59ed @markstory markstory committed Nov 17, 2012
Showing with 6 additions and 4 deletions.
  1. +2 −2 Model/ApiFile.php
  2. +4 −2 Test/test_app/inline_parents.php
View
@@ -342,7 +342,7 @@ protected function _parseClassNamesInFile($fileName, $getParents = false) {
$fileContent = file_get_contents($fileName);
$pattern = '/^\s*(?:abstract\s*)?(?:class|interface)\s+([^\s\{\:]+)\s*[^\{]*\{/mi';
if ($getParents) {
- $pattern = '/^\s*(?:abstract\s*)?(?:class|interface)\s+[^\s]*\s*(?:extends\s+([^\s\{\:]*))?(?:\s*implements\s*([^\s\{]*))?[^\{]*/mi';
+ $pattern = '/^\s*(?:abstract\s*)?(?:class|interface)\s+[^\s]*\s*(?:extends\s+([^\s\{\:]*))?(?:\s*implements\s*([^\{]*))?/mi';
}
preg_match_all($pattern, $fileContent, $matches, PREG_SET_ORDER);
@@ -351,7 +351,7 @@ protected function _parseClassNamesInFile($fileName, $getParents = false) {
$foundClasses[] = $className[1];
}
if (isset($className[2])) {
- $foundClasses = array_merge($foundClasses, explode(', ', $className[2]));
+ $foundClasses = array_merge($foundClasses, explode(', ', trim($className[2])));
}
}
foreach ($foundClasses as $i => $class) {
@@ -2,8 +2,10 @@
interface SomeOtherInterface {
const FOOO = 'foo';
}
-class BazTestFile implements SomeOtherInterface {
-
+class BazTestFile implements Countable, SomeOtherInterface {
+ public function count() {
+
+ }
}
class BarTestFile extends BazTestFile {

0 comments on commit 00f4624

Please sign in to comment.