Passed
Pull Request — master (#253)
by
unknown
02:34
created
src/Jobs/JobDispatcher.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         EnvironmentInterface $env,
40 40
         FinalizerInterface $finalizer,
41 41
         ContainerInterface $container
42
-    ) {
42
+    ){
43 43
         $this->env = $env;
44 44
         $this->finalizer = $finalizer;
45 45
         $this->container = $container;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $consumer->serve(
71 71
             $worker,
72 72
             function (\Throwable $e = null): void {
73
-                if ($e !== null) {
73
+                if ($e !== null){
74 74
                     $this->handleException($e);
75 75
                 }
76 76
 
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function handleException(\Throwable $e): void
86 86
     {
87
-        try {
87
+        try{
88 88
             $this->container->get(SnapshotterInterface::class)->register($e);
89
-        } catch (\Throwable | ContainerExceptionInterface $se) {
89
+        }catch (\Throwable | ContainerExceptionInterface $se){
90 90
             // no need to notify when unable to register an exception
91 91
         }
92 92
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,8 @@  discard block
 block discarded – undo
70 70
         $consumer->serve(
71 71
             $worker,
72 72
             function (\Throwable $e = null): void {
73
-                if ($e !== null) {
73
+                if ($e !== null)
74
+                {
74 75
                     $this->handleException($e);
75 76
                 }
76 77
 
@@ -84,9 +85,12 @@  discard block
 block discarded – undo
84 85
      */
85 86
     protected function handleException(\Throwable $e): void
86 87
     {
87
-        try {
88
+        try
89
+        {
88 90
             $this->container->get(SnapshotterInterface::class)->register($e);
89
-        } catch (\Throwable | ContainerExceptionInterface $se) {
91
+        }
92
+        catch (\Throwable | ContainerExceptionInterface $se)
93
+        {
90 94
             // no need to notify when unable to register an exception
91 95
         }
92 96
     }
Please login to merge, or discard this patch.
src/Console/Sequence/RuntimeDirectory.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         $runtimeDirectory = $this->dirs->get('runtime');
47 47
 
48
-        if (!$this->files->exists($runtimeDirectory)) {
48
+        if (!$this->files->exists($runtimeDirectory)){
49 49
             $this->files->ensureDirectory($runtimeDirectory);
50 50
             $output->writeln('<comment>created</comment>');
51 51
             return;
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
         $output->writeln('<info>exists</info>');
54 54
 
55 55
 
56
-        foreach ($this->files->getFiles($runtimeDirectory) as $filename) {
57
-            try {
56
+        foreach ($this->files->getFiles($runtimeDirectory) as $filename){
57
+            try{
58 58
                 $this->files->setPermissions($filename, FilesInterface::RUNTIME);
59 59
                 $this->files->setPermissions(dirname($filename), FilesInterface::RUNTIME);
60
-            } catch (\Throwable $e) {
60
+            }catch (\Throwable $e){
61 61
                 // @codeCoverageIgnoreStart
62 62
                 $output->writeln(
63 63
                     sprintf(
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 // @codeCoverageIgnoreEnd
71 71
             }
72 72
 
73
-            if ($output->isVerbose()) {
73
+            if ($output->isVerbose()){
74 74
                 $output->writeln(
75 75
                     sprintf(
76 76
                         '<fg=green>[updated]</fg=green> `%s`',
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,8 @@  discard block
 block discarded – undo
45 45
 
46 46
         $runtimeDirectory = $this->dirs->get('runtime');
47 47
 
48
-        if (!$this->files->exists($runtimeDirectory)) {
48
+        if (!$this->files->exists($runtimeDirectory))
49
+        {
49 50
             $this->files->ensureDirectory($runtimeDirectory);
50 51
             $output->writeln('<comment>created</comment>');
51 52
             return;
@@ -53,11 +54,15 @@  discard block
 block discarded – undo
53 54
         $output->writeln('<info>exists</info>');
54 55
 
55 56
 
56
-        foreach ($this->files->getFiles($runtimeDirectory) as $filename) {
57
-            try {
57
+        foreach ($this->files->getFiles($runtimeDirectory) as $filename)
58
+        {
59
+            try
60
+            {
58 61
                 $this->files->setPermissions($filename, FilesInterface::RUNTIME);
59 62
                 $this->files->setPermissions(dirname($filename), FilesInterface::RUNTIME);
60
-            } catch (\Throwable $e) {
63
+            }
64
+            catch (\Throwable $e)
65
+            {
61 66
                 // @codeCoverageIgnoreStart
62 67
                 $output->writeln(
63 68
                     sprintf(
@@ -70,7 +75,8 @@  discard block
 block discarded – undo
70 75
                 // @codeCoverageIgnoreEnd
71 76
             }
72 77
 
73
-            if ($output->isVerbose()) {
78
+            if ($output->isVerbose())
79
+            {
74 80
                 $output->writeln(
75 81
                     sprintf(
76 82
                         '<fg=green>[updated]</fg=green> `%s`',
Please login to merge, or discard this patch.
src/Bootloader/Security/ValidationBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
             ]
113 113
         );
114 114
 
115
-        $tokenizer->addDirectory(directory('vendor') . 'spiral/validation/src/');
115
+        $tokenizer->addDirectory(directory('vendor').'spiral/validation/src/');
116 116
     }
117 117
 
118 118
     /**
Please login to merge, or discard this patch.
src/Bootloader/Database/DisconnectsBootloader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             function () use ($container): void {
32 32
                 /** @var DatabaseManager $dbal */
33 33
                 $dbal = $container->get(DatabaseManager::class);
34
-                foreach ($dbal->getDrivers() as $driver) {
34
+                foreach ($dbal->getDrivers() as $driver){
35 35
                     $driver->disconnect();
36 36
                 }
37 37
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
             function () use ($container): void {
32 32
                 /** @var DatabaseManager $dbal */
33 33
                 $dbal = $container->get(DatabaseManager::class);
34
-                foreach ($dbal->getDrivers() as $driver) {
34
+                foreach ($dbal->getDrivers() as $driver)
35
+                {
35 36
                     $driver->disconnect();
36 37
                 }
37 38
             }
Please login to merge, or discard this patch.
src/Bootloader/Cycle/CycleBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $finalizer->addFinalizer(
55 55
             function () use ($container): void {
56
-                if ($container->hasInstance(ORMInterface::class)) {
56
+                if ($container->hasInstance(ORMInterface::class)){
57 57
                     $container->get(ORMInterface::class)->getHeap()->clean();
58 58
                 }
59 59
             }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     ): ORMInterface {
76 76
         $orm = new ORM($factory, $schema);
77 77
 
78
-        if ($promiseFactory !== null) {
78
+        if ($promiseFactory !== null){
79 79
             return $orm->withPromiseFactory($promiseFactory);
80 80
         }
81 81
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,8 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $finalizer->addFinalizer(
55 55
             function () use ($container): void {
56
-                if ($container->hasInstance(ORMInterface::class)) {
56
+                if ($container->hasInstance(ORMInterface::class))
57
+                {
57 58
                     $container->get(ORMInterface::class)->getHeap()->clean();
58 59
                 }
59 60
             }
@@ -75,7 +76,8 @@  discard block
 block discarded – undo
75 76
     ): ORMInterface {
76 77
         $orm = new ORM($factory, $schema);
77 78
 
78
-        if ($promiseFactory !== null) {
79
+        if ($promiseFactory !== null)
80
+        {
79 81
             return $orm->withPromiseFactory($promiseFactory);
80 82
         }
81 83
 
Please login to merge, or discard this patch.
src/Bootloader/Http/WebsocketsBootloader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             ]
57 57
         );
58 58
 
59
-        if ($env->get('RR_BROADCAST_PATH', null) !== null) {
59
+        if ($env->get('RR_BROADCAST_PATH', null) !== null){
60 60
             $http->addMiddleware(WebsocketsMiddleware::class);
61 61
         }
62 62
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,8 @@
 block discarded – undo
56 56
             ]
57 57
         );
58 58
 
59
-        if ($env->get('RR_BROADCAST_PATH', null) !== null) {
59
+        if ($env->get('RR_BROADCAST_PATH', null) !== null)
60
+        {
60 61
             $http->addMiddleware(WebsocketsMiddleware::class);
61 62
         }
62 63
     }
Please login to merge, or discard this patch.
src/Bootloader/Http/SessionBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                 'handler'  => new Autowire(
63 63
                     FileHandler::class,
64 64
                     [
65
-                        'directory' => $directories->get('runtime') . 'session',
65
+                        'directory' => $directories->get('runtime').'session',
66 66
                         'lifetime'  => 86400
67 67
                     ]
68 68
                 )
Please login to merge, or discard this patch.
src/Bootloader/DebugBootloader.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,16 +70,16 @@
 block discarded – undo
70 70
     {
71 71
         $state = new State();
72 72
 
73
-        foreach ($this->collectors as $collector) {
74
-            if (is_string($collector)) {
73
+        foreach ($this->collectors as $collector){
74
+            if (is_string($collector)){
75 75
                 $collector = $this->factory->make($collector);
76 76
             }
77 77
 
78
-            if ($collector instanceof Autowire) {
78
+            if ($collector instanceof Autowire){
79 79
                 $collector = $collector->resolve($this->factory);
80 80
             }
81 81
 
82
-            if (!$collector instanceof StateCollectorInterface) {
82
+            if (!$collector instanceof StateCollectorInterface){
83 83
                 throw new StateException(
84 84
                     sprintf(
85 85
                         'Unable to populate state, invalid state collector %s',
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,16 +70,20 @@
 block discarded – undo
70 70
     {
71 71
         $state = new State();
72 72
 
73
-        foreach ($this->collectors as $collector) {
74
-            if (is_string($collector)) {
73
+        foreach ($this->collectors as $collector)
74
+        {
75
+            if (is_string($collector))
76
+            {
75 77
                 $collector = $this->factory->make($collector);
76 78
             }
77 79
 
78
-            if ($collector instanceof Autowire) {
80
+            if ($collector instanceof Autowire)
81
+            {
79 82
                 $collector = $collector->resolve($this->factory);
80 83
             }
81 84
 
82
-            if (!$collector instanceof StateCollectorInterface) {
85
+            if (!$collector instanceof StateCollectorInterface)
86
+            {
83 87
                 throw new StateException(
84 88
                     sprintf(
85 89
                         'Unable to populate state, invalid state collector %s',
Please login to merge, or discard this patch.
src/Command/Database/ListCommand.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function perform(DatabaseConfig $config, DatabaseManager $dbal): void
36 36
     {
37
-        if ($this->argument('db')) {
37
+        if ($this->argument('db')){
38 38
             $databases = [$this->argument('db')];
39
-        } else {
39
+        }else{
40 40
             $databases = array_keys($config->getDatabases());
41 41
         }
42 42
 
43
-        if (empty($databases)) {
43
+        if (empty($databases)){
44 44
             $this->writeln('<fg=red>No databases found.</fg=red>');
45 45
 
46 46
             return;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             ]
59 59
         );
60 60
 
61
-        foreach ($databases as $database) {
61
+        foreach ($databases as $database){
62 62
             $database = $dbal->database($database);
63 63
 
64 64
             /** @var Driver $driver */
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
                 $database->getPrefix() ?: '<comment>---</comment>'
72 72
             ];
73 73
 
74
-            try {
74
+            try{
75 75
                 $driver->connect();
76
-            } catch (\Exception $exception) {
76
+            }catch (\Exception $exception){
77 77
                 $this->renderException($grid, $header, $exception);
78 78
 
79
-                if ($database->getName() != end($databases)) {
79
+                if ($database->getName() != end($databases)){
80 80
                     $grid->addRow(new TableSeparator());
81 81
                 }
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
             $header[] = '<info>connected</info>';
87 87
             $this->renderTables($grid, $header, $database);
88
-            if ($database->getName() != end($databases)) {
88
+            if ($database->getName() != end($databases)){
89 89
                 $grid->addRow(new TableSeparator());
90 90
             }
91 91
         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     private function renderTables(Table $grid, array $header, Database $database): void
121 121
     {
122
-        foreach ($database->getTables() as $table) {
122
+        foreach ($database->getTables() as $table){
123 123
             $grid->addRow(
124 124
                 array_merge(
125 125
                     $header,
Please login to merge, or discard this patch.
Braces   +20 added lines, -9 removed lines patch added patch discarded remove patch
@@ -34,13 +34,17 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function perform(DatabaseConfig $config, DatabaseManager $dbal): void
36 36
     {
37
-        if ($this->argument('db')) {
37
+        if ($this->argument('db'))
38
+        {
38 39
             $databases = [$this->argument('db')];
39
-        } else {
40
+        }
41
+        else
42
+        {
40 43
             $databases = array_keys($config->getDatabases());
41 44
         }
42 45
 
43
-        if (empty($databases)) {
46
+        if (empty($databases))
47
+        {
44 48
             $this->writeln('<fg=red>No databases found.</fg=red>');
45 49
 
46 50
             return;
@@ -58,7 +62,8 @@  discard block
 block discarded – undo
58 62
             ]
59 63
         );
60 64
 
61
-        foreach ($databases as $database) {
65
+        foreach ($databases as $database)
66
+        {
62 67
             $database = $dbal->database($database);
63 68
 
64 69
             /** @var Driver $driver */
@@ -71,12 +76,16 @@  discard block
 block discarded – undo
71 76
                 $database->getPrefix() ?: '<comment>---</comment>'
72 77
             ];
73 78
 
74
-            try {
79
+            try
80
+            {
75 81
                 $driver->connect();
76
-            } catch (\Exception $exception) {
82
+            }
83
+            catch (\Exception $exception)
84
+            {
77 85
                 $this->renderException($grid, $header, $exception);
78 86
 
79
-                if ($database->getName() != end($databases)) {
87
+                if ($database->getName() != end($databases))
88
+                {
80 89
                     $grid->addRow(new TableSeparator());
81 90
                 }
82 91
 
@@ -85,7 +94,8 @@  discard block
 block discarded – undo
85 94
 
86 95
             $header[] = '<info>connected</info>';
87 96
             $this->renderTables($grid, $header, $database);
88
-            if ($database->getName() != end($databases)) {
97
+            if ($database->getName() != end($databases))
98
+            {
89 99
                 $grid->addRow(new TableSeparator());
90 100
             }
91 101
         }
@@ -119,7 +129,8 @@  discard block
 block discarded – undo
119 129
      */
120 130
     private function renderTables(Table $grid, array $header, Database $database): void
121 131
     {
122
-        foreach ($database->getTables() as $table) {
132
+        foreach ($database->getTables() as $table)
133
+        {
123 134
             $grid->addRow(
124 135
                 array_merge(
125 136
                     $header,
Please login to merge, or discard this patch.