Passed
Push — master ( c7d0f6...2024b7 )
by Anton
02:21
created
src/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/Http/PaginationFactory.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
48 48
     {
49
-        if (!$this->container->has(ServerRequestInterface::class)) {
49
+        if (!$this->container->has(ServerRequestInterface::class)){
50 50
             throw new ScopeException('Unable to create paginator, no request scope found');
51 51
         }
52 52
         /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         //Getting page number
58 58
         $page = 0;
59
-        if (!empty($query[$parameter]) && is_scalar($query[$parameter])) {
59
+        if (!empty($query[$parameter]) && is_scalar($query[$parameter])){
60 60
             $page = (int)$query[$parameter];
61 61
         }
62 62
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,8 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
48 48
     {
49
-        if (!$this->container->has(ServerRequestInterface::class)) {
49
+        if (!$this->container->has(ServerRequestInterface::class))
50
+        {
50 51
             throw new ScopeException('Unable to create paginator, no request scope found');
51 52
         }
52 53
         /**
@@ -56,7 +57,8 @@  discard block
 block discarded – undo
56 57
 
57 58
         //Getting page number
58 59
         $page = 0;
59
-        if (!empty($query[$parameter]) && is_scalar($query[$parameter])) {
60
+        if (!empty($query[$parameter]) && is_scalar($query[$parameter]))
61
+        {
60 62
             $page = (int)$query[$parameter];
61 63
         }
62 64
 
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
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $finalizer->addFinalizer(function () use ($container): void {
29 29
             /** @var DatabaseManager $dbal */
30 30
             $dbal = $container->get(DatabaseManager::class);
31
-            foreach ($dbal->getDrivers() as $driver) {
31
+            foreach ($dbal->getDrivers() as $driver){
32 32
                 $driver->disconnect();
33 33
             }
34 34
         });
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
         $finalizer->addFinalizer(function () use ($container): void {
29 29
             /** @var DatabaseManager $dbal */
30 30
             $dbal = $container->get(DatabaseManager::class);
31
-            foreach ($dbal->getDrivers() as $driver) {
31
+            foreach ($dbal->getDrivers() as $driver)
32
+            {
32 33
                 $driver->disconnect();
33 34
             }
34 35
         });
Please login to merge, or discard this patch.
src/Bootloader/Database/MigrationsBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@
 block discarded – undo
40 40
         EnvironmentInterface $env,
41 41
         DirectoriesInterface $dirs
42 42
     ): void {
43
-        if (!$dirs->has('migrations')) {
44
-            $dirs->set('migrations', $dirs->get('app') . 'migrations');
43
+        if (!$dirs->has('migrations')){
44
+            $dirs->set('migrations', $dirs->get('app').'migrations');
45 45
         }
46 46
 
47 47
         $config->setDefaults('migration', [
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
40 40
         EnvironmentInterface $env,
41 41
         DirectoriesInterface $dirs
42 42
     ): void {
43
-        if (!$dirs->has('migrations')) {
43
+        if (!$dirs->has('migrations'))
44
+        {
44 45
             $dirs->set('migrations', $dirs->get('app') . 'migrations');
45 46
         }
46 47
 
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/I18nBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
60 60
     {
61
-        if (!$dirs->has('locale')) {
62
-            $dirs->set('locale', $dirs->get('app') . 'locale/');
61
+        if (!$dirs->has('locale')){
62
+            $dirs->set('locale', $dirs->get('app').'locale/');
63 63
         }
64 64
 
65 65
         $this->config->setDefaults('translator', [
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
60 60
     {
61
-        if (!$dirs->has('locale')) {
61
+        if (!$dirs->has('locale'))
62
+        {
62 63
             $dirs->set('locale', $dirs->get('app') . 'locale/');
63 64
         }
64 65
 
Please login to merge, or discard this patch.
src/Bootloader/CommandBootloader.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,31 +75,31 @@  discard block
 block discarded – undo
75 75
      */
76 76
     private function configureExtensions(ConsoleBootloader $console, Container $container): void
77 77
     {
78
-        if ($container->has(DatabaseProviderInterface::class)) {
78
+        if ($container->has(DatabaseProviderInterface::class)){
79 79
             $this->configureDatabase($console);
80 80
         }
81 81
 
82
-        if ($container->has(ORMInterface::class)) {
82
+        if ($container->has(ORMInterface::class)){
83 83
             $this->configureCycle($console, $container);
84 84
         }
85 85
 
86
-        if ($container->has(TranslatorInterface::class)) {
86
+        if ($container->has(TranslatorInterface::class)){
87 87
             $this->configureTranslator($console);
88 88
         }
89 89
 
90
-        if ($container->has(ViewsInterface::class)) {
90
+        if ($container->has(ViewsInterface::class)){
91 91
             $this->configureViews($console);
92 92
         }
93 93
 
94
-        if ($container->has(Migrator::class)) {
94
+        if ($container->has(Migrator::class)){
95 95
             $this->configureMigrations($console);
96 96
         }
97 97
 
98
-        if ($container->has(InvokerInterface::class)) {
98
+        if ($container->has(InvokerInterface::class)){
99 99
             $this->configureGRPC($console);
100 100
         }
101 101
 
102
-        if ($container->has(EncryptionInterface::class)) {
102
+        if ($container->has(EncryptionInterface::class)){
103 103
             $this->configureEncrypter($console);
104 104
         }
105 105
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         $console->addCommand(Cycle\SyncCommand::class);
130 130
 
131
-        if ($container->has(Migrator::class)) {
131
+        if ($container->has(Migrator::class)){
132 132
             $console->addCommand(Cycle\MigrateCommand::class);
133 133
         }
134 134
     }
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,31 +75,38 @@  discard block
 block discarded – undo
75 75
      */
76 76
     private function configureExtensions(ConsoleBootloader $console, Container $container): void
77 77
     {
78
-        if ($container->has(DatabaseProviderInterface::class)) {
78
+        if ($container->has(DatabaseProviderInterface::class))
79
+        {
79 80
             $this->configureDatabase($console);
80 81
         }
81 82
 
82
-        if ($container->has(ORMInterface::class)) {
83
+        if ($container->has(ORMInterface::class))
84
+        {
83 85
             $this->configureCycle($console, $container);
84 86
         }
85 87
 
86
-        if ($container->has(TranslatorInterface::class)) {
88
+        if ($container->has(TranslatorInterface::class))
89
+        {
87 90
             $this->configureTranslator($console);
88 91
         }
89 92
 
90
-        if ($container->has(ViewsInterface::class)) {
93
+        if ($container->has(ViewsInterface::class))
94
+        {
91 95
             $this->configureViews($console);
92 96
         }
93 97
 
94
-        if ($container->has(Migrator::class)) {
98
+        if ($container->has(Migrator::class))
99
+        {
95 100
             $this->configureMigrations($console);
96 101
         }
97 102
 
98
-        if ($container->has(InvokerInterface::class)) {
103
+        if ($container->has(InvokerInterface::class))
104
+        {
99 105
             $this->configureGRPC($console);
100 106
         }
101 107
 
102
-        if ($container->has(EncryptionInterface::class)) {
108
+        if ($container->has(EncryptionInterface::class))
109
+        {
103 110
             $this->configureEncrypter($console);
104 111
         }
105 112
     }
@@ -128,7 +135,8 @@  discard block
 block discarded – undo
128 135
 
129 136
         $console->addCommand(Cycle\SyncCommand::class);
130 137
 
131
-        if ($container->has(Migrator::class)) {
138
+        if ($container->has(Migrator::class))
139
+        {
132 140
             $console->addCommand(Cycle\MigrateCommand::class);
133 141
         }
134 142
     }
Please login to merge, or discard this patch.
src/Bootloader/Views/ViewsBootloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
44 44
     {
45
-        if (!$dirs->has('views')) {
46
-            $dirs->set('views', $dirs->get('app') . 'views');
45
+        if (!$dirs->has('views')){
46
+            $dirs->set('views', $dirs->get('app').'views');
47 47
         }
48 48
 
49 49
         // default view config
50 50
         $this->config->setDefaults('views', [
51 51
             'cache'        => [
52 52
                 'enabled'   => !$env->get('DEBUG', false),
53
-                'directory' => $dirs->get('cache') . 'views'
53
+                'directory' => $dirs->get('cache').'views'
54 54
             ],
55 55
             'namespaces'   => [
56 56
                 'default' => [$dirs->get('views')]
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function addDirectory(string $namespace, string $directory): void
68 68
     {
69
-        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) {
69
+        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){
70 70
             $this->config->modify('views', new Append('namespaces', $namespace, []));
71 71
         }
72 72
 
73
-        $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory));
73
+        $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory));
74 74
     }
75 75
 
76 76
     /**
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
44 44
     {
45
-        if (!$dirs->has('views')) {
45
+        if (!$dirs->has('views'))
46
+        {
46 47
             $dirs->set('views', $dirs->get('app') . 'views');
47 48
         }
48 49
 
@@ -66,7 +67,8 @@  discard block
 block discarded – undo
66 67
      */
67 68
     public function addDirectory(string $namespace, string $directory): void
68 69
     {
69
-        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) {
70
+        if (!isset($this->config->getConfig('views')['namespaces'][$namespace]))
71
+        {
70 72
             $this->config->modify('views', new Append('namespaces', $namespace, []));
71 73
         }
72 74
 
Please login to merge, or discard this patch.
src/Snapshots/FileSnapshotter.php 2 patches
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -92,17 +92,23 @@
 block discarded – undo
92 92
     protected function rotateSnapshots(): void
93 93
     {
94 94
         $finder = new Finder();
95
-        $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b) {
95
+        $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b)
96
+        {
96 97
             return $b->getMTime() - $a->getMTime();
97 98
         });
98 99
 
99 100
         $count = 0;
100
-        foreach ($finder as $file) {
101
+        foreach ($finder as $file)
102
+        {
101 103
             $count++;
102
-            if ($count > $this->maxFiles) {
103
-                try {
104
+            if ($count > $this->maxFiles)
105
+            {
106
+                try
107
+                {
104 108
                     $this->files->delete($file->getRealPath());
105
-                } catch (FilesException $e) {
109
+                }
110
+                catch (FilesException $e)
111
+                {
106 112
                     // ignore
107 113
                 }
108 114
             }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         int $verbosity,
50 50
         HandlerInterface $handler,
51 51
         FilesInterface $files
52
-    ) {
52
+    ){
53 53
         $this->directory = $directory;
54 54
         $this->maxFiles = $maxFiles;
55 55
         $this->verbosity = $verbosity;
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
     protected function rotateSnapshots(): void
94 94
     {
95 95
         $finder = new Finder();
96
-        $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b) {
96
+        $finder->in($this->directory)->sort(function (SplFileInfo $a, SplFileInfo $b){
97 97
             return $b->getMTime() - $a->getMTime();
98 98
         });
99 99
 
100 100
         $count = 0;
101
-        foreach ($finder as $file) {
101
+        foreach ($finder as $file){
102 102
             $count++;
103
-            if ($count > $this->maxFiles) {
104
-                try {
103
+            if ($count > $this->maxFiles){
104
+                try{
105 105
                     $this->files->delete($file->getRealPath());
106
-                } catch (FilesException $e) {
106
+                }catch (FilesException $e){
107 107
                     // ignore
108 108
                 }
109 109
             }
Please login to merge, or discard this patch.