Passed
Push — master ( 7869b0...f8658e )
by Anton
02:00
created
src/Command/Migrate/StatusCommand.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function perform(FilesInterface $files)
28 28
     {
29
-        if (!$this->verifyConfigured()) {
29
+        if (!$this->verifyConfigured()){
30 30
             return;
31 31
         }
32 32
 
33
-        if (empty($this->migrator->getMigrations())) {
33
+        if (empty($this->migrator->getMigrations())){
34 34
             $this->writeln("<comment>No migrations were found.</comment>");
35 35
 
36 36
             return;
37 37
         }
38 38
 
39 39
         $table = $this->table(['Migration', 'Created at', 'Executed at']);
40
-        foreach ($this->migrator->getMigrations() as $migration) {
40
+        foreach ($this->migrator->getMigrations() as $migration){
41 41
             $state = $migration->getState();
42 42
 
43 43
             $table->addRow([
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 $state->getTimeCreated()->format('Y-m-d H:i:s'),
46 46
                 $state->getStatus() == State::STATUS_PENDING
47 47
                     ? self::PENDING
48
-                    : '<info>' . $state->getTimeExecuted()->format('Y-m-d H:i:s') . '</info>'
48
+                    : '<info>'.$state->getTimeExecuted()->format('Y-m-d H:i:s').'</info>'
49 49
             ]);
50 50
         }
51 51
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,18 +26,21 @@
 block discarded – undo
26 26
      */
27 27
     public function perform(FilesInterface $files)
28 28
     {
29
-        if (!$this->verifyConfigured()) {
29
+        if (!$this->verifyConfigured())
30
+        {
30 31
             return;
31 32
         }
32 33
 
33
-        if (empty($this->migrator->getMigrations())) {
34
+        if (empty($this->migrator->getMigrations()))
35
+        {
34 36
             $this->writeln("<comment>No migrations were found.</comment>");
35 37
 
36 38
             return;
37 39
         }
38 40
 
39 41
         $table = $this->table(['Migration', 'Created at', 'Executed at']);
40
-        foreach ($this->migrator->getMigrations() as $migration) {
42
+        foreach ($this->migrator->getMigrations() as $migration)
43
+        {
41 44
             $state = $migration->getState();
42 45
 
43 46
             $table->addRow([
Please login to merge, or discard this patch.
src/Http/RrDispacher.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         FinalizerInterface $finalizer,
47 47
         ContainerInterface $container,
48 48
         FactoryInterface $factory
49
-    ) {
49
+    ){
50 50
         $this->env = $env;
51 51
         $this->finalizer = $finalizer;
52 52
         $this->container = $container;
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
 
71 71
         /** @var Http $http */
72 72
         $http = $this->container->get(Http::class);
73
-        while ($request = $client->acceptRequest()) {
74
-            try {
73
+        while ($request = $client->acceptRequest()){
74
+            try{
75 75
                 $client->respond($http->handle($request));
76
-            } catch (\Throwable $e) {
76
+            }catch (\Throwable $e){
77 77
                 $this->handleException($client, $e);
78
-            } finally {
78
+            }finally{
79 79
                 $this->finalizer->finalize(false);
80 80
             }
81 81
         }
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $handler = new HtmlHandler();
91 91
 
92
-        try {
92
+        try{
93 93
             /** @var SnapshotInterface $snapshot */
94 94
             $snapshot = $this->container->get(SnapshotterInterface::class)->register($e);
95 95
             error_log($snapshot->getMessage());
96
-        } catch (\Throwable|ContainerExceptionInterface $se) {
96
+        }catch (\Throwable | ContainerExceptionInterface $se){
97 97
             error_log((string)$e);
98 98
         }
99 99
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,12 +70,18 @@  discard block
 block discarded – undo
70 70
 
71 71
         /** @var Http $http */
72 72
         $http = $this->container->get(Http::class);
73
-        while ($request = $client->acceptRequest()) {
74
-            try {
73
+        while ($request = $client->acceptRequest())
74
+        {
75
+            try
76
+            {
75 77
                 $client->respond($http->handle($request));
76
-            } catch (\Throwable $e) {
78
+            }
79
+            catch (\Throwable $e)
80
+            {
77 81
                 $this->handleException($client, $e);
78
-            } finally {
82
+            }
83
+            finally
84
+            {
79 85
                 $this->finalizer->finalize(false);
80 86
             }
81 87
         }
@@ -89,11 +95,14 @@  discard block
 block discarded – undo
89 95
     {
90 96
         $handler = new HtmlHandler();
91 97
 
92
-        try {
98
+        try
99
+        {
93 100
             /** @var SnapshotInterface $snapshot */
94 101
             $snapshot = $this->container->get(SnapshotterInterface::class)->register($e);
95 102
             error_log($snapshot->getMessage());
96
-        } catch (\Throwable|ContainerExceptionInterface $se) {
103
+        }
104
+        catch (\Throwable|ContainerExceptionInterface $se)
105
+        {
97 106
             error_log((string)$e);
98 107
         }
99 108
 
Please login to merge, or discard this patch.
src/Http/SapiDispatcher.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
         $http = $this->container->get(Http::class);
58 58
         $emitter = $emitter ?? $this->container->get(EmitterInterface::class);
59 59
 
60
-        try {
60
+        try{
61 61
             $response = $http->handle($this->initRequest());
62 62
             $emitter->emit($response);
63
-        } catch (\Throwable $e) {
63
+        }catch (\Throwable $e){
64 64
             $this->handleException($emitter, $e);
65
-        } finally {
65
+        }finally{
66 66
             $this->finalizer->finalize(false);
67 67
         }
68 68
     }
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
     {
84 84
         $handler = new HtmlHandler();
85 85
 
86
-        try {
86
+        try{
87 87
             /** @var SnapshotInterface $snapshot */
88 88
             $this->container->get(SnapshotterInterface::class)->register($e);
89
-        } catch (\Throwable|ContainerExceptionInterface $se) {
89
+        }catch (\Throwable | ContainerExceptionInterface $se){
90 90
             // nothing to report
91 91
         }
92 92
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,12 +57,17 @@  discard block
 block discarded – undo
57 57
         $http = $this->container->get(Http::class);
58 58
         $emitter = $emitter ?? $this->container->get(EmitterInterface::class);
59 59
 
60
-        try {
60
+        try
61
+        {
61 62
             $response = $http->handle($this->initRequest());
62 63
             $emitter->emit($response);
63
-        } catch (\Throwable $e) {
64
+        }
65
+        catch (\Throwable $e)
66
+        {
64 67
             $this->handleException($emitter, $e);
65
-        } finally {
68
+        }
69
+        finally
70
+        {
66 71
             $this->finalizer->finalize(false);
67 72
         }
68 73
     }
@@ -83,10 +88,13 @@  discard block
 block discarded – undo
83 88
     {
84 89
         $handler = new HtmlHandler();
85 90
 
86
-        try {
91
+        try
92
+        {
87 93
             /** @var SnapshotInterface $snapshot */
88 94
             $this->container->get(SnapshotterInterface::class)->register($e);
89
-        } catch (\Throwable|ContainerExceptionInterface $se) {
95
+        }
96
+        catch (\Throwable|ContainerExceptionInterface $se)
97
+        {
90 98
             // nothing to report
91 99
         }
92 100
 
Please login to merge, or discard this patch.
src/Command/Cycle/UpdateCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         CycleBootloader $cycleBootloader,
36 36
         Registry $registry,
37 37
         MemoryInterface $memory
38
-    ) {
38
+    ){
39 39
         $this->write("Updating ORM schema... ");
40 40
 
41 41
         $schema = (new Compiler())->compile($registry, $bootloader->getGenerators());
Please login to merge, or discard this patch.
src/Bootloader/Cycle/SchemaBootloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
     public function getGenerators(): array
90 90
     {
91 91
         $result = [];
92
-        foreach ($this->generators as $group) {
93
-            foreach ($group as $generator) {
94
-                if (is_object($generator) && !$generator instanceof Container\Autowire) {
92
+        foreach ($this->generators as $group){
93
+            foreach ($group as $generator){
94
+                if (is_object($generator) && !$generator instanceof Container\Autowire){
95 95
                     $result[] = $generator;
96
-                } else {
96
+                }else{
97 97
                     $result[] = $this->container->get($generator);
98 98
                 }
99 99
             }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     protected function schema(MemoryInterface $memory): ?SchemaInterface
110 110
     {
111 111
         $schema = $memory->loadData('cycle');
112
-        if (is_null($schema)) {
112
+        if (is_null($schema)){
113 113
             return null;
114 114
         }
115 115
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,11 +89,16 @@  discard block
 block discarded – undo
89 89
     public function getGenerators(): array
90 90
     {
91 91
         $result = [];
92
-        foreach ($this->generators as $group) {
93
-            foreach ($group as $generator) {
94
-                if (is_object($generator) && !$generator instanceof Container\Autowire) {
92
+        foreach ($this->generators as $group)
93
+        {
94
+            foreach ($group as $generator)
95
+            {
96
+                if (is_object($generator) && !$generator instanceof Container\Autowire)
97
+                {
95 98
                     $result[] = $generator;
96
-                } else {
99
+                }
100
+                else
101
+                {
97 102
                     $result[] = $this->container->get($generator);
98 103
                 }
99 104
             }
@@ -109,7 +114,8 @@  discard block
 block discarded – undo
109 114
     protected function schema(MemoryInterface $memory): ?SchemaInterface
110 115
     {
111 116
         $schema = $memory->loadData('cycle');
112
-        if (is_null($schema)) {
117
+        if (is_null($schema))
118
+        {
113 119
             return null;
114 120
         }
115 121
 
Please login to merge, or discard this patch.
src/Bootloader/Cycle/CycleBootloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
     public function boot(Container $container, FinalizerInterface $finalizer, SchemaInterface $schema = null)
47 47
     {
48 48
         $finalizer->addFinalizer(function () use ($container) {
49
-            if ($container->hasInstance(ORMInterface::class)) {
49
+            if ($container->hasInstance(ORMInterface::class)){
50 50
                 $container->get(ORMInterface::class)->getHeap()->clean();
51 51
             }
52 52
         });
53 53
 
54 54
         $container->bindInjector(Select::class, SelectInjector::class);
55 55
 
56
-        if ($schema !== null) {
56
+        if ($schema !== null){
57 57
             $this->bindRepositories($container, $schema);
58 58
         }
59 59
     }
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function bindRepositories(Container $container, SchemaInterface $schema)
68 68
     {
69
-        foreach ($schema->getRoles() as $role) {
69
+        foreach ($schema->getRoles() as $role){
70 70
             $repository = $schema->define($role, SchemaInterface::REPOSITORY);
71
-            if ($repository === Select\Repository::class || $repository === null) {
71
+            if ($repository === Select\Repository::class || $repository === null){
72 72
                 // default repository can not be wired
73 73
                 continue;
74 74
             }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     ): ORMInterface {
105 105
         $orm = new ORM($factory, $schema);
106 106
 
107
-        if ($promiseFactory !== null) {
107
+        if ($promiseFactory !== null){
108 108
             return $orm->withPromiseFactory($promiseFactory);
109 109
         }
110 110
 
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -45,15 +45,18 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function boot(Container $container, FinalizerInterface $finalizer, SchemaInterface $schema = null)
47 47
     {
48
-        $finalizer->addFinalizer(function () use ($container) {
49
-            if ($container->hasInstance(ORMInterface::class)) {
48
+        $finalizer->addFinalizer(function () use ($container)
49
+        {
50
+            if ($container->hasInstance(ORMInterface::class))
51
+            {
50 52
                 $container->get(ORMInterface::class)->getHeap()->clean();
51 53
             }
52 54
         });
53 55
 
54 56
         $container->bindInjector(Select::class, SelectInjector::class);
55 57
 
56
-        if ($schema !== null) {
58
+        if ($schema !== null)
59
+        {
57 60
             $this->bindRepositories($container, $schema);
58 61
         }
59 62
     }
@@ -66,15 +69,18 @@  discard block
 block discarded – undo
66 69
      */
67 70
     public function bindRepositories(Container $container, SchemaInterface $schema)
68 71
     {
69
-        foreach ($schema->getRoles() as $role) {
72
+        foreach ($schema->getRoles() as $role)
73
+        {
70 74
             $repository = $schema->define($role, SchemaInterface::REPOSITORY);
71
-            if ($repository === Select\Repository::class || $repository === null) {
75
+            if ($repository === Select\Repository::class || $repository === null)
76
+            {
72 77
                 // default repository can not be wired
73 78
                 continue;
74 79
             }
75 80
 
76 81
             // initiate all repository dependencies using factory method forwarded to ORM
77
-            $container->bindSingleton($repository, function (ORMInterface $orm) use ($role) {
82
+            $container->bindSingleton($repository, function (ORMInterface $orm) use ($role)
83
+            {
78 84
                 return $orm->getRepository($role);
79 85
             });
80 86
         }
@@ -104,7 +110,8 @@  discard block
 block discarded – undo
104 110
     ): ORMInterface {
105 111
         $orm = new ORM($factory, $schema);
106 112
 
107
-        if ($promiseFactory !== null) {
113
+        if ($promiseFactory !== null)
114
+        {
108 115
             return $orm->withPromiseFactory($promiseFactory);
109 116
         }
110 117
 
Please login to merge, or discard this patch.
src/Bootloader/SnapshotsBootloader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
         EnvironmentInterface $env,
42 42
         DirectoriesInterface $dirs,
43 43
         FilesInterface $files
44
-    ) {
44
+    ){
45 45
         return new FileSnapshotter(
46
-            $dirs->get('runtime') . '/snapshots/',
46
+            $dirs->get('runtime').'/snapshots/',
47 47
             $env->get('SNAPSHOT_MAX_FILES', self::MAX_SNAPSHOTS),
48 48
             $env->get('SNAPSHOT_VERBOSITY', HandlerInterface::VERBOSITY_VERBOSE),
49 49
             new HtmlHandler(),
Please login to merge, or discard this patch.
src/Bootloader/Http/SessionBootloader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         CookiesBootloader $cookies,
51 51
         HttpBootloader $http,
52 52
         DirectoriesInterface $directories
53
-    ) {
53
+    ){
54 54
         $config->setDefaults('session', [
55 55
             'lifetime' => 86400,
56 56
             'cookie'   => 'sid',
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             'handler'  => new Autowire(
59 59
                 FileHandler::class,
60 60
                 [
61
-                    'directory' => $directories->get('runtime') . 'session',
61
+                    'directory' => $directories->get('runtime').'session',
62 62
                     'lifetime'  => 86400
63 63
                 ]
64 64
             )
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)
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)
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.