Completed
Push — master ( 54b9b6...b49317 )
by BruceScrutinizer
02:08
created
src/Entry/Entry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         Assert::notEmpty($entry);
17 17
 
18 18
         $this->originalEntry = $entry;
19
-        $this->entry =  $entry;
19
+        $this->entry = $entry;
20 20
     }
21 21
 
22 22
     public function equalTo(self $other): bool
Please login to merge, or discard this patch.
src/Scanner/ComposerJson.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,20 +40,20 @@
 block discarded – undo
40 40
 
41 41
 
42 42
         for ($i = 0; $i < $countMax; $i++) {
43
-            $pathComposer = \getcwd() .DIRECTORY_SEPARATOR. $relativePath;
43
+            $pathComposer = \getcwd() . DIRECTORY_SEPARATOR . $relativePath;
44 44
             $realPath = \safe\realpath($pathComposer . self::COMPOSER_JSON);
45 45
 
46 46
             if (\is_readable($realPath) === false) {
47
-                $relativePath .= '..'.DIRECTORY_SEPARATOR;
47
+                $relativePath .= '..' . DIRECTORY_SEPARATOR;
48 48
                 continue;
49 49
             }
50 50
 
51 51
             $jsonArray = \safe\json_decode(
52
-                \safe\file_get_contents($pathComposer.DIRECTORY_SEPARATOR.self::COMPOSER_JSON),
52
+                \safe\file_get_contents($pathComposer . DIRECTORY_SEPARATOR . self::COMPOSER_JSON),
53 53
                 true
54 54
             );
55 55
 
56
-            if ($jsonArray['name']!==self::NAME_PROJECT) {
56
+            if ($jsonArray['name'] !== self::NAME_PROJECT) {
57 57
                 return new FileSystemPath($pathComposer);
58 58
             }
59 59
         }
Please login to merge, or discard this patch.
src/Parser/Node/PhpNode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,13 +61,13 @@
 block discarded – undo
61 61
         $this->matchKey = new BooleanMatchKey();
62 62
         $this->matchValue = new BooleanMatchValue();
63 63
 
64
-        $this->listNodeProcessor[UseUse::class] = static function (Node $node): string {
64
+        $this->listNodeProcessor[UseUse::class] = static function(Node $node): string {
65 65
 
66 66
             /** @var UseUse $node*/
67 67
             return $node->name->toCodeString();
68 68
         };
69 69
 
70
-        $this->listNodeProcessor[FullyQualified::class] = static function (Node $node): string {
70
+        $this->listNodeProcessor[FullyQualified::class] = static function(Node $node): string {
71 71
 
72 72
             /** @var FullyQualified $node*/
73 73
             return $node->toCodeString();
Please login to merge, or discard this patch.
src/Parser/PhpFileParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 final class PhpFileParser implements ParserInterface
16 16
 {
17
-    private const ONLY_ONE_ENTRY=1;
17
+    private const ONLY_ONE_ENTRY = 1;
18 18
 
19 19
     /** @var \PhpParser\Parser  */
20 20
     private $parser;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     private function fetchAst(PathInterface $pathFile): array
76 76
     {
77 77
         $code = $pathFile->get();
78
-        $keyEntryForCache = sha1($code).'.'.base64_encode($pathFile->get());
78
+        $keyEntryForCache = sha1($code) . '.' . base64_encode($pathFile->get());
79 79
 
80 80
         if (!$this->cache->has($keyEntryForCache)) {
81 81
             $code = file_get_contents($pathFile->get());
Please login to merge, or discard this patch.
src/Result/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     /** @var int  */
12 12
     private $type;
13 13
 
14
-    public function __construct(string $value, int $type=0)
14
+    public function __construct(string $value, int $type = 0)
15 15
     {
16 16
         $this->value = $value;
17 17
         $this->type = $type;
Please login to merge, or discard this patch.
src/Result/ResultCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
 
8 8
     /** @var array<Result>  */
9
-    private $listResult ;
9
+    private $listResult;
10 10
 
11 11
     public function __construct()
12 12
     {
Please login to merge, or discard this patch.
src/Db/BooleanMatchPos.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function evaluate(Iterable $data, Entry $matchMe): bool
14 14
     {   
15 15
         foreach ($data as $entry => $value) {
16
-            if (strpos($matchMe->get(), $entry) !==false) {
16
+            if (strpos($matchMe->get(), $entry) !== false) {
17 17
                 return true;
18 18
             }
19 19
         }
Please login to merge, or discard this patch.
src/Command/NamespaceProtectorCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@
 block discarded – undo
9 9
 {
10 10
     protected function execute(InputInterface $input, OutputInterface $output): int
11 11
     {
12
-        $script_start =  $this->startWatch();
12
+        $script_start = $this->startWatch();
13 13
 
14 14
         $returnValue = parent::execute($input, $output);
15 15
 
16 16
         $elapsed_time = $this->stopWatch($script_start);
17 17
 
18
-        $output->writeln("<fg=green>Elapsed time: ".$elapsed_time.'</>');
18
+        $output->writeln("<fg=green>Elapsed time: " . $elapsed_time . '</>');
19 19
 
20
-        return $returnValue ;
20
+        return $returnValue;
21 21
     }
22 22
 
23 23
     private function startWatch(): float
Please login to merge, or discard this patch.
src/Command/AbstractValidateNamespaceCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         
41 41
         $output->writeln("Boot validate analysis....");
42 42
 
43
-        $config = Config::loadFromFile(new FileSystemPath(\getcwd().'/namespace-protector-config.json'));
43
+        $config = Config::loadFromFile(new FileSystemPath(\getcwd() . '/namespace-protector-config.json'));
44 44
 
45 45
         $composerJson = new ComposerJson($config->getPathComposerJson());
46 46
         $composerJson->load();
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $fileSystem = new FileSystemScanner([$config->getStartPath()]);
49 49
         $metaDataLoader = new EnvironmentDataLoader($composerJson);
50 50
 
51
-        $directory = \sys_get_temp_dir().self::NAMESPACE_PROTECTOR_CACHE;
51
+        $directory = \sys_get_temp_dir() . self::NAMESPACE_PROTECTOR_CACHE;
52 52
         $cacheClass = $this->createCacheObject($directory);
53 53
 
54 54
         $analyser = new Analyser(new PhpFileParser($config, $metaDataLoader, $cacheClass));
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $output->writeln('Start analysis...');
66 66
         $this->processEntries($fileSystem, $analyser);
67 67
 
68
-        $output->writeln('<fg=red>Total errors: ' . $analyser->getCountErrors().'</>');
68
+        $output->writeln('<fg=red>Total errors: ' . $analyser->getCountErrors() . '</>');
69 69
 
70 70
         if ($analyser->withError()) {
71 71
             return self::FAILURE;
@@ -95,6 +95,6 @@  discard block
 block discarded – undo
95 95
     protected function createCacheObject(string $directory): CacheInterface
96 96
     {
97 97
         return new NullCache();
98
-        return new SimpleFileCache(new FileSystemPath($directory,true));
98
+        return new SimpleFileCache(new FileSystemPath($directory, true));
99 99
     }
100 100
 }
Please login to merge, or discard this patch.