File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
Test/Unit/Module/Di/Code/Reader Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,18 @@ class ClassesScanner implements ClassesScannerInterface
30
30
31
31
/**
32
32
* @param array $excludePatterns
33
+ * @param string $generationDirectory
33
34
*/
34
- public function __construct (array $ excludePatterns = [], $ generationDirectory = false )
35
+
36
+ public function __construct (array $ excludePatterns = [], $ generationDirectory = null )
35
37
{
36
38
$ this ->excludePatterns = $ excludePatterns ;
37
39
$ this ->generationDirectory = $ generationDirectory ;
38
40
}
39
41
40
42
public function getGenerationDirectory ()
41
43
{
42
- if ($ this ->generationDirectory === false ) {
44
+ if ($ this ->generationDirectory === null ) {
43
45
$ directoryList = ObjectManager::getInstance ()->get (DirectoryList::class);
44
46
/* @var $directoryList DirectoryList */
45
47
$ this ->generationDirectory = $ directoryList ->getPath (DirectoryList::GENERATION );
@@ -61,7 +63,7 @@ public function addExcludePatterns(array $excludePatterns)
61
63
/**
62
64
* Determines if the path provided is in the var/generation folder
63
65
*
64
- * @param $path
66
+ * @param string $path
65
67
* @return bool
66
68
*/
67
69
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ protected function extract()
82
82
83
83
$ this ->tokens = token_get_all ($ this ->getFileContents ());
84
84
foreach ($ this ->tokens as $ index => $ token ) {
85
- // Is either a literal brace or an interpolated brace
85
+ // Is either a literal brace or an interpolated brace with a variable
86
86
if ($ token == '{ ' || (is_array ($ token ) && in_array ($ token [0 ], $ allowedOpenBraces ))) {
87
87
$ braceLevel ++;
88
88
} else if ($ token == '} ' ) {
@@ -127,13 +127,13 @@ protected function extract()
127
127
$ class = '' ;
128
128
}
129
129
}
130
- return $ classes ;;
130
+ return $ classes ;
131
131
}
132
132
133
133
/**
134
134
* Looks forward from the current index to determine if the namespace is nested in {} or terminated with ;
135
135
*
136
- * @param $index
136
+ * @param integer $index
137
137
* @return bool
138
138
*/
139
139
Original file line number Diff line number Diff line change @@ -43,5 +43,4 @@ public function testIsGenerationNotesGenerationPath()
43
43
{
44
44
self ::assertTrue ($ this ->model ->isGeneration ($ this ->generation ));
45
45
}
46
-
47
46
}
Original file line number Diff line number Diff line change @@ -120,7 +120,6 @@ public function test()
120
120
self ::assertContains ('This\Is\My\Ns\ThisIsMyTest ' , $ result );
121
121
}
122
122
123
-
124
123
public function testGetMultiClassNameAndMultiNamespace ()
125
124
{
126
125
$ scanner = $ this ->getMockBuilder (FileClassScanner::class)->disableOriginalConstructor ()->setMethods ([
You can’t perform that action at this time.
0 commit comments