Passed
Push — master ( 2291e3...cd7158 )
by Anton
03:34
created
src/Framework/Console/ConsoleDispatcher.php 2 patches
Spacing   +8 added lines, -8 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;
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
         /** @var Console $console */
80 80
         $console = $this->container->get(Console::class);
81 81
 
82
-        try {
82
+        try{
83 83
             return $console->start($input ?? new ArgvInput(), $output);
84
-        } catch (Throwable $e) {
84
+        }catch (Throwable $e){
85 85
             $this->handleException($e, $output);
86 86
 
87 87
             return 255;
88
-        } finally {
88
+        }finally{
89 89
             $listener->disable();
90 90
             $this->finalizer->finalize(false);
91 91
         }
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
      */
98 98
     protected function handleException(Throwable $e, OutputInterface $output): void
99 99
     {
100
-        try {
100
+        try{
101 101
             $this->container->get(SnapshotterInterface::class)->register($e);
102
-        } catch (Throwable | ContainerExceptionInterface $se) {
102
+        }catch (Throwable | ContainerExceptionInterface $se){
103 103
             // no need to notify when unable to register an exception
104 104
         }
105 105
 
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
      */
115 115
     private function mapVerbosity(OutputInterface $output): int
116 116
     {
117
-        if ($output->isDebug()) {
117
+        if ($output->isDebug()){
118 118
             return ConsoleHandler::VERBOSITY_DEBUG;
119 119
         }
120 120
 
121
-        if ($output->isVeryVerbose()) {
121
+        if ($output->isVeryVerbose()){
122 122
             return ConsoleHandler::VERBOSITY_VERBOSE;
123 123
         }
124 124
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -7 removed lines patch added patch discarded remove patch
@@ -79,13 +79,18 @@  discard block
 block discarded – undo
79 79
         /** @var Console $console */
80 80
         $console = $this->container->get(Console::class);
81 81
 
82
-        try {
82
+        try
83
+        {
83 84
             return $console->start($input ?? new ArgvInput(), $output);
84
-        } catch (Throwable $e) {
85
+        }
86
+        catch (Throwable $e)
87
+        {
85 88
             $this->handleException($e, $output);
86 89
 
87 90
             return 255;
88
-        } finally {
91
+        }
92
+        finally
93
+        {
89 94
             $listener->disable();
90 95
             $this->finalizer->finalize(false);
91 96
         }
@@ -97,9 +102,12 @@  discard block
 block discarded – undo
97 102
      */
98 103
     protected function handleException(Throwable $e, OutputInterface $output): void
99 104
     {
100
-        try {
105
+        try
106
+        {
101 107
             $this->container->get(SnapshotterInterface::class)->register($e);
102
-        } catch (Throwable | ContainerExceptionInterface $se) {
108
+        }
109
+        catch (Throwable | ContainerExceptionInterface $se)
110
+        {
103 111
             // no need to notify when unable to register an exception
104 112
         }
105 113
 
@@ -114,11 +122,13 @@  discard block
 block discarded – undo
114 122
      */
115 123
     private function mapVerbosity(OutputInterface $output): int
116 124
     {
117
-        if ($output->isDebug()) {
125
+        if ($output->isDebug())
126
+        {
118 127
             return ConsoleHandler::VERBOSITY_DEBUG;
119 128
         }
120 129
 
121
-        if ($output->isVeryVerbose()) {
130
+        if ($output->isVeryVerbose())
131
+        {
122 132
             return ConsoleHandler::VERBOSITY_VERBOSE;
123 133
         }
124 134
 
Please login to merge, or discard this patch.
src/Framework/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/Framework/Console/Logger/DebugListener.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function __invoke(LogEvent $event): void
53 53
     {
54
-        if (empty($this->output)) {
54
+        if (empty($this->output)){
55 55
             return;
56 56
         }
57 57
 
58
-        if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) {
58
+        if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE){
59 59
             return;
60 60
         }
61 61
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function enable(): self
95 95
     {
96
-        if (!empty($this->listenerRegistry)) {
96
+        if (!empty($this->listenerRegistry)){
97 97
             $this->listenerRegistry->addListener($this);
98 98
         }
99 99
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function disable(): self
109 109
     {
110
-        if (!empty($this->listenerRegistry)) {
110
+        if (!empty($this->listenerRegistry)){
111 111
             $this->listenerRegistry->removeListener($this);
112 112
         }
113 113
 
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
      */
131 131
     private function getChannel(string $channel): string
132 132
     {
133
-        if (!class_exists($channel, false)) {
133
+        if (!class_exists($channel, false)){
134 134
             return "[{$channel}]";
135 135
         }
136 136
 
137
-        try {
137
+        try{
138 138
             $reflection = new \ReflectionClass($channel);
139
-        } catch (\ReflectionException $e) {
139
+        }catch (\ReflectionException $e){
140 140
             return $channel;
141 141
         }
142 142
 
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function getMessage(bool $decorated, string $message): string
152 152
     {
153
-        if (!$decorated) {
153
+        if (!$decorated){
154 154
             return $message;
155 155
         }
156 156
 
157
-        return Color::GRAY . $message . Color::RESET;
157
+        return Color::GRAY.$message.Color::RESET;
158 158
     }
159 159
 }
Please login to merge, or discard this patch.
Braces   +17 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,11 +51,13 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function __invoke(LogEvent $event): void
53 53
     {
54
-        if (empty($this->output)) {
54
+        if (empty($this->output))
55
+        {
55 56
             return;
56 57
         }
57 58
 
58
-        if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE) {
59
+        if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERY_VERBOSE)
60
+        {
59 61
             return;
60 62
         }
61 63
 
@@ -93,7 +95,8 @@  discard block
 block discarded – undo
93 95
      */
94 96
     public function enable(): self
95 97
     {
96
-        if (!empty($this->listenerRegistry)) {
98
+        if (!empty($this->listenerRegistry))
99
+        {
97 100
             $this->listenerRegistry->addListener($this);
98 101
         }
99 102
 
@@ -107,7 +110,8 @@  discard block
 block discarded – undo
107 110
      */
108 111
     public function disable(): self
109 112
     {
110
-        if (!empty($this->listenerRegistry)) {
113
+        if (!empty($this->listenerRegistry))
114
+        {
111 115
             $this->listenerRegistry->removeListener($this);
112 116
         }
113 117
 
@@ -130,13 +134,17 @@  discard block
 block discarded – undo
130 134
      */
131 135
     private function getChannel(string $channel): string
132 136
     {
133
-        if (!class_exists($channel, false)) {
137
+        if (!class_exists($channel, false))
138
+        {
134 139
             return "[{$channel}]";
135 140
         }
136 141
 
137
-        try {
142
+        try
143
+        {
138 144
             $reflection = new \ReflectionClass($channel);
139
-        } catch (\ReflectionException $e) {
145
+        }
146
+        catch (\ReflectionException $e)
147
+        {
140 148
             return $channel;
141 149
         }
142 150
 
@@ -150,7 +158,8 @@  discard block
 block discarded – undo
150 158
      */
151 159
     private function getMessage(bool $decorated, string $message): string
152 160
     {
153
-        if (!$decorated) {
161
+        if (!$decorated)
162
+        {
154 163
             return $message;
155 164
         }
156 165
 
Please login to merge, or discard this patch.
src/Framework/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/Framework/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.
src/Framework/Session/Middleware/SessionMiddleware.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         CookiesConfig $cookiesConfig,
61 61
         SessionFactory $factory,
62 62
         ScopeInterface $scope
63
-    ) {
63
+    ){
64 64
         $this->config = $config;
65 65
         $this->httpConfig = $httpConfig;
66 66
         $this->cookiesConfig = $cookiesConfig;
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
             $this->fetchID($request)
80 80
         );
81 81
 
82
-        try {
82
+        try{
83 83
             $response = $this->scope->runScope(
84 84
                 [SessionInterface::class => $session],
85 85
                 function () use ($handler, $request, $session) {
86 86
                     return $handler->handle($request->withAttribute(static::ATTRIBUTE, $session));
87 87
                 }
88 88
             );
89
-        } catch (\Throwable $e) {
89
+        }catch (\Throwable $e){
90 90
             $session->abort();
91 91
             throw $e;
92 92
         }
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
         Request $request,
106 106
         Response $response
107 107
     ): Response {
108
-        if (!$session->isStarted()) {
108
+        if (!$session->isStarted()){
109 109
             return $response;
110 110
         }
111 111
 
112 112
         $session->commit();
113 113
 
114 114
         //SID changed
115
-        if ($this->fetchID($request) != $session->getID()) {
115
+        if ($this->fetchID($request) != $session->getID()){
116 116
             return $this->withCookie($request, $response, $session->getID());
117 117
         }
118 118
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     protected function fetchID(Request $request): ?string
130 130
     {
131 131
         $cookies = $request->getCookieParams();
132
-        if (empty($cookies[$this->config->getCookie()])) {
132
+        if (empty($cookies[$this->config->getCookie()])){
133 133
             return null;
134 134
         }
135 135
 
@@ -162,8 +162,8 @@  discard block
 block discarded – undo
162 162
     protected function clientSignature(Request $request): string
163 163
     {
164 164
         $signature = '';
165
-        foreach (static::SIGNATURE_HEADERS as $header) {
166
-            $signature .= $request->getHeaderLine($header) . ';';
165
+        foreach (static::SIGNATURE_HEADERS as $header){
166
+            $signature .= $request->getHeaderLine($header).';';
167 167
         }
168 168
 
169 169
         return hash('sha256', $signature);
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -79,14 +79,18 @@  discard block
 block discarded – undo
79 79
             $this->fetchID($request)
80 80
         );
81 81
 
82
-        try {
82
+        try
83
+        {
83 84
             $response = $this->scope->runScope(
84 85
                 [SessionInterface::class => $session],
85
-                function () use ($handler, $request, $session) {
86
+                function () use ($handler, $request, $session)
87
+                {
86 88
                     return $handler->handle($request->withAttribute(static::ATTRIBUTE, $session));
87 89
                 }
88 90
             );
89
-        } catch (\Throwable $e) {
91
+        }
92
+        catch (\Throwable $e)
93
+        {
90 94
             $session->abort();
91 95
             throw $e;
92 96
         }
@@ -105,14 +109,16 @@  discard block
 block discarded – undo
105 109
         Request $request,
106 110
         Response $response
107 111
     ): Response {
108
-        if (!$session->isStarted()) {
112
+        if (!$session->isStarted())
113
+        {
109 114
             return $response;
110 115
         }
111 116
 
112 117
         $session->commit();
113 118
 
114 119
         //SID changed
115
-        if ($this->fetchID($request) != $session->getID()) {
120
+        if ($this->fetchID($request) != $session->getID())
121
+        {
116 122
             return $this->withCookie($request, $response, $session->getID());
117 123
         }
118 124
 
@@ -129,7 +135,8 @@  discard block
 block discarded – undo
129 135
     protected function fetchID(Request $request): ?string
130 136
     {
131 137
         $cookies = $request->getCookieParams();
132
-        if (empty($cookies[$this->config->getCookie()])) {
138
+        if (empty($cookies[$this->config->getCookie()]))
139
+        {
133 140
             return null;
134 141
         }
135 142
 
@@ -162,7 +169,8 @@  discard block
 block discarded – undo
162 169
     protected function clientSignature(Request $request): string
163 170
     {
164 171
         $signature = '';
165
-        foreach (static::SIGNATURE_HEADERS as $header) {
172
+        foreach (static::SIGNATURE_HEADERS as $header)
173
+        {
166 174
             $signature .= $request->getHeaderLine($header) . ';';
167 175
         }
168 176
 
Please login to merge, or discard this patch.
src/Framework/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/Framework/Validation/Checker/EntityChecker.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     public function exists($value, string $role, ?string $field = null): bool
39 39
     {
40 40
         $repository = $this->orm->getRepository($role);
41
-        if ($field === null) {
41
+        if ($field === null){
42 42
             return $repository->findByPK($value) !== null;
43 43
         }
44 44
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $values = $this->withValues($withFields);
58 58
         $values[$field] = $value;
59 59
 
60
-        if ($this->isProvidedByContext($role, $values)) {
60
+        if ($this->isProvidedByContext($role, $values)){
61 61
             return true;
62 62
         }
63 63
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
     private function withValues(array $fields): array
72 72
     {
73 73
         $values = [];
74
-        foreach ($fields as $field) {
75
-            if ($this->getValidator()->hasValue($field)) {
74
+        foreach ($fields as $field){
75
+            if ($this->getValidator()->hasValue($field)){
76 76
                 $values[$field] = $this->getValidator()->getValue($field);
77 77
             }
78 78
         }
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
     private function isProvidedByContext(string $role, array $values): bool
89 89
     {
90 90
         $entity = $this->getValidator()->getContext();
91
-        if (!is_object($entity) || !$this->orm->getHeap()->has($entity)) {
91
+        if (!is_object($entity) || !$this->orm->getHeap()->has($entity)){
92 92
             return false;
93 93
         }
94 94
 
95 95
         $extract = $this->orm->getMapper($role)->extract($entity);
96
-        foreach ($values as $field => $value) {
97
-            if (!isset($extract[$field]) || $extract[$field] !== $value) {
96
+        foreach ($values as $field => $value){
97
+            if (!isset($extract[$field]) || $extract[$field] !== $value){
98 98
                 return false;
99 99
             }
100 100
         }
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,8 @@  discard block
 block discarded – undo
38 38
     public function exists($value, string $role, ?string $field = null): bool
39 39
     {
40 40
         $repository = $this->orm->getRepository($role);
41
-        if ($field === null) {
41
+        if ($field === null)
42
+        {
42 43
             return $repository->findByPK($value) !== null;
43 44
         }
44 45
 
@@ -57,7 +58,8 @@  discard block
 block discarded – undo
57 58
         $values = $this->withValues($withFields);
58 59
         $values[$field] = $value;
59 60
 
60
-        if ($this->isProvidedByContext($role, $values)) {
61
+        if ($this->isProvidedByContext($role, $values))
62
+        {
61 63
             return true;
62 64
         }
63 65
 
@@ -71,8 +73,10 @@  discard block
 block discarded – undo
71 73
     private function withValues(array $fields): array
72 74
     {
73 75
         $values = [];
74
-        foreach ($fields as $field) {
75
-            if ($this->getValidator()->hasValue($field)) {
76
+        foreach ($fields as $field)
77
+        {
78
+            if ($this->getValidator()->hasValue($field))
79
+            {
76 80
                 $values[$field] = $this->getValidator()->getValue($field);
77 81
             }
78 82
         }
@@ -88,13 +92,16 @@  discard block
 block discarded – undo
88 92
     private function isProvidedByContext(string $role, array $values): bool
89 93
     {
90 94
         $entity = $this->getValidator()->getContext();
91
-        if (!is_object($entity) || !$this->orm->getHeap()->has($entity)) {
95
+        if (!is_object($entity) || !$this->orm->getHeap()->has($entity))
96
+        {
92 97
             return false;
93 98
         }
94 99
 
95 100
         $extract = $this->orm->getMapper($role)->extract($entity);
96
-        foreach ($values as $field => $value) {
97
-            if (!isset($extract[$field]) || $extract[$field] !== $value) {
101
+        foreach ($values as $field => $value)
102
+        {
103
+            if (!isset($extract[$field]) || $extract[$field] !== $value)
104
+            {
98 105
                 return false;
99 106
             }
100 107
         }
Please login to merge, or discard this patch.
src/Framework/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.