Passed
Pull Request — master (#233)
by Pavel
03:51 queued 01:19
created
src/Bootloader/CommandBootloader.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -78,35 +78,35 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function configureExtensions(ConsoleBootloader $console, Container $container): void
80 80
     {
81
-        if ($container->has(DatabaseProviderInterface::class)) {
81
+        if ($container->has(DatabaseProviderInterface::class)){
82 82
             $this->configureDatabase($console);
83 83
         }
84 84
 
85
-        if ($container->has(ORMInterface::class)) {
85
+        if ($container->has(ORMInterface::class)){
86 86
             $this->configureCycle($console, $container);
87 87
         }
88 88
 
89
-        if ($container->has(TranslatorInterface::class)) {
89
+        if ($container->has(TranslatorInterface::class)){
90 90
             $this->configureTranslator($console);
91 91
         }
92 92
 
93
-        if ($container->has(ViewsInterface::class)) {
93
+        if ($container->has(ViewsInterface::class)){
94 94
             $this->configureViews($console);
95 95
         }
96 96
 
97
-        if ($container->has(Migrator::class)) {
97
+        if ($container->has(Migrator::class)){
98 98
             $this->configureMigrations($console);
99 99
         }
100 100
 
101
-        if ($container->has(InvokerInterface::class)) {
101
+        if ($container->has(InvokerInterface::class)){
102 102
             $this->configureGRPC($console);
103 103
         }
104 104
 
105
-        if ($container->has(EncryptionInterface::class)) {
105
+        if ($container->has(EncryptionInterface::class)){
106 106
             $this->configureEncrypter($console);
107 107
         }
108 108
 
109
-        if ($container->has(RouterInterface::class)) {
109
+        if ($container->has(RouterInterface::class)){
110 110
             $console->addCommand(Router\ListCommand::class);
111 111
         }
112 112
     }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         $console->addCommand(Cycle\SyncCommand::class);
137 137
 
138
-        if ($container->has(Migrator::class)) {
138
+        if ($container->has(Migrator::class)){
139 139
             $console->addCommand(Cycle\MigrateCommand::class);
140 140
         }
141 141
     }
Please login to merge, or discard this patch.
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -78,35 +78,43 @@  discard block
 block discarded – undo
78 78
      */
79 79
     private function configureExtensions(ConsoleBootloader $console, Container $container): void
80 80
     {
81
-        if ($container->has(DatabaseProviderInterface::class)) {
81
+        if ($container->has(DatabaseProviderInterface::class))
82
+        {
82 83
             $this->configureDatabase($console);
83 84
         }
84 85
 
85
-        if ($container->has(ORMInterface::class)) {
86
+        if ($container->has(ORMInterface::class))
87
+        {
86 88
             $this->configureCycle($console, $container);
87 89
         }
88 90
 
89
-        if ($container->has(TranslatorInterface::class)) {
91
+        if ($container->has(TranslatorInterface::class))
92
+        {
90 93
             $this->configureTranslator($console);
91 94
         }
92 95
 
93
-        if ($container->has(ViewsInterface::class)) {
96
+        if ($container->has(ViewsInterface::class))
97
+        {
94 98
             $this->configureViews($console);
95 99
         }
96 100
 
97
-        if ($container->has(Migrator::class)) {
101
+        if ($container->has(Migrator::class))
102
+        {
98 103
             $this->configureMigrations($console);
99 104
         }
100 105
 
101
-        if ($container->has(InvokerInterface::class)) {
106
+        if ($container->has(InvokerInterface::class))
107
+        {
102 108
             $this->configureGRPC($console);
103 109
         }
104 110
 
105
-        if ($container->has(EncryptionInterface::class)) {
111
+        if ($container->has(EncryptionInterface::class))
112
+        {
106 113
             $this->configureEncrypter($console);
107 114
         }
108 115
 
109
-        if ($container->has(RouterInterface::class)) {
116
+        if ($container->has(RouterInterface::class))
117
+        {
110 118
             $console->addCommand(Router\ListCommand::class);
111 119
         }
112 120
     }
@@ -135,7 +143,8 @@  discard block
 block discarded – undo
135 143
 
136 144
         $console->addCommand(Cycle\SyncCommand::class);
137 145
 
138
-        if ($container->has(Migrator::class)) {
146
+        if ($container->has(Migrator::class))
147
+        {
139 148
             $console->addCommand(Cycle\MigrateCommand::class);
140 149
         }
141 150
     }
Please login to merge, or discard this patch.
src/Snapshots/FileSnapshooter.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         HandlerInterface $handler,
54 54
         FilesInterface $files,
55 55
         LoggerInterface $logger = null
56
-    ) {
56
+    ){
57 57
         $this->directory = $directory;
58 58
         $this->maxFiles = $maxFiles;
59 59
         $this->verbosity = $verbosity;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $snapshot = new Snapshot($this->getID($e), $e);
71 71
 
72
-        if ($this->logger !== null) {
72
+        if ($this->logger !== null){
73 73
             $this->logger->error($snapshot->getMessage());
74 74
         }
75 75
 
@@ -102,18 +102,18 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $finder = new Finder();
104 104
         $finder->in($this->directory)->sort(
105
-            static function (SplFileInfo $a, SplFileInfo $b) {
105
+            static function (SplFileInfo $a, SplFileInfo $b){
106 106
                 return $b->getMTime() - $a->getMTime();
107 107
             }
108 108
         );
109 109
 
110 110
         $count = 0;
111
-        foreach ($finder as $file) {
111
+        foreach ($finder as $file){
112 112
             $count++;
113
-            if ($count > $this->maxFiles) {
114
-                try {
113
+            if ($count > $this->maxFiles){
114
+                try{
115 115
                     $this->files->delete($file->getRealPath());
116
-                } catch (FilesException $e) {
116
+                }catch (FilesException $e){
117 117
                     // ignore
118 118
                 }
119 119
             }
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $snapshot = new Snapshot($this->getID($e), $e);
71 71
 
72
-        if ($this->logger !== null) {
72
+        if ($this->logger !== null)
73
+        {
73 74
             $this->logger->error($snapshot->getMessage());
74 75
         }
75 76
 
@@ -102,18 +103,24 @@  discard block
 block discarded – undo
102 103
     {
103 104
         $finder = new Finder();
104 105
         $finder->in($this->directory)->sort(
105
-            static function (SplFileInfo $a, SplFileInfo $b) {
106
+            static function (SplFileInfo $a, SplFileInfo $b)
107
+            {
106 108
                 return $b->getMTime() - $a->getMTime();
107 109
             }
108 110
         );
109 111
 
110 112
         $count = 0;
111
-        foreach ($finder as $file) {
113
+        foreach ($finder as $file)
114
+        {
112 115
             $count++;
113
-            if ($count > $this->maxFiles) {
114
-                try {
116
+            if ($count > $this->maxFiles)
117
+            {
118
+                try
119
+                {
115 120
                     $this->files->delete($file->getRealPath());
116
-                } catch (FilesException $e) {
121
+                }
122
+                catch (FilesException $e)
123
+                {
117 124
                     // ignore
118 125
                 }
119 126
             }
Please login to merge, or discard this patch.
src/Session/SessionScope.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,9 +124,9 @@
 block discarded – undo
124 124
      */
125 125
     public function getActiveSession(): SessionInterface
126 126
     {
127
-        try {
127
+        try{
128 128
             return $this->container->get(SessionInterface::class);
129
-        } catch (NotFoundExceptionInterface $e) {
129
+        }catch (NotFoundExceptionInterface $e){
130 130
             throw new ScopeException(
131 131
                 'Unable to receive active session, invalid request scope',
132 132
                 $e->getCode(),
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,9 +124,12 @@
 block discarded – undo
124 124
      */
125 125
     public function getActiveSession(): SessionInterface
126 126
     {
127
-        try {
127
+        try
128
+        {
128 129
             return $this->container->get(SessionInterface::class);
129
-        } catch (NotFoundExceptionInterface $e) {
130
+        }
131
+        catch (NotFoundExceptionInterface $e)
132
+        {
130 133
             throw new ScopeException(
131 134
                 'Unable to receive active session, invalid request scope',
132 135
                 $e->getCode(),
Please login to merge, or discard this patch.
tests/Framework/I18n/ExportTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
     {
20 20
         parent::tearDown();
21 21
 
22
-        if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) {
23
-            unlink(sys_get_temp_dir() . '/messages.ru.php');
22
+        if (file_exists(sys_get_temp_dir().'/messages.ru.php')){
23
+            unlink(sys_get_temp_dir().'/messages.ru.php');
24 24
         }
25 25
     }
26 26
 
27 27
     public function testReset(): void
28 28
     {
29
-        $this->assertFileNotExists(sys_get_temp_dir() . '/messages.ru.php');
29
+        $this->assertFileNotExists(sys_get_temp_dir().'/messages.ru.php');
30 30
 
31 31
         $this->runCommandDebug('i18n:index');
32 32
         $this->runCommandDebug('configure');
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@
 block discarded – undo
19 19
     {
20 20
         parent::tearDown();
21 21
 
22
-        if (file_exists(sys_get_temp_dir() . '/messages.ru.php')) {
22
+        if (file_exists(sys_get_temp_dir() . '/messages.ru.php'))
23
+        {
23 24
             unlink(sys_get_temp_dir() . '/messages.ru.php');
24 25
         }
25 26
     }
Please login to merge, or discard this patch.
src/Http/Middleware/JsonPayloadMiddleware.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
45 45
     {
46
-        if ($this->isJsonPayload($request)) {
46
+        if ($this->isJsonPayload($request)){
47 47
             $request = $request->withParsedBody(json_decode((string)$request->getBody(), true));
48
-            if (json_last_error() !== 0) {
48
+            if (json_last_error() !== 0){
49 49
                 throw new ClientException(400, 'invalid json payload');
50 50
             }
51 51
         }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $contentType = $request->getHeaderLine('Content-Type');
63 63
 
64
-        foreach ($this->config->getContentTypes() as $allowedType) {
65
-            if (stripos($contentType, $allowedType) === 0) {
64
+        foreach ($this->config->getContentTypes() as $allowedType){
65
+            if (stripos($contentType, $allowedType) === 0){
66 66
                 return true;
67 67
             }
68 68
         }
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,9 +43,11 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
45 45
     {
46
-        if ($this->isJsonPayload($request)) {
46
+        if ($this->isJsonPayload($request))
47
+        {
47 48
             $request = $request->withParsedBody(json_decode((string)$request->getBody(), true));
48
-            if (json_last_error() !== 0) {
49
+            if (json_last_error() !== 0)
50
+            {
49 51
                 throw new ClientException(400, 'invalid json payload');
50 52
             }
51 53
         }
@@ -61,8 +63,10 @@  discard block
 block discarded – undo
61 63
     {
62 64
         $contentType = $request->getHeaderLine('Content-Type');
63 65
 
64
-        foreach ($this->config->getContentTypes() as $allowedType) {
65
-            if (stripos($contentType, $allowedType) === 0) {
66
+        foreach ($this->config->getContentTypes() as $allowedType)
67
+        {
68
+            if (stripos($contentType, $allowedType) === 0)
69
+            {
66 70
                 return true;
67 71
             }
68 72
         }
Please login to merge, or discard this patch.
src/Console/ConsoleDispatcher.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         EnvironmentInterface $env,
49 49
         FinalizerInterface $finalizer,
50 50
         ContainerInterface $container
51
-    ) {
51
+    ){
52 52
         $this->env = $env;
53 53
         $this->finalizer = $finalizer;
54 54
         $this->container = $container;
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
         $console = $this->container->get(Console::class);
81 81
 
82 82
         $code = 0;
83
-        try {
83
+        try{
84 84
             $code = $console->start($input ?? new ArgvInput(), $output);
85
-        } catch (Throwable $e) {
85
+        }catch (Throwable $e){
86 86
             $this->handleException($e, $output);
87
-        } finally {
87
+        }finally{
88 88
             $listener->disable();
89 89
             $this->finalizer->finalize(false);
90 90
         }
91 91
 
92
-        if ($exit) {
92
+        if ($exit){
93 93
             exit($code);
94 94
         }
95 95
     }
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
      */
101 101
     protected function handleException(Throwable $e, OutputInterface $output): void
102 102
     {
103
-        try {
103
+        try{
104 104
             $this->container->get(SnapshotterInterface::class)->register($e);
105
-        } catch (Throwable | ContainerExceptionInterface $se) {
105
+        }catch (Throwable | ContainerExceptionInterface $se){
106 106
             // no need to notify when unable to register an exception
107 107
         }
108 108
 
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
      */
118 118
     private function mapVerbosity(OutputInterface $output): int
119 119
     {
120
-        if ($output->isDebug()) {
120
+        if ($output->isDebug()){
121 121
             return ConsoleHandler::VERBOSITY_DEBUG;
122 122
         }
123 123
 
124
-        if ($output->isVeryVerbose()) {
124
+        if ($output->isVeryVerbose()){
125 125
             return ConsoleHandler::VERBOSITY_VERBOSE;
126 126
         }
127 127
 
Please login to merge, or discard this patch.
Braces   +19 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,16 +80,22 @@  discard block
 block discarded – undo
80 80
         $console = $this->container->get(Console::class);
81 81
 
82 82
         $code = 0;
83
-        try {
83
+        try
84
+        {
84 85
             $code = $console->start($input ?? new ArgvInput(), $output);
85
-        } catch (Throwable $e) {
86
+        }
87
+        catch (Throwable $e)
88
+        {
86 89
             $this->handleException($e, $output);
87
-        } finally {
90
+        }
91
+        finally
92
+        {
88 93
             $listener->disable();
89 94
             $this->finalizer->finalize(false);
90 95
         }
91 96
 
92
-        if ($exit) {
97
+        if ($exit)
98
+        {
93 99
             exit($code);
94 100
         }
95 101
     }
@@ -100,9 +106,12 @@  discard block
 block discarded – undo
100 106
      */
101 107
     protected function handleException(Throwable $e, OutputInterface $output): void
102 108
     {
103
-        try {
109
+        try
110
+        {
104 111
             $this->container->get(SnapshotterInterface::class)->register($e);
105
-        } catch (Throwable | ContainerExceptionInterface $se) {
112
+        }
113
+        catch (Throwable | ContainerExceptionInterface $se)
114
+        {
106 115
             // no need to notify when unable to register an exception
107 116
         }
108 117
 
@@ -117,11 +126,13 @@  discard block
 block discarded – undo
117 126
      */
118 127
     private function mapVerbosity(OutputInterface $output): int
119 128
     {
120
-        if ($output->isDebug()) {
129
+        if ($output->isDebug())
130
+        {
121 131
             return ConsoleHandler::VERBOSITY_DEBUG;
122 132
         }
123 133
 
124
-        if ($output->isVeryVerbose()) {
134
+        if ($output->isVeryVerbose())
135
+        {
125 136
             return ConsoleHandler::VERBOSITY_VERBOSE;
126 137
         }
127 138
 
Please login to merge, or discard this patch.