Passed
Push — master ( 3db212...288d3b )
by Aleksei
20:14 queued 09:04
created
src/Framework/Console/Confirmation/ApplicationInProduction.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,11 +24,13 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function confirmToProceed(string $message = 'Application in production.'): bool
26 26
     {
27
-        if (!$this->appEnv->isProduction()) {
27
+        if (!$this->appEnv->isProduction())
28
+        {
28 29
             return true;
29 30
         }
30 31
 
31
-        if ($this->hasOption('force') && $this->option('force')) {
32
+        if ($this->hasOption('force') && $this->option('force'))
33
+        {
32 34
             return true;
33 35
         }
34 36
 
@@ -36,7 +38,8 @@  discard block
 block discarded – undo
36 38
 
37 39
         $confirmed = $this->confirm('Do you really wish to run command?');
38 40
 
39
-        if (!$confirmed) {
41
+        if (!$confirmed)
42
+        {
40 43
             $this->comment('Command Canceled!');
41 44
 
42 45
             return false;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
         private readonly AppEnvironment $appEnv,
22 22
         InputInterface $input,
23 23
         OutputInterface $output,
24
-    ) {
24
+    ){
25 25
         $this->input = $input;
26 26
         $this->output = $output instanceof SymfonyStyle ? $output : new SymfonyStyle($input, $output);
27 27
     }
28 28
 
29 29
     public function confirmToProceed(string $message = 'Application in production.'): bool
30 30
     {
31
-        if (!$this->appEnv->isProduction()) {
31
+        if (!$this->appEnv->isProduction()){
32 32
             return true;
33 33
         }
34 34
 
35
-        if ($this->hasOption('force') && $this->option('force')) {
35
+        if ($this->hasOption('force') && $this->option('force')){
36 36
             return true;
37 37
         }
38 38
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         $confirmed = $this->confirm('Do you really wish to run command?');
42 42
 
43
-        if (!$confirmed) {
43
+        if (!$confirmed){
44 44
             $this->comment('Command Canceled!');
45 45
 
46 46
             return false;
Please login to merge, or discard this patch.
src/Framework/Console/Sequence/RuntimeDirectory.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     public function __construct(
17 17
         private readonly FilesInterface $files,
18 18
         private readonly DirectoriesInterface $dirs
19
-    ) {
19
+    ){
20 20
     }
21 21
 
22 22
     public function ensure(OutputInterface $output): void
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
         $runtimeDirectory = $this->dirs->get('runtime');
27 27
 
28
-        if (!$this->files->exists($runtimeDirectory)) {
28
+        if (!$this->files->exists($runtimeDirectory)){
29 29
             $this->files->ensureDirectory($runtimeDirectory);
30 30
             $output->writeln('<comment>created</comment>');
31 31
             return;
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
         $output->writeln('<info>exists</info>');
34 34
 
35 35
 
36
-        foreach ($this->files->getFiles($runtimeDirectory) as $filename) {
37
-            try {
36
+        foreach ($this->files->getFiles($runtimeDirectory) as $filename){
37
+            try{
38 38
                 $this->files->setPermissions($filename, FilesInterface::RUNTIME);
39 39
                 $this->files->setPermissions(\dirname($filename), FilesInterface::RUNTIME);
40
-            } catch (\Throwable $e) {
40
+            }catch (\Throwable $e){
41 41
                 // @codeCoverageIgnoreStart
42 42
                 $output->writeln(
43 43
                     \sprintf(
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 // @codeCoverageIgnoreEnd
51 51
             }
52 52
 
53
-            if ($output->isVerbose()) {
53
+            if ($output->isVerbose()){
54 54
                 $output->writeln(
55 55
                     \sprintf(
56 56
                         '<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
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
25 25
 
26 26
         $runtimeDirectory = $this->dirs->get('runtime');
27 27
 
28
-        if (!$this->files->exists($runtimeDirectory)) {
28
+        if (!$this->files->exists($runtimeDirectory))
29
+        {
29 30
             $this->files->ensureDirectory($runtimeDirectory);
30 31
             $output->writeln('<comment>created</comment>');
31 32
             return;
@@ -33,11 +34,15 @@  discard block
 block discarded – undo
33 34
         $output->writeln('<info>exists</info>');
34 35
 
35 36
 
36
-        foreach ($this->files->getFiles($runtimeDirectory) as $filename) {
37
-            try {
37
+        foreach ($this->files->getFiles($runtimeDirectory) as $filename)
38
+        {
39
+            try
40
+            {
38 41
                 $this->files->setPermissions($filename, FilesInterface::RUNTIME);
39 42
                 $this->files->setPermissions(\dirname($filename), FilesInterface::RUNTIME);
40
-            } catch (\Throwable $e) {
43
+            }
44
+            catch (\Throwable $e)
45
+            {
41 46
                 // @codeCoverageIgnoreStart
42 47
                 $output->writeln(
43 48
                     \sprintf(
@@ -50,7 +55,8 @@  discard block
 block discarded – undo
50 55
                 // @codeCoverageIgnoreEnd
51 56
             }
52 57
 
53
-            if ($output->isVerbose()) {
58
+            if ($output->isVerbose())
59
+            {
54 60
                 $output->writeln(
55 61
                     \sprintf(
56 62
                         '<fg=green>[updated]</fg=green> `%s`',
Please login to merge, or discard this patch.
src/Framework/Translator/Views/LocaleProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     public function __construct(
21 21
         private readonly TranslatorInterface $translator
22
-    ) {
22
+    ){
23 23
     }
24 24
 
25 25
     public function process(ViewSource $source, ContextInterface $context): ViewSource
Please login to merge, or discard this patch.
src/Framework/Translator/Views/LocaleDependency.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
     public function __construct(
20 20
         private readonly TranslatorInterface $translator
21
-    ) {
21
+    ){
22 22
         $this->locales = $translator->getCatalogueManager()->getLocales();
23 23
     }
24 24
 
Please login to merge, or discard this patch.
src/Framework/Translator/MemoryCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 {
12 12
     public function __construct(
13 13
         private readonly MemoryInterface $memory
14
-    ) {
14
+    ){
15 15
     }
16 16
 
17 17
     public function setLocales(?array $locales): void
Please login to merge, or discard this patch.
src/Framework/helpers.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Spiral\Core\Container\Autowire;
7 7
 use Spiral\Router\RouterInterface;
8 8
 
9
-if (!\function_exists('bind')) {
9
+if (!\function_exists('bind')){
10 10
     /**
11 11
      * Shortcut to container Autowire definition.
12 12
      *
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     }
22 22
 }
23 23
 
24
-if (!\function_exists('route')) {
24
+if (!\function_exists('route')){
25 25
     /**
26 26
      * Generate the URL to a named route.
27 27
      *
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,8 @@  discard block
 block discarded – undo
6 6
 use Spiral\Core\Container\Autowire;
7 7
 use Spiral\Router\RouterInterface;
8 8
 
9
-if (!\function_exists('bind')) {
9
+if (!\function_exists('bind'))
10
+{
10 11
     /**
11 12
      * Shortcut to container Autowire definition.
12 13
      *
@@ -21,7 +22,8 @@  discard block
 block discarded – undo
21 22
     }
22 23
 }
23 24
 
24
-if (!\function_exists('route')) {
25
+if (!\function_exists('route'))
26
+{
25 27
     /**
26 28
      * Generate the URL to a named route.
27 29
      *
Please login to merge, or discard this patch.
src/Framework/Security/GuardScope.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,8 +29,10 @@  discard block
 block discarded – undo
29 29
     public function allows(string $permission, array $context = []): bool
30 30
     {
31 31
         $allows = false;
32
-        foreach ($this->getRoles() as $role) {
33
-            if (!$this->permissions->hasRole($role)) {
32
+        foreach ($this->getRoles() as $role)
33
+        {
34
+            if (!$this->permissions->hasRole($role))
35
+            {
34 36
                 continue;
35 37
             }
36 38
 
@@ -70,13 +72,17 @@  discard block
 block discarded – undo
70 72
      */
71 73
     public function getActor(): ActorInterface
72 74
     {
73
-        if (!\is_null($this->actor)) {
75
+        if (!\is_null($this->actor))
76
+        {
74 77
             return $this->actor;
75 78
         }
76 79
 
77
-        try {
80
+        try
81
+        {
78 82
             return $this->container->get(ActorInterface::class);
79
-        } catch (NotFoundExceptionInterface $e) {
83
+        }
84
+        catch (NotFoundExceptionInterface $e)
85
+        {
80 86
             throw new ScopeException('Unable to resolve Actor from the scope', $e->getCode(), $e);
81 87
         }
82 88
     }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         private readonly PermissionsInterface $permissions,
23 23
         #[Proxy] private readonly ContainerInterface $container,
24 24
         private array $roles = []
25
-    ) {
25
+    ){
26 26
     }
27 27
 
28 28
     /**
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
     public function allows(string $permission, array $context = []): bool
32 32
     {
33 33
         $allows = false;
34
-        foreach ($this->getRoles() as $role) {
35
-            if (!$this->permissions->hasRole($role)) {
34
+        foreach ($this->getRoles() as $role){
35
+            if (!$this->permissions->hasRole($role)){
36 36
                 continue;
37 37
             }
38 38
 
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function getActor(): ActorInterface
74 74
     {
75
-        if (!\is_null($this->actor)) {
75
+        if (!\is_null($this->actor)){
76 76
             return $this->actor;
77 77
         }
78 78
 
79
-        try {
79
+        try{
80 80
             return $this->container->get(ActorInterface::class);
81
-        } catch (NotFoundExceptionInterface $e) {
81
+        }catch (NotFoundExceptionInterface $e){
82 82
             throw new ScopeException('Unable to resolve Actor from the scope', $e->getCode(), $e);
83 83
         }
84 84
     }
Please login to merge, or discard this patch.
src/Framework/Debug/StateCollector/HttpCollector.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function populate(StateInterface $state): void
25 25
     {
26
-        if ($this->request === null) {
26
+        if ($this->request === null){
27 27
             return;
28 28
         }
29 29
 
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 
33 33
         $state->setVariable('headers', $this->request->getHeaders());
34 34
 
35
-        if ($this->request->getQueryParams() !== []) {
35
+        if ($this->request->getQueryParams() !== []){
36 36
             $state->setVariable('query', $this->request->getQueryParams());
37 37
         }
38 38
 
39
-        if ($this->request->getParsedBody() !== null) {
39
+        if ($this->request->getParsedBody() !== null){
40 40
             $state->setVariable('data', $this->request->getParsedBody());
41 41
         }
42 42
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function populate(StateInterface $state): void
25 25
     {
26
-        if ($this->request === null) {
26
+        if ($this->request === null)
27
+        {
27 28
             return;
28 29
         }
29 30
 
@@ -32,11 +33,13 @@  discard block
 block discarded – undo
32 33
 
33 34
         $state->setVariable('headers', $this->request->getHeaders());
34 35
 
35
-        if ($this->request->getQueryParams() !== []) {
36
+        if ($this->request->getQueryParams() !== [])
37
+        {
36 38
             $state->setVariable('query', $this->request->getQueryParams());
37 39
         }
38 40
 
39
-        if ($this->request->getParsedBody() !== null) {
41
+        if ($this->request->getParsedBody() !== null)
42
+        {
40 43
             $state->setVariable('data', $this->request->getParsedBody());
41 44
         }
42 45
     }
Please login to merge, or discard this patch.
src/Framework/Debug/StateCollector/EnvironmentCollector.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@
 block discarded – undo
15 15
     public function __construct(
16 16
         private readonly ContainerInterface $container,
17 17
         private readonly EnvironmentInterface $env
18
-    ) {
18
+    ){
19 19
     }
20 20
 
21 21
     public function populate(StateInterface $state): void
22 22
     {
23 23
         $state->setTag('php', \phpversion());
24 24
 
25
-        if ($this->container->has(DispatcherInterface::class)) {
25
+        if ($this->container->has(DispatcherInterface::class)){
26 26
             $state->setTag('dispatcher', $this->container->get(DispatcherInterface::class)::class);
27 27
         }
28 28
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@
 block discarded – undo
22 22
     {
23 23
         $state->setTag('php', \phpversion());
24 24
 
25
-        if ($this->container->has(DispatcherInterface::class)) {
25
+        if ($this->container->has(DispatcherInterface::class))
26
+        {
26 27
             $state->setTag('dispatcher', $this->container->get(DispatcherInterface::class)::class);
27 28
         }
28 29
 
Please login to merge, or discard this patch.