Passed
Pull Request — master (#737)
by Vadim
07:15
created
src/Config/src/Loader/JsonLoader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         $content = file_get_contents($filename);
24 24
         $data = json_decode($content, true);
25 25
 
26
-        if (is_null($data)) {
26
+        if (is_null($data)){
27 27
             throw new LoaderException(json_last_error_msg(), json_last_error());
28 28
         }
29 29
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
         $content = file_get_contents($filename);
24 24
         $data = json_decode($content, true);
25 25
 
26
-        if (is_null($data)) {
26
+        if (is_null($data))
27
+        {
27 28
             throw new LoaderException(json_last_error_msg(), json_last_error());
28 29
         }
29 30
 
Please login to merge, or discard this patch.
src/Config/src/ConfigManager.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function setDefaults(string $section, array $data): void
71 71
     {
72
-        if (isset($this->defaults[$section])) {
72
+        if (isset($this->defaults[$section])){
73 73
             throw new ConfiguratorException("Unable to set default config `{$section}` more than once.");
74 74
         }
75 75
 
76
-        if (isset($this->data[$section])) {
76
+        if (isset($this->data[$section])){
77 77
             throw new ConfigDeliveredException("Unable to set default config `{$section}`, config has been loaded.");
78 78
         }
79 79
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function modify(string $section, PatchInterface $patch): array
87 87
     {
88
-        if (isset($this->instances[$section])) {
89
-            if ($this->strict) {
88
+        if (isset($this->instances[$section])){
89
+            if ($this->strict){
90 90
                 throw new ConfigDeliveredException(
91 91
                     "Unable to patch config `{$section}`, config object has already been delivered."
92 92
                 );
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 
98 98
         $data = $this->getConfig($section);
99 99
 
100
-        try {
100
+        try{
101 101
             return $this->data[$section] = $patch->patch($data);
102
-        } catch (PatchException $e) {
102
+        }catch (PatchException $e){
103 103
             throw new PatchException("Unable to modify config `{$section}`.", $e->getCode(), $e);
104 104
         }
105 105
     }
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function getConfig(string $section = null): array
111 111
     {
112
-        if (isset($this->data[$section])) {
112
+        if (isset($this->data[$section])){
113 113
             return $this->data[$section];
114 114
         }
115 115
 
116
-        if (isset($this->defaults[$section])) {
116
+        if (isset($this->defaults[$section])){
117 117
             $data = [];
118
-            if ($this->loader->has($section)) {
118
+            if ($this->loader->has($section)){
119 119
                 $data = $this->loader->load($section);
120 120
             }
121 121
 
122 122
             $data = array_merge($this->defaults[$section], $data);
123
-        } else {
123
+        }else{
124 124
             $data = $this->loader->load($section);
125 125
         }
126 126
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     public function createInjection(\ReflectionClass $class, string $context = null)
134 134
     {
135 135
         $config = $class->getConstant('CONFIG');
136
-        if (isset($this->instances[$config])) {
136
+        if (isset($this->instances[$config])){
137 137
             return $this->instances[$config];
138 138
         }
139 139
 
Please login to merge, or discard this patch.
Braces   +24 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,11 +69,13 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function setDefaults(string $section, array $data): void
71 71
     {
72
-        if (isset($this->defaults[$section])) {
72
+        if (isset($this->defaults[$section]))
73
+        {
73 74
             throw new ConfiguratorException("Unable to set default config `{$section}` more than once.");
74 75
         }
75 76
 
76
-        if (isset($this->data[$section])) {
77
+        if (isset($this->data[$section]))
78
+        {
77 79
             throw new ConfigDeliveredException("Unable to set default config `{$section}`, config has been loaded.");
78 80
         }
79 81
 
@@ -85,8 +87,10 @@  discard block
 block discarded – undo
85 87
      */
86 88
     public function modify(string $section, PatchInterface $patch): array
87 89
     {
88
-        if (isset($this->instances[$section])) {
89
-            if ($this->strict) {
90
+        if (isset($this->instances[$section]))
91
+        {
92
+            if ($this->strict)
93
+            {
90 94
                 throw new ConfigDeliveredException(
91 95
                     "Unable to patch config `{$section}`, config object has already been delivered."
92 96
                 );
@@ -97,9 +101,12 @@  discard block
 block discarded – undo
97 101
 
98 102
         $data = $this->getConfig($section);
99 103
 
100
-        try {
104
+        try
105
+        {
101 106
             return $this->data[$section] = $patch->patch($data);
102
-        } catch (PatchException $e) {
107
+        }
108
+        catch (PatchException $e)
109
+        {
103 110
             throw new PatchException("Unable to modify config `{$section}`.", $e->getCode(), $e);
104 111
         }
105 112
     }
@@ -109,18 +116,23 @@  discard block
 block discarded – undo
109 116
      */
110 117
     public function getConfig(string $section = null): array
111 118
     {
112
-        if (isset($this->data[$section])) {
119
+        if (isset($this->data[$section]))
120
+        {
113 121
             return $this->data[$section];
114 122
         }
115 123
 
116
-        if (isset($this->defaults[$section])) {
124
+        if (isset($this->defaults[$section]))
125
+        {
117 126
             $data = [];
118
-            if ($this->loader->has($section)) {
127
+            if ($this->loader->has($section))
128
+            {
119 129
                 $data = $this->loader->load($section);
120 130
             }
121 131
 
122 132
             $data = array_merge($this->defaults[$section], $data);
123
-        } else {
133
+        }
134
+        else
135
+        {
124 136
             $data = $this->loader->load($section);
125 137
         }
126 138
 
@@ -133,7 +145,8 @@  discard block
 block discarded – undo
133 145
     public function createInjection(\ReflectionClass $class, string $context = null)
134 146
     {
135 147
         $config = $class->getConstant('CONFIG');
136
-        if (isset($this->instances[$config])) {
148
+        if (isset($this->instances[$config]))
149
+        {
137 150
             return $this->instances[$config];
138 151
         }
139 152
 
Please login to merge, or discard this patch.
src/Config/src/Patch/Delete.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,20 +45,20 @@
 block discarded – undo
45 45
      */
46 46
     public function patch(array $config): array
47 47
     {
48
-        try {
48
+        try{
49 49
             $target = &$this->dotGet($config, $this->position);
50 50
 
51
-            if ($this->key !== null) {
51
+            if ($this->key !== null){
52 52
                 unset($target[$this->key]);
53
-            } else {
54
-                foreach ($target as $key => $value) {
55
-                    if ($value === $this->value) {
53
+            }else{
54
+                foreach ($target as $key => $value){
55
+                    if ($value === $this->value){
56 56
                         unset($target[$key]);
57 57
                         break;
58 58
                     }
59 59
                 }
60 60
             }
61
-        } catch (DotNotFoundException $e) {
61
+        }catch (DotNotFoundException $e){
62 62
             // doing nothing when section not found
63 63
         }
64 64
 
Please login to merge, or discard this patch.
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,20 +45,28 @@
 block discarded – undo
45 45
      */
46 46
     public function patch(array $config): array
47 47
     {
48
-        try {
48
+        try
49
+        {
49 50
             $target = &$this->dotGet($config, $this->position);
50 51
 
51
-            if ($this->key !== null) {
52
+            if ($this->key !== null)
53
+            {
52 54
                 unset($target[$this->key]);
53
-            } else {
54
-                foreach ($target as $key => $value) {
55
-                    if ($value === $this->value) {
55
+            }
56
+            else
57
+            {
58
+                foreach ($target as $key => $value)
59
+                {
60
+                    if ($value === $this->value)
61
+                    {
56 62
                         unset($target[$key]);
57 63
                         break;
58 64
                     }
59 65
                 }
60 66
             }
61
-        } catch (DotNotFoundException $e) {
67
+        }
68
+        catch (DotNotFoundException $e)
69
+        {
62 70
             // doing nothing when section not found
63 71
         }
64 72
 
Please login to merge, or discard this patch.
src/Config/src/Patch/Append.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,15 +46,15 @@
 block discarded – undo
46 46
      */
47 47
     public function patch(array $config): array
48 48
     {
49
-        try {
49
+        try{
50 50
             $target = &$this->dotGet($config, $this->position);
51 51
 
52
-            if ($this->key !== null) {
52
+            if ($this->key !== null){
53 53
                 $target[$this->key] = $this->value;
54
-            } else {
54
+            }else{
55 55
                 $target[] = $this->value;
56 56
             }
57
-        } catch (DotNotFoundException $e) {
57
+        }catch (DotNotFoundException $e){
58 58
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
59 59
         }
60 60
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,15 +46,21 @@
 block discarded – undo
46 46
      */
47 47
     public function patch(array $config): array
48 48
     {
49
-        try {
49
+        try
50
+        {
50 51
             $target = &$this->dotGet($config, $this->position);
51 52
 
52
-            if ($this->key !== null) {
53
+            if ($this->key !== null)
54
+            {
53 55
                 $target[$this->key] = $this->value;
54
-            } else {
56
+            }
57
+            else
58
+            {
55 59
                 $target[] = $this->value;
56 60
             }
57
-        } catch (DotNotFoundException $e) {
61
+        }
62
+        catch (DotNotFoundException $e)
63
+        {
58 64
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
59 65
         }
60 66
 
Please login to merge, or discard this patch.
src/Config/src/Patch/Traits/DotTrait.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@
 block discarded – undo
23 23
     private function &dotGet(array &$data, string $name)
24 24
     {
25 25
         //Generating path relative to a given name and prefix
26
-        $path = (!empty($this->prefix) ? $this->prefix . '.' : '') . $name;
27
-        if (empty($path)) {
26
+        $path = (!empty($this->prefix) ? $this->prefix.'.' : '').$name;
27
+        if (empty($path)){
28 28
             return $data;
29 29
         }
30 30
 
31 31
         $path = explode('.', rtrim($path, '.'));
32
-        foreach ($path as $step) {
33
-            if (!is_array($data) || !array_key_exists($step, $data)) {
32
+        foreach ($path as $step){
33
+            if (!is_array($data) || !array_key_exists($step, $data)){
34 34
                 throw new DotNotFoundException("Unable to find config element '{$name}'.");
35 35
             }
36 36
             $data = &$data[$step];
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,13 +24,16 @@
 block discarded – undo
24 24
     {
25 25
         //Generating path relative to a given name and prefix
26 26
         $path = (!empty($this->prefix) ? $this->prefix . '.' : '') . $name;
27
-        if (empty($path)) {
27
+        if (empty($path))
28
+        {
28 29
             return $data;
29 30
         }
30 31
 
31 32
         $path = explode('.', rtrim($path, '.'));
32
-        foreach ($path as $step) {
33
-            if (!is_array($data) || !array_key_exists($step, $data)) {
33
+        foreach ($path as $step)
34
+        {
35
+            if (!is_array($data) || !array_key_exists($step, $data))
36
+            {
34 37
                 throw new DotNotFoundException("Unable to find config element '{$name}'.");
35 38
             }
36 39
             $data = &$data[$step];
Please login to merge, or discard this patch.
src/Config/src/Patch/Prepend.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,15 +46,15 @@
 block discarded – undo
46 46
      */
47 47
     public function patch(array $config): array
48 48
     {
49
-        try {
49
+        try{
50 50
             $target = &$this->dotGet($config, $this->position);
51 51
 
52
-            if ($this->key !== null) {
52
+            if ($this->key !== null){
53 53
                 $target = array_merge([$this->key => $this->value], $target);
54
-            } else {
54
+            }else{
55 55
                 array_unshift($target, $this->value);
56 56
             }
57
-        } catch (DotNotFoundException $e) {
57
+        }catch (DotNotFoundException $e){
58 58
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
59 59
         }
60 60
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,15 +46,21 @@
 block discarded – undo
46 46
      */
47 47
     public function patch(array $config): array
48 48
     {
49
-        try {
49
+        try
50
+        {
50 51
             $target = &$this->dotGet($config, $this->position);
51 52
 
52
-            if ($this->key !== null) {
53
+            if ($this->key !== null)
54
+            {
53 55
                 $target = array_merge([$this->key => $this->value], $target);
54
-            } else {
56
+            }
57
+            else
58
+            {
55 59
                 array_unshift($target, $this->value);
56 60
             }
57
-        } catch (DotNotFoundException $e) {
61
+        }
62
+        catch (DotNotFoundException $e)
63
+        {
58 64
             throw new PatchException($e->getMessage(), $e->getCode(), $e);
59 65
         }
60 66
 
Please login to merge, or discard this patch.
src/Config/tests/BaseTest.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@
 block discarded – undo
30 30
 
31 31
     protected function getFactory(string $directory = null, bool $strict = true): ConfigManager
32 32
     {
33
-        if (is_null($directory)) {
33
+        if (is_null($directory))
34
+        {
34 35
             $directory = __DIR__ . '/fixtures';
35 36
         }
36 37
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
 
33 33
     protected function getFactory(string $directory = null, bool $strict = true): ConfigManager
34 34
     {
35
-        if (is_null($directory)) {
36
-            $directory = __DIR__ . '/fixtures';
35
+        if (is_null($directory)){
36
+            $directory = __DIR__.'/fixtures';
37 37
         }
38 38
 
39 39
         return new ConfigManager(
Please login to merge, or discard this patch.
src/Files/tests/DirectoriesTest.php 2 patches
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function testEnsureDirectory(): void
33 33
     {
34 34
         $files = new Files();
35
-        $directory = self::FIXTURE_DIRECTORY . 'directory/';
35
+        $directory = self::FIXTURE_DIRECTORY.'directory/';
36 36
 
37 37
         $this->assertFalse($files->exists($directory));
38 38
         $this->assertFalse($files->isDirectory($directory));
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function testEnsureExistedDirectory(): void
47 47
     {
48 48
         $files = new Files();
49
-        $directory = self::FIXTURE_DIRECTORY . 'directory/';
49
+        $directory = self::FIXTURE_DIRECTORY.'directory/';
50 50
 
51 51
         $this->assertFalse($files->exists($directory));
52 52
         $this->assertFalse($files->isDirectory($directory));
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function testEnsureNestedDirectory(): void
66 66
     {
67 67
         $files = new Files();
68
-        $directory = self::FIXTURE_DIRECTORY . 'directory/sub/other';
68
+        $directory = self::FIXTURE_DIRECTORY.'directory/sub/other';
69 69
 
70 70
         $this->assertFalse($files->exists($directory));
71 71
         $this->assertFalse($files->isDirectory($directory));
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function testEnsureNestedDirectoryNoRecursivePermissions(): void
80 80
     {
81 81
         $files = new Files();
82
-        $directory = self::FIXTURE_DIRECTORY . 'directory/sub/other';
82
+        $directory = self::FIXTURE_DIRECTORY.'directory/sub/other';
83 83
 
84 84
         $this->assertFalse($files->exists($directory));
85 85
         $this->assertFalse($files->isDirectory($directory));
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
     public function testEnsureExistedNestedDirectory(): void
94 94
     {
95 95
         $files = new Files();
96
-        $directory = self::FIXTURE_DIRECTORY . 'directory/sub/other';
96
+        $directory = self::FIXTURE_DIRECTORY.'directory/sub/other';
97 97
 
98 98
         $this->assertFalse($files->exists($directory));
99 99
         $this->assertFalse($files->isDirectory($directory));
100 100
 
101
-        mkdir(self::FIXTURE_DIRECTORY . 'directory');
102
-        mkdir(self::FIXTURE_DIRECTORY . 'directory/sub');
103
-        mkdir(self::FIXTURE_DIRECTORY . 'directory/sub/other');
101
+        mkdir(self::FIXTURE_DIRECTORY.'directory');
102
+        mkdir(self::FIXTURE_DIRECTORY.'directory/sub');
103
+        mkdir(self::FIXTURE_DIRECTORY.'directory/sub/other');
104 104
 
105 105
         $this->assertTrue($files->exists($directory));
106 106
         $this->assertTrue($files->isDirectory($directory));
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
     public function testDeleteDirectoryContent(): void
115 115
     {
116 116
         $files = new Files();
117
-        $baseDirectory = self::FIXTURE_DIRECTORY . 'directory/';
118
-        $directory = $baseDirectory . 'sub/other';
117
+        $baseDirectory = self::FIXTURE_DIRECTORY.'directory/';
118
+        $directory = $baseDirectory.'sub/other';
119 119
 
120 120
         $filenames = [
121
-            $baseDirectory . 'test.file',
122
-            $directory . 'other.file',
123
-            $directory . '.sample',
121
+            $baseDirectory.'test.file',
122
+            $directory.'other.file',
123
+            $directory.'.sample',
124 124
         ];
125 125
 
126 126
         $this->assertFalse($files->exists($baseDirectory));
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $this->assertTrue($files->exists($directory));
138 138
         $this->assertTrue($files->isDirectory($directory));
139 139
 
140
-        foreach ($filenames as $filename) {
140
+        foreach ($filenames as $filename){
141 141
             $this->assertFalse($files->exists($filename));
142 142
             $files->write($filename, 'random-data');
143 143
             $this->assertTrue($files->exists($filename));
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $this->assertFalse($files->exists($directory));
152 152
         $this->assertFalse($files->isDirectory($directory));
153 153
 
154
-        foreach ($filenames as $filename) {
154
+        foreach ($filenames as $filename){
155 155
             $this->assertFalse($files->exists($filename));
156 156
         }
157 157
     }
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
     public function testDeleteDirectory(): void
160 160
     {
161 161
         $files = new Files();
162
-        $baseDirectory = self::FIXTURE_DIRECTORY . 'directory/';
163
-        $directory = $baseDirectory . 'sub/other';
162
+        $baseDirectory = self::FIXTURE_DIRECTORY.'directory/';
163
+        $directory = $baseDirectory.'sub/other';
164 164
 
165 165
         $filenames = [
166
-            $baseDirectory . 'test.file',
167
-            $directory . 'other.file',
168
-            $directory . '.sample',
166
+            $baseDirectory.'test.file',
167
+            $directory.'other.file',
168
+            $directory.'.sample',
169 169
         ];
170 170
 
171 171
         $this->assertFalse($files->exists($baseDirectory));
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         $this->assertTrue($files->exists($directory));
183 183
         $this->assertTrue($files->isDirectory($directory));
184 184
 
185
-        foreach ($filenames as $filename) {
185
+        foreach ($filenames as $filename){
186 186
             $this->assertFalse($files->exists($filename));
187 187
             $files->write($filename, 'random-data');
188 188
             $this->assertTrue($files->exists($filename));
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         $this->assertFalse($files->exists($directory));
197 197
         $this->assertFalse($files->isDirectory($directory));
198 198
 
199
-        foreach ($filenames as $filename) {
199
+        foreach ($filenames as $filename){
200 200
             $this->assertFalse($files->exists($filename));
201 201
         }
202 202
     }
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 
208 208
         $files = new Files();
209 209
 
210
-        $files->write(self::FIXTURE_DIRECTORY . 'test', 'data');
211
-        $files->deleteDirectory(self::FIXTURE_DIRECTORY . 'test');
210
+        $files->write(self::FIXTURE_DIRECTORY.'test', 'data');
211
+        $files->deleteDirectory(self::FIXTURE_DIRECTORY.'test');
212 212
     }
213 213
 
214 214
     public function testGetFiles(): void
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,7 +137,8 @@  discard block
 block discarded – undo
137 137
         $this->assertTrue($files->exists($directory));
138 138
         $this->assertTrue($files->isDirectory($directory));
139 139
 
140
-        foreach ($filenames as $filename) {
140
+        foreach ($filenames as $filename)
141
+        {
141 142
             $this->assertFalse($files->exists($filename));
142 143
             $files->write($filename, 'random-data');
143 144
             $this->assertTrue($files->exists($filename));
@@ -151,7 +152,8 @@  discard block
 block discarded – undo
151 152
         $this->assertFalse($files->exists($directory));
152 153
         $this->assertFalse($files->isDirectory($directory));
153 154
 
154
-        foreach ($filenames as $filename) {
155
+        foreach ($filenames as $filename)
156
+        {
155 157
             $this->assertFalse($files->exists($filename));
156 158
         }
157 159
     }
@@ -182,7 +184,8 @@  discard block
 block discarded – undo
182 184
         $this->assertTrue($files->exists($directory));
183 185
         $this->assertTrue($files->isDirectory($directory));
184 186
 
185
-        foreach ($filenames as $filename) {
187
+        foreach ($filenames as $filename)
188
+        {
186 189
             $this->assertFalse($files->exists($filename));
187 190
             $files->write($filename, 'random-data');
188 191
             $this->assertTrue($files->exists($filename));
@@ -196,7 +199,8 @@  discard block
 block discarded – undo
196 199
         $this->assertFalse($files->exists($directory));
197 200
         $this->assertFalse($files->isDirectory($directory));
198 201
 
199
-        foreach ($filenames as $filename) {
202
+        foreach ($filenames as $filename)
203
+        {
200 204
             $this->assertFalse($files->exists($filename));
201 205
         }
202 206
     }
Please login to merge, or discard this patch.
src/Files/tests/IOTest.php 2 patches
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $files = new Files();
36 36
 
37
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
37
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
38 38
         $this->assertFalse($files->exists($filename));
39 39
 
40 40
         $files->write($filename, 'some-data');
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $files = new Files();
49 49
 
50
-        $directory = self::FIXTURE_DIRECTORY . '/directory/abc/';
51
-        $filename = $directory . 'test.txt';
50
+        $directory = self::FIXTURE_DIRECTORY.'/directory/abc/';
51
+        $filename = $directory.'test.txt';
52 52
 
53 53
         $this->assertFalse($files->exists($directory));
54 54
         $this->assertFalse($files->exists($filename));
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $files = new Files();
68 68
 
69
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
69
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
70 70
         $this->assertFalse($files->exists($filename));
71 71
 
72 72
         $files->write($filename, 'some-data');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         $files = new Files();
84 84
 
85
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
85
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
86 86
         $this->assertFalse($files->exists($filename));
87 87
 
88 88
         $files->read($filename);
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
         $this->expectException(FileNotFoundException::class);
102 102
 
103 103
         $files = new Files();
104
-        $files->getPermissions(self::FIXTURE_DIRECTORY . '/missing');
104
+        $files->getPermissions(self::FIXTURE_DIRECTORY.'/missing');
105 105
     }
106 106
 
107 107
     public function testAppend(): void
108 108
     {
109 109
         $files = new Files();
110 110
 
111
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
111
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
112 112
         $this->assertFalse($files->exists($filename));
113 113
 
114 114
         $files->append($filename, 'some-data');
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $files = new Files();
126 126
 
127
-        $directory = self::FIXTURE_DIRECTORY . '/directory/abc/';
128
-        $filename = $directory . 'test.txt';
127
+        $directory = self::FIXTURE_DIRECTORY.'/directory/abc/';
128
+        $filename = $directory.'test.txt';
129 129
 
130 130
         $this->assertFalse($files->exists($directory));
131 131
         $this->assertFalse($files->exists($filename));
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     {
147 147
         $files = new Files();
148 148
 
149
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
149
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
150 150
 
151 151
         $this->assertFalse($files->exists($filename));
152 152
         $files->touch($filename);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function testDelete(): void
157 157
     {
158 158
         $files = new Files();
159
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
159
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
160 160
 
161 161
         $this->assertFalse($files->exists($filename));
162 162
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     public function testDeleteMissingFile(): void
171 171
     {
172 172
         $files = new Files();
173
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
173
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
174 174
 
175 175
         $this->assertFalse($files->exists($filename));
176 176
         $files->delete($filename);
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
     public function testCopy(): void
180 180
     {
181 181
         $files = new Files();
182
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
183
-        $destination = self::FIXTURE_DIRECTORY . '/new.txt';
182
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
183
+        $destination = self::FIXTURE_DIRECTORY.'/new.txt';
184 184
 
185 185
         $this->assertFalse($files->exists($filename));
186 186
         $files->write($filename, 'some-data');
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
         $this->expectException(FileNotFoundException::class);
204 204
 
205 205
         $files = new Files();
206
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
207
-        $destination = self::FIXTURE_DIRECTORY . '/new.txt';
206
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
207
+        $destination = self::FIXTURE_DIRECTORY.'/new.txt';
208 208
 
209 209
         $this->assertFalse($files->exists($filename));
210 210
         $files->copy($filename, $destination);
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
     public function testMove(): void
214 214
     {
215 215
         $files = new Files();
216
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
217
-        $destination = self::FIXTURE_DIRECTORY . '/new.txt';
216
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
217
+        $destination = self::FIXTURE_DIRECTORY.'/new.txt';
218 218
 
219 219
         $this->assertFalse($files->exists($filename));
220 220
         $files->write($filename, 'some-data');
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
         $this->expectException(FileNotFoundException::class);
238 238
 
239 239
         $files = new Files();
240
-        $filename = self::FIXTURE_DIRECTORY . '/test.txt';
241
-        $destination = self::FIXTURE_DIRECTORY . '/new.txt';
240
+        $filename = self::FIXTURE_DIRECTORY.'/test.txt';
241
+        $destination = self::FIXTURE_DIRECTORY.'/new.txt';
242 242
 
243 243
         $this->assertFalse($files->exists($filename));
244 244
         $files->move($filename, $destination);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
         $this->assertFalse($files->isDirectory($directory));
57 57
 
58
-        $files->write($filename, 'some-data', FilesInterface::READONLY, true);
58
+        $files->write($filename, 'some-data', FilesInterface::readonly, true);
59 59
 
60 60
         $this->assertTrue($files->isDirectory($directory));
61 61
         $this->assertTrue($files->exists($filename));
Please login to merge, or discard this patch.