Completed
Push — develop ( d22d35...2f1e2f )
by Paul
02:10
created
src/Parser/NodeParser/TraitNodeParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     public function invoke($node, NodeInterface $parent): void
55 55
     {
56
-        if (! $node instanceof Node\Stmt\Trait_ || ! $parent instanceof PhpFileModelInterface) {
56
+        if (!$node instanceof Node\Stmt\Trait_ || !$parent instanceof PhpFileModelInterface) {
57 57
             throw new Exception('TraitNodeParser is made to parse a trait node');
58 58
         }
59 59
 
Please login to merge, or discard this patch.
src/Parser/NodeParser/AttributeNodeParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      */
44 44
     public function invoke($node, NodeInterface $parent): void
45 45
     {
46
-        if (! $node instanceof Node\Stmt\Property || ! $parent instanceof TraitModelInterface) {
46
+        if (!$node instanceof Node\Stmt\Property || !$parent instanceof TraitModelInterface) {
47 47
             throw new Exception('AttributeNodeParser is made to parse a property node');
48 48
         }
49 49
         $isStatic   = $node->isStatic();
Please login to merge, or discard this patch.
src/Configuration/ConsoleConfig.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
     private function validateBooleans($config): void
42 42
     {
43 43
         // Check boolean parameters
44
-        if (! Validator::key('overwrite', Validator::boolType())->validate($config)) {
44
+        if (!Validator::key('overwrite', Validator::boolType())->validate($config)) {
45 45
             throw new InvalidConfigException('"overwrite" parameter must be set as a boolean.');
46 46
         }
47
-        if (! Validator::key('backup', Validator::boolType())->validate($config)) {
47
+        if (!Validator::key('backup', Validator::boolType())->validate($config)) {
48 48
             throw new InvalidConfigException('"backup" parameter must be set as a boolean.');
49 49
         }
50
-        if (! Validator::key('ignore', Validator::boolType())->validate($config)) {
50
+        if (!Validator::key('ignore', Validator::boolType())->validate($config)) {
51 51
             throw new InvalidConfigException('"ignore" parameter must be set as a boolean.');
52 52
         }
53 53
     }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
      */
62 62
     private function validateIncludeRegex($config): void
63 63
     {
64
-        if (! Validator::key('include', Validator::stringType())->validate($config)
65
-            && ! Validator::key('include', Validator::nullType())->validate($config)
64
+        if (!Validator::key('include', Validator::stringType())->validate($config)
65
+            && !Validator::key('include', Validator::nullType())->validate($config)
66 66
         ) {
67 67
             throw new InvalidConfigException('"include" parameter must be set as a string or a null value.');
68 68
         }
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private function validateExcludeRegex($config): void
79 79
     {
80
-        if (! Validator::key('exclude', Validator::stringType())->validate($config)
81
-            && ! Validator::key('exclude', Validator::nullType())->validate($config)
80
+        if (!Validator::key('exclude', Validator::stringType())->validate($config)
81
+            && !Validator::key('exclude', Validator::nullType())->validate($config)
82 82
         ) {
83 83
             throw new InvalidConfigException('"exclude" parameter must be set as a string or a null value.');
84 84
         }
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
     private function validateDirs($config): void
95 95
     {
96 96
         // Check that dirs key exists
97
-        if (! Validator::key('dirs', Validator::arrayType())->validate($config)) {
97
+        if (!Validator::key('dirs', Validator::arrayType())->validate($config)) {
98 98
             throw new InvalidConfigException('"dirs" parameter is not an array.');
99 99
         }
100 100
         // Validate each dirs
101
-        if (! Validator::arrayVal()
101
+        if (!Validator::arrayVal()
102 102
             ->each(Validator::stringType(), Validator::stringType())->validate($config['dirs'])
103 103
         ) {
104 104
             throw new InvalidConfigException('Some directories in "dirs" parameter are not strings.');
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
     private function validateFiles($config): void
116 116
     {
117 117
         // Check that files key exists
118
-        if (! Validator::key('files', Validator::arrayType())->validate($config)) {
118
+        if (!Validator::key('files', Validator::arrayType())->validate($config)) {
119 119
             throw new InvalidConfigException('"files" parameter is not an array.');
120 120
         }
121 121
         // Validate each files
122
-        if (! Validator::arrayVal()
122
+        if (!Validator::arrayVal()
123 123
             ->each(Validator::stringType(), Validator::stringType())->validate($config['files'])
124 124
         ) {
125 125
             throw new InvalidConfigException('Some files in "files" parameter are not strings.');
Please login to merge, or discard this patch.
src/Annotation/MockAnnotation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
         $phpFile = RootRetrieverHelper::getRoot($this);
55 55
         // If class to use is not from global namespace
56
-        if (! Validator::regex('/^\\\\/')->validate($decoded[0])) {
56
+        if (!Validator::regex('/^\\\\/')->validate($decoded[0])) {
57 57
             // Add the current namespace to it
58 58
             $namespace  = $phpFile->getNamespaceString();
59
-            $decoded[0] = ($namespace !== null? ($namespace . '\\') : '') . $decoded[0];
59
+            $decoded[0] = ($namespace !== null ? ($namespace . '\\') : '') . $decoded[0];
60 60
         }
61 61
         // Get the last name part
62 62
         $nameArray = explode('\\', $decoded[0]);
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
     private function validate($decoded): void
78 78
     {
79 79
         // Validate it is an array
80
-        if (! Validator::arrayType()->length(2, 2)->validate($decoded)) {
80
+        if (!Validator::arrayType()->length(2, 2)->validate($decoded)) {
81 81
             throw new AnnotationParseException(
82 82
                 '"mock" annotation content is invalid (must contains the class to mock and the property name)'
83 83
             );
84 84
         }
85 85
         // Validate that each value is a string
86
-        if (! Validator::arrayVal()->each(Validator::stringType(), Validator::intType())->validate($decoded)) {
86
+        if (!Validator::arrayVal()->each(Validator::stringType(), Validator::intType())->validate($decoded)) {
87 87
             throw new AnnotationParseException(
88 88
                 '"mock" annotation content is invalid (class and property name must be string)'
89 89
             );
Please login to merge, or discard this patch.
src/Annotation/ConstructAnnotation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
         if (Validator::stringType()->validate($decoded[$index])) {
57 57
             $phpFile = RootRetrieverHelper::getRoot($this);
58 58
             // If class to use is not from global namespace
59
-            if (! Validator::regex('/^\\\\/')->validate($decoded[$index])) {
59
+            if (!Validator::regex('/^\\\\/')->validate($decoded[$index])) {
60 60
                 // Add the current namespace to it
61 61
                 $namespace       = $phpFile->getNamespaceString();
62
-                $decoded[$index] = ($namespace !== null? ($namespace . '\\') : '') . $decoded[$index];
62
+                $decoded[$index] = ($namespace !== null ? ($namespace . '\\') : '') . $decoded[$index];
63 63
             }
64 64
             // Get the last name part
65 65
             $nameArray = explode('\\', $decoded[$index]);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     private function validate($decoded): void
83 83
     {
84 84
         // Validate it is an array
85
-        if (! Validator::arrayType()->length(1, 2)->validate($decoded)) {
85
+        if (!Validator::arrayType()->length(1, 2)->validate($decoded)) {
86 86
             throw new AnnotationParseException(
87 87
                 '"construct" annotation content is invalid (must contains parameters array, and maybe a class)'
88 88
             );
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
         $size = count($decoded);
92 92
 
93 93
         // Validate that if size is 2, first value is a string
94
-        if ($size === 2 && ! Validator::stringType()->validate($decoded[0])) {
94
+        if ($size === 2 && !Validator::stringType()->validate($decoded[0])) {
95 95
             throw new AnnotationParseException(
96 96
                 '"construct" annotation content is invalid (constructor class must be a string)'
97 97
             );
98 98
         }
99 99
         // Validate that last value is an array
100
-        if (! Validator::arrayVal()
100
+        if (!Validator::arrayVal()
101 101
             ->each(Validator::stringType(), Validator::intType())->validate($decoded[$size - 1])) {
102 102
             throw new AnnotationParseException(
103 103
                 '"construct" annotation content is invalid (constructor parameters must be a array of string)'
Please login to merge, or discard this patch.
src/Annotation/TokenConsumer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                 // It is a string opening.
204 204
                 $this->openedStringToken = $type;
205 205
             } else {
206
-                if (! $this->currentlyEscaping && $type === $this->openedStringToken) {
206
+                if (!$this->currentlyEscaping && $type === $this->openedStringToken) {
207 207
                     // We are in a string, the token is not escaped and is the same as the string opening token.
208 208
                     // Close the string.
209 209
                     $this->openedStringToken = null;
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     public function afterConsume(int $type): void
221 221
     {
222 222
         // Put in escaping mode if it were not escaping and there is a backslash token.
223
-        if (! $this->currentlyEscaping && $type === AnnotationLexer::T_BACKSLASH) {
223
+        if (!$this->currentlyEscaping && $type === AnnotationLexer::T_BACKSLASH) {
224 224
             $this->currentlyEscaping = true;
225 225
         } else {
226 226
             $this->currentlyEscaping = false;
Please login to merge, or discard this patch.
src/Parser/NodeParser/DocumentationNodeParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
      */
48 48
     public function invoke($node, NodeInterface $parent): void
49 49
     {
50
-        if (! $node instanceof Doc || ! $parent instanceof DocumentationInterface) {
50
+        if (!$node instanceof Doc || !$parent instanceof DocumentationInterface) {
51 51
             throw new Exception('DocumentationNodeParser is made to parse a documentation node');
52 52
         }
53 53
 
Please login to merge, or discard this patch.
src/Executor/DirectoryExecutor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
         $this->output->section(sprintf('Directory "%s" parsing begins.', $sourcePath));
92 92
 
93 93
         // Check if source directory exists
94
-        if (! $this->fileSystem->has($sourcePath)) {
94
+        if (!$this->fileSystem->has($sourcePath)) {
95 95
             throw new FileNotFoundException(sprintf('The source directory "%s" does not exist', $sourcePath));
96 96
         }
97 97
         if ($this->fileSystem->get($sourcePath)->getType() !== 'dir') {
Please login to merge, or discard this patch.
src/Executor/FileExecutor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function invoke(string $sourcePath, string $targetPath, string $name): bool
86 86
     {
87
-        if (! $this->fileValidator->validate($sourcePath)) {
87
+        if (!$this->fileValidator->validate($sourcePath)) {
88 88
             return false;
89 89
         }
90 90
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     public function checkTargetPath(string $targetPath): void
125 125
     {
126 126
         if ($this->fileSystem->has($targetPath)) {
127
-            if (! $this->config->hasOverwrite()) {
127
+            if (!$this->config->hasOverwrite()) {
128 128
                 throw new FileExistsException(sprintf('The target file "%s" already exists', $targetPath));
129 129
             }
130 130
             if ($this->config->hasBackup()) {
Please login to merge, or discard this patch.