Skip to content

Commit b8703c4

Browse files
committed
Updated code and docs from code mess
1 parent 212b301 commit b8703c4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ class ClassesScanner implements ClassesScannerInterface
3030

3131
/**
3232
* @param array $excludePatterns
33+
* @param string $generationDirectory
3334
*/
34-
public function __construct(array $excludePatterns = [], $generationDirectory = false)
35+
36+
public function __construct(array $excludePatterns = [], $generationDirectory = null)
3537
{
3638
$this->excludePatterns = $excludePatterns;
3739
$this->generationDirectory = $generationDirectory;
3840
}
3941

4042
public function getGenerationDirectory()
4143
{
42-
if ($this->generationDirectory === false) {
44+
if ($this->generationDirectory === null) {
4345
$directoryList = ObjectManager::getInstance()->get(DirectoryList::class);
4446
/* @var $directoryList DirectoryList */
4547
$this->generationDirectory = $directoryList->getPath(DirectoryList::GENERATION);
@@ -61,7 +63,7 @@ public function addExcludePatterns(array $excludePatterns)
6163
/**
6264
* Determines if the path provided is in the var/generation folder
6365
*
64-
* @param $path
66+
* @param string $path
6567
* @return bool
6668
*/
6769

setup/src/Magento/Setup/Module/Di/Code/Reader/FileClassScanner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function extract()
8282

8383
$this->tokens = token_get_all($this->getFileContents());
8484
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
8686
if ($token == '{' || (is_array($token) && in_array($token[0], $allowedOpenBraces))) {
8787
$braceLevel++;
8888
} else if ($token == '}') {
@@ -127,13 +127,13 @@ protected function extract()
127127
$class = '';
128128
}
129129
}
130-
return $classes;;
130+
return $classes;
131131
}
132132

133133
/**
134134
* Looks forward from the current index to determine if the namespace is nested in {} or terminated with ;
135135
*
136-
* @param $index
136+
* @param integer $index
137137
* @return bool
138138
*/
139139

setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/ClassesScannerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ public function testIsGenerationNotesGenerationPath()
4343
{
4444
self::assertTrue($this->model->isGeneration($this->generation));
4545
}
46-
4746
}

setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public function test()
120120
self::assertContains('This\Is\My\Ns\ThisIsMyTest', $result);
121121
}
122122

123-
124123
public function testGetMultiClassNameAndMultiNamespace()
125124
{
126125
$scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([

0 commit comments

Comments
 (0)