Passed
Branch master (16d9c9)
by Anton
04:39
created
tests/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,4 +9,4 @@
 block discarded – undo
9 9
 ini_set('display_errors', true);
10 10
 
11 11
 //Composer
12
-require dirname(__DIR__) . '/vendor/autoload.php';
13 12
\ No newline at end of file
13
+require dirname(__DIR__).'/vendor/autoload.php';
14 14
\ No newline at end of file
Please login to merge, or discard this patch.
src/Command/Migrate/MigrateCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function perform()
25 25
     {
26
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
26
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment()){
27 27
             return;
28 28
         }
29 29
 
30 30
         $found = false;
31 31
         $count = $this->option('one') ? 1 : PHP_INT_MAX;
32 32
 
33
-        while ($count > 0 && ($migration = $this->migrator->run())) {
33
+        while ($count > 0 && ($migration = $this->migrator->run())){
34 34
             $found = true;
35 35
             $count--;
36 36
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             );
41 41
         }
42 42
 
43
-        if (!$found) {
43
+        if (!$found){
44 44
             $this->writeln("<fg=red>No outstanding migrations were found.</fg=red>");
45 45
         }
46 46
     }
Please login to merge, or discard this patch.
src/Command/Migrate/AbstractCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected function verifyConfigured(): bool
42 42
     {
43
-        if (!$this->migrator->isConfigured()) {
43
+        if (!$this->migrator->isConfigured()){
44 44
             $this->writeln(
45 45
                 "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>"
46 46
             );
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
      */
59 59
     protected function verifyEnvironment(): bool
60 60
     {
61
-        if ($this->option('force') || $this->config->isSafe()) {
61
+        if ($this->option('force') || $this->config->isSafe()){
62 62
             //Safe to run
63 63
             return true;
64 64
         }
65 65
 
66 66
         $this->writeln("<fg=red>Confirmation is required to run migrations!</fg=red>");
67 67
 
68
-        if (!$this->askConfirmation()) {
68
+        if (!$this->askConfirmation()){
69 69
             $this->writeln("<comment>Cancelling operation...</comment>");
70 70
 
71 71
             return false;
Please login to merge, or discard this patch.
src/Command/Migrate/StatusCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,18 +27,18 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function perform(FilesInterface $files)
29 29
     {
30
-        if (!$this->verifyConfigured()) {
30
+        if (!$this->verifyConfigured()){
31 31
             return;
32 32
         }
33 33
 
34
-        if (empty($this->migrator->getMigrations())) {
34
+        if (empty($this->migrator->getMigrations())){
35 35
             $this->writeln("<comment>No migrations were found.</comment>");
36 36
 
37 37
             return;
38 38
         }
39 39
 
40 40
         $table = $this->table(['Migration', 'Filename', 'Created at', 'Executed at']);
41
-        foreach ($this->migrator->getMigrations() as $migration) {
41
+        foreach ($this->migrator->getMigrations() as $migration){
42 42
             $filename = (new \ReflectionClass($migration))->getFileName();
43 43
 
44 44
             $state = $migration->getState();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 $state->getTimeCreated()->format('Y-m-d H:i:s'),
52 52
                 $state->getStatus() == State::STATUS_PENDING
53 53
                     ? self::PENDING
54
-                    : '<info>' . $state->getTimeExecuted()->format('Y-m-d H:i:s') . '</info>'
54
+                    : '<info>'.$state->getTimeExecuted()->format('Y-m-d H:i:s').'</info>'
55 55
             ]);
56 56
         }
57 57
 
Please login to merge, or discard this patch.
src/Command/Migrate/RollbackCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function perform()
25 25
     {
26
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
26
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment()){
27 27
             //Making sure we can safely migrate in this environment
28 28
             return;
29 29
         }
30 30
 
31 31
         $found = false;
32 32
         $count = !$this->option('all') ? 1 : PHP_INT_MAX;
33
-        while ($count > 0 && ($migration = $this->migrator->rollback())) {
33
+        while ($count > 0 && ($migration = $this->migrator->rollback())){
34 34
             $found = true;
35 35
             $count--;
36 36
             $this->sprintf(
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             );
40 40
         }
41 41
 
42
-        if (!$found) {
42
+        if (!$found){
43 43
             $this->writeln("<fg=red>No executed migrations were found.</fg=red>");
44 44
         }
45 45
     }
Please login to merge, or discard this patch.
src/Command/Database/TableCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $database = $dbal->database($this->option('database'));
42 42
         $schema = $database->table($this->argument('table'))->getSchema();
43 43
 
44
-        if (!$schema->exists()) {
44
+        if (!$schema->exists()){
45 45
             throw new DBALException(
46 46
                 "Table {$database->getName()}.{$this->argument('table')} does not exists."
47 47
             );
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 
56 56
         $this->describeColumns($schema);
57 57
 
58
-        if (!empty($indexes = $schema->getIndexes())) {
58
+        if (!empty($indexes = $schema->getIndexes())){
59 59
             $this->describeIndexes($database, $indexes);
60 60
         }
61 61
 
62
-        if (!empty($foreignKeys = $schema->getForeignKeys())) {
62
+        if (!empty($foreignKeys = $schema->getForeignKeys())){
63 63
             $this->describeForeignKeys($database, $foreignKeys);
64 64
         }
65 65
 
@@ -79,34 +79,34 @@  discard block
 block discarded – undo
79 79
             'Default Value:'
80 80
         ]);
81 81
 
82
-        foreach ($schema->getColumns() as $column) {
82
+        foreach ($schema->getColumns() as $column){
83 83
             $name = $column->getName();
84 84
             $type = $column->getType();
85 85
 
86 86
             $abstractType = $column->getAbstractType();
87 87
             $defaultValue = $column->getDefaultValue();
88 88
 
89
-            if ($column->getSize()) {
89
+            if ($column->getSize()){
90 90
                 $type .= " ({$column->getSize()})";
91 91
             }
92 92
 
93
-            if ($abstractType == 'decimal') {
93
+            if ($abstractType == 'decimal'){
94 94
                 $type .= " ({$column->getPrecision()}, {$column->getScale()})";
95 95
             }
96 96
 
97
-            if (in_array($column->getName(), $schema->getPrimaryKeys())) {
97
+            if (in_array($column->getName(), $schema->getPrimaryKeys())){
98 98
                 $name = "<fg=magenta>{$name}</fg=magenta>";
99 99
             }
100 100
 
101
-            if (in_array($abstractType, ['primary', 'bigPrimary'])) {
101
+            if (in_array($abstractType, ['primary', 'bigPrimary'])){
102 102
                 $abstractType = "<fg=magenta>{$abstractType}</fg=magenta>";
103 103
             }
104 104
 
105
-            if ($defaultValue instanceof FragmentInterface) {
105
+            if ($defaultValue instanceof FragmentInterface){
106 106
                 $defaultValue = "<info>{$defaultValue}</info>";
107 107
             }
108 108
 
109
-            if ($defaultValue instanceof \DateTimeInterface) {
109
+            if ($defaultValue instanceof \DateTimeInterface){
110 110
                 $defaultValue = $defaultValue->format('c');
111 111
             }
112 112
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         );
136 136
 
137 137
         $indexesTable = $this->table(['Name:', 'Type:', 'Columns:']);
138
-        foreach ($indexes as $index) {
138
+        foreach ($indexes as $index){
139 139
             $indexesTable->addRow([
140 140
                 $index->getName(),
141 141
                 $index->isUnique() ? 'UNIQUE INDEX' : 'INDEX',
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             'On Update:'
167 167
         ]);
168 168
 
169
-        foreach ($foreignKeys as $reference) {
169
+        foreach ($foreignKeys as $reference){
170 170
             $foreignTable->addRow([
171 171
                 $reference->getName(),
172 172
                 $reference->getColumn(),
Please login to merge, or discard this patch.
src/Command/Views/ResetCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function perform(ViewsConfig $config, FilesInterface $files)
28 28
     {
29
-        if (!$files->exists($config->cacheDirectory())) {
29
+        if (!$files->exists($config->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 view cache:</info>");
37 37
         }
38 38
 
39
-        foreach ($files->getFiles($config->cacheDirectory()) as $filename) {
40
-            try {
39
+        foreach ($files->getFiles($config->cacheDirectory()) as $filename){
40
+            try{
41 41
                 $files->delete($filename);
42
-            } catch (\Throwable $e) {
42
+            }catch (\Throwable $e){
43 43
                 $this->sprintf("<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
44 44
                     $files->relativePath($filename, $config->cacheDirectory()),
45 45
                     $e->getMessage()
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 continue;
49 49
             }
50 50
 
51
-            if ($this->isVerbose()) {
51
+            if ($this->isVerbose()){
52 52
                 $this->sprintf(
53 53
                     "<fg=green>[deleted]</fg=green> `%s`\n",
54 54
                     $files->relativePath($filename, $config->cacheDirectory())
Please login to merge, or discard this patch.
src/Module/Publisher.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
         string $destination,
44 44
         string $mergeMode = self::FOLLOW,
45 45
         int $mode = FilesInterface::READONLY
46
-    ) {
47
-        if (!$this->files->isFile($filename)) {
46
+    ){
47
+        if (!$this->files->isFile($filename)){
48 48
             throw new PublishException("Given '{$filename}' is not valid file");
49 49
         }
50 50
 
51
-        if ($this->files->exists($destination)) {
52
-            if ($this->files->md5($destination) == $this->files->md5($filename)) {
51
+        if ($this->files->exists($destination)){
52
+            if ($this->files->md5($destination) == $this->files->md5($filename)){
53 53
                 //Nothing to do
54 54
                 return;
55 55
             }
56 56
 
57
-            if ($mergeMode == self::FOLLOW) {
57
+            if ($mergeMode == self::FOLLOW){
58 58
                 return;
59 59
             }
60 60
         }
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
         string $destination,
76 76
         string $mergeMode = self::REPLACE,
77 77
         int $mode = FilesInterface::READONLY
78
-    ) {
79
-        if (!$this->files->isDirectory($directory)) {
78
+    ){
79
+        if (!$this->files->isDirectory($directory)){
80 80
             throw new PublishException("Given '{$directory}' is not valid directory");
81 81
         }
82 82
 
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
         /**
87 87
          * @var SplFileInfo $file
88 88
          */
89
-        foreach ($finder->getIterator() as $file) {
89
+        foreach ($finder->getIterator() as $file){
90 90
             $this->publish(
91 91
                 (string)$file,
92
-                $destination . '/' . $file->getRelativePathname(),
92
+                $destination.'/'.$file->getRelativePathname(),
93 93
                 $mergeMode,
94 94
                 $mode
95 95
             );
Please login to merge, or discard this patch.
src/Http/PaginationFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function createPaginator(string $parameter, int $limit = 25): PaginatorInterface
45 45
     {
46
-        if (!$this->container->has(ServerRequestInterface::class)) {
46
+        if (!$this->container->has(ServerRequestInterface::class)){
47 47
             throw new ScopeException("Unable to create paginator, no request scope found");
48 48
         }
49 49
         /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
         //Getting page number
55 55
         $page = 0;
56
-        if (!empty($query[$parameter]) && is_scalar($query[$parameter])) {
56
+        if (!empty($query[$parameter]) && is_scalar($query[$parameter])){
57 57
             $page = (int)$query[$parameter];
58 58
         }
59 59
 
Please login to merge, or discard this patch.