Passed
Push — master ( d279ac...d3d8e1 )
by Anton
02:34
created
src/Http/PaginationFactory.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
48 48
     {
49
-        if (!$this->container->has(ServerRequestInterface::class)) {
49
+        if (!$this->container->has(ServerRequestInterface::class)){
50 50
             throw new ScopeException('Unable to create paginator, no request scope found');
51 51
         }
52 52
         /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         //Getting page number
58 58
         $page = 0;
59
-        if (!empty($query[$parameter]) && is_scalar($query[$parameter])) {
59
+        if (!empty($query[$parameter]) && is_scalar($query[$parameter])){
60 60
             $page = (int)$query[$parameter];
61 61
         }
62 62
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
48 48
     {
49
-        if (!$this->container->has(ServerRequestInterface::class)) {
49
+        if (!$this->container->has(ServerRequestInterface::class))
50
+        {
50 51
             throw new ScopeException('Unable to create paginator, no request scope found');
51 52
         }
52 53
         /**
@@ -56,7 +57,8 @@  discard block
 block discarded – undo
56 57
 
57 58
         //Getting page number
58 59
         $page = 0;
59
-        if (!empty($query[$parameter]) && is_scalar($query[$parameter])) {
60
+        if (!empty($query[$parameter]) && is_scalar($query[$parameter]))
61
+        {
60 62
             $page = (int)$query[$parameter];
61 63
         }
62 64
 
Please login to merge, or discard this patch.
src/Bootloader/Database/MigrationsBootloader.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
40 40
         EnvironmentInterface $env,
41 41
         DirectoriesInterface $dirs
42 42
     ): void {
43
-        if (!$dirs->has('migrations')) {
43
+        if (!$dirs->has('migrations'))
44
+        {
44 45
             $dirs->set('migrations', $dirs->get('app') . 'migrations');
45 46
         }
46 47
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
         EnvironmentInterface $env,
43 43
         DirectoriesInterface $dirs
44 44
     ): void {
45
-        if (!$dirs->has('migrations')) {
46
-            $dirs->set('migrations', $dirs->get('app') . 'migrations');
45
+        if (!$dirs->has('migrations')){
46
+            $dirs->set('migrations', $dirs->get('app').'migrations');
47 47
         }
48 48
 
49 49
         $config->setDefaults(
Please login to merge, or discard this patch.
src/Bootloader/I18nBootloader.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
60 60
     {
61
-        if (!$dirs->has('locale')) {
61
+        if (!$dirs->has('locale'))
62
+        {
62 63
             $dirs->set('locale', $dirs->get('app') . 'locale/');
63 64
         }
64 65
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
      */
61 61
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
62 62
     {
63
-        if (!$dirs->has('locale')) {
64
-            $dirs->set('locale', $dirs->get('app') . 'locale/');
63
+        if (!$dirs->has('locale')){
64
+            $dirs->set('locale', $dirs->get('app').'locale/');
65 65
         }
66 66
 
67 67
         $this->config->setDefaults(
Please login to merge, or discard this patch.
src/Bootloader/Views/ViewsBootloader.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
44 44
     {
45
-        if (!$dirs->has('views')) {
45
+        if (!$dirs->has('views'))
46
+        {
46 47
             $dirs->set('views', $dirs->get('app') . 'views');
47 48
         }
48 49
 
@@ -66,7 +67,8 @@  discard block
 block discarded – undo
66 67
      */
67 68
     public function addDirectory(string $namespace, string $directory): void
68 69
     {
69
-        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) {
70
+        if (!isset($this->config->getConfig('views')['namespaces'][$namespace]))
71
+        {
70 72
             $this->config->modify('views', new Append('namespaces', $namespace, []));
71 73
         }
72 74
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
46 46
     {
47
-        if (!$dirs->has('views')) {
48
-            $dirs->set('views', $dirs->get('app') . 'views');
47
+        if (!$dirs->has('views')){
48
+            $dirs->set('views', $dirs->get('app').'views');
49 49
         }
50 50
 
51 51
         // default view config
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             [
55 55
                 'cache'        => [
56 56
                     'enabled'   => !$env->get('DEBUG', false),
57
-                    'directory' => $dirs->get('cache') . 'views'
57
+                    'directory' => $dirs->get('cache').'views'
58 58
                 ],
59 59
                 'namespaces'   => [
60 60
                     'default' => [$dirs->get('views')]
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function addDirectory(string $namespace, string $directory): void
73 73
     {
74
-        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) {
74
+        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){
75 75
             $this->config->modify('views', new Append('namespaces', $namespace, []));
76 76
         }
77 77
 
78
-        $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory));
78
+        $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory));
79 79
     }
80 80
 
81 81
     /**
Please login to merge, or discard this patch.
src/Command/Migrate/MigrateCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function perform(): void
26 26
     {
27
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
27
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment()){
28 28
             return;
29 29
         }
30 30
 
31 31
         $found = false;
32 32
         $count = $this->option('one') ? 1 : PHP_INT_MAX;
33 33
 
34
-        while ($count > 0 && ($migration = $this->migrator->run())) {
34
+        while ($count > 0 && ($migration = $this->migrator->run())){
35 35
             $found = true;
36 36
             $count--;
37 37
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             );
42 42
         }
43 43
 
44
-        if (!$found) {
44
+        if (!$found){
45 45
             $this->writeln('<fg=red>No outstanding migrations were found.</fg=red>');
46 46
         }
47 47
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,16 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function perform(): void
26 26
     {
27
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
27
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment())
28
+        {
28 29
             return;
29 30
         }
30 31
 
31 32
         $found = false;
32 33
         $count = $this->option('one') ? 1 : PHP_INT_MAX;
33 34
 
34
-        while ($count > 0 && ($migration = $this->migrator->run())) {
35
+        while ($count > 0 && ($migration = $this->migrator->run()))
36
+        {
35 37
             $found = true;
36 38
             $count--;
37 39
 
@@ -41,7 +43,8 @@  discard block
 block discarded – undo
41 43
             );
42 44
         }
43 45
 
44
-        if (!$found) {
46
+        if (!$found)
47
+        {
45 48
             $this->writeln('<fg=red>No outstanding migrations were found.</fg=red>');
46 49
         }
47 50
     }
Please login to merge, or discard this patch.
src/Command/Migrate/RollbackCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function perform(): void
26 26
     {
27
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
27
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment()){
28 28
             //Making sure we can safely migrate in this environment
29 29
             return;
30 30
         }
31 31
 
32 32
         $found = false;
33 33
         $count = !$this->option('all') ? 1 : PHP_INT_MAX;
34
-        while ($count > 0 && ($migration = $this->migrator->rollback())) {
34
+        while ($count > 0 && ($migration = $this->migrator->rollback())){
35 35
             $found = true;
36 36
             $count--;
37 37
             $this->sprintf(
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             );
41 41
         }
42 42
 
43
-        if (!$found) {
43
+        if (!$found){
44 44
             $this->writeln('<fg=red>No executed migrations were found.</fg=red>');
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,16 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function perform(): void
26 26
     {
27
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
27
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment())
28
+        {
28 29
             //Making sure we can safely migrate in this environment
29 30
             return;
30 31
         }
31 32
 
32 33
         $found = false;
33 34
         $count = !$this->option('all') ? 1 : PHP_INT_MAX;
34
-        while ($count > 0 && ($migration = $this->migrator->rollback())) {
35
+        while ($count > 0 && ($migration = $this->migrator->rollback()))
36
+        {
35 37
             $found = true;
36 38
             $count--;
37 39
             $this->sprintf(
@@ -40,7 +42,8 @@  discard block
 block discarded – undo
40 42
             );
41 43
         }
42 44
 
43
-        if (!$found) {
45
+        if (!$found)
46
+        {
44 47
             $this->writeln('<fg=red>No executed migrations were found.</fg=red>');
45 48
         }
46 49
     }
Please login to merge, or discard this patch.
src/Command/Migrate/AbstractCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function verifyConfigured(): bool
43 43
     {
44
-        if (!$this->migrator->isConfigured()) {
44
+        if (!$this->migrator->isConfigured()){
45 45
             $this->writeln(
46 46
                 "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>"
47 47
             );
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function verifyEnvironment(): bool
61 61
     {
62
-        if ($this->option('force') || $this->config->isSafe()) {
62
+        if ($this->option('force') || $this->config->isSafe()){
63 63
             //Safe to run
64 64
             return true;
65 65
         }
66 66
 
67 67
         $this->writeln('<fg=red>Confirmation is required to run migrations!</fg=red>');
68 68
 
69
-        if (!$this->askConfirmation()) {
69
+        if (!$this->askConfirmation()){
70 70
             $this->writeln('<comment>Cancelling operation...</comment>');
71 71
 
72 72
             return false;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function verifyConfigured(): bool
43 43
     {
44
-        if (!$this->migrator->isConfigured()) {
44
+        if (!$this->migrator->isConfigured())
45
+        {
45 46
             $this->writeln(
46 47
                 "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>"
47 48
             );
@@ -59,14 +60,16 @@  discard block
 block discarded – undo
59 60
      */
60 61
     protected function verifyEnvironment(): bool
61 62
     {
62
-        if ($this->option('force') || $this->config->isSafe()) {
63
+        if ($this->option('force') || $this->config->isSafe())
64
+        {
63 65
             //Safe to run
64 66
             return true;
65 67
         }
66 68
 
67 69
         $this->writeln('<fg=red>Confirmation is required to run migrations!</fg=red>');
68 70
 
69
-        if (!$this->askConfirmation()) {
71
+        if (!$this->askConfirmation())
72
+        {
70 73
             $this->writeln('<comment>Cancelling operation...</comment>');
71 74
 
72 75
             return false;
Please login to merge, or discard this patch.
src/Command/CleanCommand.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
     public function perform(FilesInterface $files, DirectoriesInterface $directories): void
27 27
     {
28 28
         $cacheDirectory = $directories->get('cache');
29
-        if (!$files->exists($cacheDirectory)) {
29
+        if (!$files->exists($cacheDirectory)){
30 30
             $this->writeln('Cache directory is missing, no cache to be cleaned.');
31 31
 
32 32
             return;
33 33
         }
34 34
 
35
-        if ($this->isVerbose()) {
35
+        if ($this->isVerbose()){
36 36
             $this->writeln('<info>Cleaning application cache:</info>');
37 37
         }
38 38
 
39
-        foreach ($files->getFiles($cacheDirectory) as $filename) {
40
-            try {
39
+        foreach ($files->getFiles($cacheDirectory) as $filename){
40
+            try{
41 41
                 $files->delete($filename);
42
-            } catch (\Throwable $e) {
42
+            }catch (\Throwable $e){
43 43
                 // @codeCoverageIgnoreStart
44 44
                 $this->sprintf(
45 45
                     "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 // @codeCoverageIgnoreEnd
52 52
             }
53 53
 
54
-            if ($this->isVerbose()) {
54
+            if ($this->isVerbose()){
55 55
                 $this->sprintf(
56 56
                     "<fg=green>[deleted]</fg=green> `%s`\n",
57 57
                     $files->relativePath($filename, $cacheDirectory)
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,20 +26,26 @@  discard block
 block discarded – undo
26 26
     public function perform(FilesInterface $files, DirectoriesInterface $directories): void
27 27
     {
28 28
         $cacheDirectory = $directories->get('cache');
29
-        if (!$files->exists($cacheDirectory)) {
29
+        if (!$files->exists($cacheDirectory))
30
+        {
30 31
             $this->writeln('Cache directory is missing, no cache to be cleaned.');
31 32
 
32 33
             return;
33 34
         }
34 35
 
35
-        if ($this->isVerbose()) {
36
+        if ($this->isVerbose())
37
+        {
36 38
             $this->writeln('<info>Cleaning application cache:</info>');
37 39
         }
38 40
 
39
-        foreach ($files->getFiles($cacheDirectory) as $filename) {
40
-            try {
41
+        foreach ($files->getFiles($cacheDirectory) as $filename)
42
+        {
43
+            try
44
+            {
41 45
                 $files->delete($filename);
42
-            } catch (\Throwable $e) {
46
+            }
47
+            catch (\Throwable $e)
48
+            {
43 49
                 // @codeCoverageIgnoreStart
44 50
                 $this->sprintf(
45 51
                     "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
@@ -51,7 +57,8 @@  discard block
 block discarded – undo
51 57
                 // @codeCoverageIgnoreEnd
52 58
             }
53 59
 
54
-            if ($this->isVerbose()) {
60
+            if ($this->isVerbose())
61
+            {
55 62
                 $this->sprintf(
56 63
                     "<fg=green>[deleted]</fg=green> `%s`\n",
57 64
                     $files->relativePath($filename, $cacheDirectory)
Please login to merge, or discard this patch.
src/Command/PublishCommand.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
         FilesInterface $files,
55 55
         DirectoriesInterface $directories
56 56
     ): void {
57
-        switch ($this->argument('type')) {
57
+        switch ($this->argument('type')){
58 58
             case 'replace':
59 59
             case 'follow':
60
-                if ($this->isDirectory()) {
60
+                if ($this->isDirectory()){
61 61
                     $this->sprintf(
62 62
                         '<fg=cyan>•</fg=cyan> publish directory <comment>%s</comment> to <comment>%s</comment>',
63 63
                         $this->getSource($files, $directories),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                         $this->getMergeMode(),
71 71
                         $this->getFileMode()
72 72
                     );
73
-                } else {
73
+                }else{
74 74
                     $this->sprintf(
75 75
                         '<fg=cyan>•</fg=cyan> publish file <comment>%s</comment> to <comment>%s</comment>',
76 76
                         $this->getSource($files, $directories),
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     private function getSource(FilesInterface $files, DirectoriesInterface $directories): ?string
112 112
     {
113
-        if (!$this->isDirectory()) {
113
+        if (!$this->isDirectory()){
114 114
             return $files->normalizePath($this->argument('source'));
115 115
         }
116 116
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     private function getTarget(FilesInterface $files, DirectoriesInterface $directories): ?string
126 126
     {
127 127
         $target = $this->argument('target');
128
-        foreach ($directories->getAll() as $alias => $value) {
128
+        foreach ($directories->getAll() as $alias => $value){
129 129
             $target = str_replace("@{$alias}", $value, $target);
130 130
         }
131 131
 
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
      */
138 138
     private function isDirectory(): bool
139 139
     {
140
-        if ($this->argument('type') == 'ensure') {
140
+        if ($this->argument('type') == 'ensure'){
141 141
             return true;
142 142
         }
143 143
 
144
-        if (strpos($this->argument('source'), '*') !== false) {
144
+        if (strpos($this->argument('source'), '*') !== false){
145 145
             return true;
146 146
         }
147 147
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     private function getMergeMode(): string
155 155
     {
156
-        switch ($this->argument('type')) {
156
+        switch ($this->argument('type')){
157 157
             case 'follow':
158 158
                 return PublisherInterface::FOLLOW;
159 159
             case 'replace':
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     private function getFileMode(): int
170 170
     {
171
-        switch ($this->argument('mode')) {
171
+        switch ($this->argument('mode')){
172 172
             case 'readonly':
173 173
                 return FilesInterface::READONLY;
174 174
             case 'runtime':
Please login to merge, or discard this patch.
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,10 +54,12 @@  discard block
 block discarded – undo
54 54
         FilesInterface $files,
55 55
         DirectoriesInterface $directories
56 56
     ): void {
57
-        switch ($this->argument('type')) {
57
+        switch ($this->argument('type'))
58
+        {
58 59
             case 'replace':
59 60
             case 'follow':
60
-                if ($this->isDirectory()) {
61
+                if ($this->isDirectory())
62
+                {
61 63
                     $this->sprintf(
62 64
                         '<fg=cyan>•</fg=cyan> publish directory <comment>%s</comment> to <comment>%s</comment>',
63 65
                         $this->getSource($files, $directories),
@@ -70,7 +72,9 @@  discard block
 block discarded – undo
70 72
                         $this->getMergeMode(),
71 73
                         $this->getFileMode()
72 74
                     );
73
-                } else {
75
+                }
76
+                else
77
+                {
74 78
                     $this->sprintf(
75 79
                         '<fg=cyan>•</fg=cyan> publish file <comment>%s</comment> to <comment>%s</comment>',
76 80
                         $this->getSource($files, $directories),
@@ -110,7 +114,8 @@  discard block
 block discarded – undo
110 114
      */
111 115
     private function getSource(FilesInterface $files, DirectoriesInterface $directories): ?string
112 116
     {
113
-        if (!$this->isDirectory()) {
117
+        if (!$this->isDirectory())
118
+        {
114 119
             return $files->normalizePath($this->argument('source'));
115 120
         }
116 121
 
@@ -125,7 +130,8 @@  discard block
 block discarded – undo
125 130
     private function getTarget(FilesInterface $files, DirectoriesInterface $directories): ?string
126 131
     {
127 132
         $target = $this->argument('target');
128
-        foreach ($directories->getAll() as $alias => $value) {
133
+        foreach ($directories->getAll() as $alias => $value)
134
+        {
129 135
             $target = str_replace("@{$alias}", $value, $target);
130 136
         }
131 137
 
@@ -137,11 +143,13 @@  discard block
 block discarded – undo
137 143
      */
138 144
     private function isDirectory(): bool
139 145
     {
140
-        if ($this->argument('type') == 'ensure') {
146
+        if ($this->argument('type') == 'ensure')
147
+        {
141 148
             return true;
142 149
         }
143 150
 
144
-        if (strpos($this->argument('source'), '*') !== false) {
151
+        if (strpos($this->argument('source'), '*') !== false)
152
+        {
145 153
             return true;
146 154
         }
147 155
 
@@ -153,7 +161,8 @@  discard block
 block discarded – undo
153 161
      */
154 162
     private function getMergeMode(): string
155 163
     {
156
-        switch ($this->argument('type')) {
164
+        switch ($this->argument('type'))
165
+        {
157 166
             case 'follow':
158 167
                 return PublisherInterface::FOLLOW;
159 168
             case 'replace':
@@ -168,7 +177,8 @@  discard block
 block discarded – undo
168 177
      */
169 178
     private function getFileMode(): int
170 179
     {
171
-        switch ($this->argument('mode')) {
180
+        switch ($this->argument('mode'))
181
+        {
172 182
             case 'readonly':
173 183
                 return FilesInterface::READONLY;
174 184
             case 'runtime':
Please login to merge, or discard this patch.