Passed
Pull Request — master (#249)
by Matthew
02:50
created
src/Bootloader/ServerBootloader.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,21 +40,21 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $conn = $env->get('RR_RPC', static::RPC_DEFAULT);
42 42
 
43
-        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) {
43
+        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)){
44 44
             throw new BootException(
45 45
                 "Unable to configure RPC connection, invalid DSN given `{$conn}`."
46 46
             );
47 47
         }
48 48
 
49
-        if (!in_array($parts[1], ['tcp', 'unix'])) {
49
+        if (!in_array($parts[1], ['tcp', 'unix'])){
50 50
             throw new BootException(
51 51
                 "Unable to configure RPC connection, invalid DSN given `{$conn}`."
52 52
             );
53 53
         }
54 54
 
55
-        if ($parts[1] == 'unix') {
55
+        if ($parts[1] == 'unix'){
56 56
             $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX);
57
-        } else {
57
+        }else{
58 58
             $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP);
59 59
         }
60 60
 
@@ -69,25 +69,25 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $conn = $env->get('RR_RELAY', static::WORKER_DEFAULT);
71 71
 
72
-        if ($conn === 'pipes' || empty($conn)) {
72
+        if ($conn === 'pipes' || empty($conn)){
73 73
             return new Worker(new StreamRelay(STDIN, STDOUT));
74 74
         }
75 75
 
76
-        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) {
76
+        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)){
77 77
             throw new BootException(
78 78
                 "Unable to configure Worker connection, invalid DSN given `{$conn}`."
79 79
             );
80 80
         }
81 81
 
82
-        if (!in_array($parts[1], ['tcp', 'unix'])) {
82
+        if (!in_array($parts[1], ['tcp', 'unix'])){
83 83
             throw new BootException(
84 84
                 "Unable to configure Worker connection, invalid DSN given `{$conn}`."
85 85
             );
86 86
         }
87 87
 
88
-        if ($parts[1] == 'unix') {
88
+        if ($parts[1] == 'unix'){
89 89
             $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX);
90
-        } else {
90
+        }else{
91 91
             $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP);
92 92
         }
93 93
 
Please login to merge, or discard this patch.
Braces   +20 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,21 +40,26 @@  discard block
 block discarded – undo
40 40
     {
41 41
         $conn = $env->get('RR_RPC', static::RPC_DEFAULT);
42 42
 
43
-        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) {
43
+        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts))
44
+        {
44 45
             throw new BootException(
45 46
                 "Unable to configure RPC connection, invalid DSN given `{$conn}`."
46 47
             );
47 48
         }
48 49
 
49
-        if (!in_array($parts[1], ['tcp', 'unix'])) {
50
+        if (!in_array($parts[1], ['tcp', 'unix']))
51
+        {
50 52
             throw new BootException(
51 53
                 "Unable to configure RPC connection, invalid DSN given `{$conn}`."
52 54
             );
53 55
         }
54 56
 
55
-        if ($parts[1] == 'unix') {
57
+        if ($parts[1] == 'unix')
58
+        {
56 59
             $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX);
57
-        } else {
60
+        }
61
+        else
62
+        {
58 63
             $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP);
59 64
         }
60 65
 
@@ -69,25 +74,31 @@  discard block
 block discarded – undo
69 74
     {
70 75
         $conn = $env->get('RR_RELAY', static::WORKER_DEFAULT);
71 76
 
72
-        if ($conn === 'pipes' || empty($conn)) {
77
+        if ($conn === 'pipes' || empty($conn))
78
+        {
73 79
             return new Worker(new StreamRelay(STDIN, STDOUT));
74 80
         }
75 81
 
76
-        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) {
82
+        if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts))
83
+        {
77 84
             throw new BootException(
78 85
                 "Unable to configure Worker connection, invalid DSN given `{$conn}`."
79 86
             );
80 87
         }
81 88
 
82
-        if (!in_array($parts[1], ['tcp', 'unix'])) {
89
+        if (!in_array($parts[1], ['tcp', 'unix']))
90
+        {
83 91
             throw new BootException(
84 92
                 "Unable to configure Worker connection, invalid DSN given `{$conn}`."
85 93
             );
86 94
         }
87 95
 
88
-        if ($parts[1] == 'unix') {
96
+        if ($parts[1] == 'unix')
97
+        {
89 98
             $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX);
90
-        } else {
99
+        }
100
+        else
101
+        {
91 102
             $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP);
92 103
         }
93 104
 
Please login to merge, or discard this patch.
tests/Framework/BaseTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
     public function makeApp(array $env = []): TestApp
18 18
     {
19 19
         return TestApp::init([
20
-            'root'    => __DIR__ . '/../..',
21
-            'app'     => __DIR__ . '/../app',
22
-            'runtime' => sys_get_temp_dir() . '/spiral',
23
-            'cache'   => sys_get_temp_dir() . '/spiral',
20
+            'root'    => __DIR__.'/../..',
21
+            'app'     => __DIR__.'/../app',
22
+            'runtime' => sys_get_temp_dir().'/spiral',
23
+            'cache'   => sys_get_temp_dir().'/spiral',
24 24
         ], new Environment($env), false);
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
src/Console/CommandLocator.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@
 block discarded – undo
37 37
     public function locateCommands(): array
38 38
     {
39 39
         $commands = [];
40
-        foreach ($this->classes->getClasses(SymfonyCommand::class) as $class) {
41
-            if ($class->isAbstract()) {
40
+        foreach ($this->classes->getClasses(SymfonyCommand::class) as $class){
41
+            if ($class->isAbstract()){
42 42
                 continue;
43 43
             }
44 44
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,10 @@
 block discarded – undo
37 37
     public function locateCommands(): array
38 38
     {
39 39
         $commands = [];
40
-        foreach ($this->classes->getClasses(SymfonyCommand::class) as $class) {
41
-            if ($class->isAbstract()) {
40
+        foreach ($this->classes->getClasses(SymfonyCommand::class) as $class)
41
+        {
42
+            if ($class->isAbstract())
43
+            {
42 44
                 continue;
43 45
             }
44 46
 
Please login to merge, or discard this patch.
src/Module/Publisher.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
         string $mergeMode = self::FOLLOW,
46 46
         int $mode = FilesInterface::READONLY
47 47
     ): void {
48
-        if (!$this->files->isFile($filename)) {
48
+        if (!$this->files->isFile($filename)){
49 49
             throw new PublishException("Given '{$filename}' is not valid file");
50 50
         }
51 51
 
52
-        if ($this->files->exists($destination)) {
53
-            if ($this->files->md5($destination) == $this->files->md5($filename)) {
52
+        if ($this->files->exists($destination)){
53
+            if ($this->files->md5($destination) == $this->files->md5($filename)){
54 54
                 //Nothing to do
55 55
                 return;
56 56
             }
57 57
 
58
-            if ($mergeMode == self::FOLLOW) {
58
+            if ($mergeMode == self::FOLLOW){
59 59
                 return;
60 60
             }
61 61
         }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         string $mergeMode = self::REPLACE,
78 78
         int $mode = FilesInterface::READONLY
79 79
     ): void {
80
-        if (!$this->files->isDirectory($directory)) {
80
+        if (!$this->files->isDirectory($directory)){
81 81
             throw new PublishException("Given '{$directory}' is not valid directory");
82 82
         }
83 83
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
         /**
88 88
          * @var SplFileInfo $file
89 89
          */
90
-        foreach ($finder->getIterator() as $file) {
90
+        foreach ($finder->getIterator() as $file){
91 91
             $this->publish(
92 92
                 (string)$file,
93
-                $destination . '/' . $file->getRelativePathname(),
93
+                $destination.'/'.$file->getRelativePathname(),
94 94
                 $mergeMode,
95 95
                 $mode
96 96
             );
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,17 +45,21 @@  discard block
 block discarded – undo
45 45
         string $mergeMode = self::FOLLOW,
46 46
         int $mode = FilesInterface::READONLY
47 47
     ): void {
48
-        if (!$this->files->isFile($filename)) {
48
+        if (!$this->files->isFile($filename))
49
+        {
49 50
             throw new PublishException("Given '{$filename}' is not valid file");
50 51
         }
51 52
 
52
-        if ($this->files->exists($destination)) {
53
-            if ($this->files->md5($destination) == $this->files->md5($filename)) {
53
+        if ($this->files->exists($destination))
54
+        {
55
+            if ($this->files->md5($destination) == $this->files->md5($filename))
56
+            {
54 57
                 //Nothing to do
55 58
                 return;
56 59
             }
57 60
 
58
-            if ($mergeMode == self::FOLLOW) {
61
+            if ($mergeMode == self::FOLLOW)
62
+            {
59 63
                 return;
60 64
             }
61 65
         }
@@ -77,7 +81,8 @@  discard block
 block discarded – undo
77 81
         string $mergeMode = self::REPLACE,
78 82
         int $mode = FilesInterface::READONLY
79 83
     ): void {
80
-        if (!$this->files->isDirectory($directory)) {
84
+        if (!$this->files->isDirectory($directory))
85
+        {
81 86
             throw new PublishException("Given '{$directory}' is not valid directory");
82 87
         }
83 88
 
@@ -87,7 +92,8 @@  discard block
 block discarded – undo
87 92
         /**
88 93
          * @var SplFileInfo $file
89 94
          */
90
-        foreach ($finder->getIterator() as $file) {
95
+        foreach ($finder->getIterator() as $file)
96
+        {
91 97
             $this->publish(
92 98
                 (string)$file,
93 99
                 $destination . '/' . $file->getRelativePathname(),
Please login to merge, or discard this patch.
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.