@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | if (!in_array('project', $columns)) { |
| 26 | 26 | // the class table object name |
| 27 | 27 | if ($manager->addField('BlendMigrations', 'project', ['after' => 'id'])) { |
| 28 | - $this->blender->outSuccess('The project column was add to the BlendMigrations class (' . |
|
| 29 | - $this->modx->getTableName('BlendMigrations') . ') successfully'); |
|
| 28 | + $this->blender->outSuccess('The project column was add to the BlendMigrations class ('. |
|
| 29 | + $this->modx->getTableName('BlendMigrations').') successfully'); |
|
| 30 | 30 | |
| 31 | 31 | } else { |
| 32 | - $this->blender->out('The project column was not added to the BlendMigrations class (' . |
|
| 33 | - $this->modx->getTableName('BlendMigrations') . ') successfully', true); |
|
| 32 | + $this->blender->out('The project column was not added to the BlendMigrations class ('. |
|
| 33 | + $this->modx->getTableName('BlendMigrations').') successfully', true); |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | if (!in_array('ran_sequence', $columns)) { |
| 39 | 39 | // the class table object name |
| 40 | 40 | if ($manager->addField('BlendMigrations', 'ran_sequence', ['after' => 'processed_at'])) { |
| 41 | - $this->blender->outSuccess('The ran_sequence column was add to the BlendMigrations class (' . |
|
| 42 | - $this->modx->getTableName('BlendMigrations') . ') successfully'); |
|
| 41 | + $this->blender->outSuccess('The ran_sequence column was add to the BlendMigrations class ('. |
|
| 42 | + $this->modx->getTableName('BlendMigrations').') successfully'); |
|
| 43 | 43 | |
| 44 | 44 | } else { |
| 45 | - $this->blender->out('The author ran_sequence was not added to the BlendMigrations class (' . |
|
| 46 | - $this->modx->getTableName('BlendMigrations') . ') successfully', true); |
|
| 45 | + $this->blender->out('The author ran_sequence was not added to the BlendMigrations class ('. |
|
| 46 | + $this->modx->getTableName('BlendMigrations').') successfully', true); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->modx->cacheManager->refresh(); |
| 83 | 83 | |
| 84 | 84 | $previous_version = $this->modx->getOption('blend.version'); |
| 85 | - if (!$previous_version || version_compare($this->getVersion(), $previous_version, '>') ) { |
|
| 85 | + if (!$previous_version || version_compare($this->getVersion(), $previous_version, '>')) { |
|
| 86 | 86 | |
| 87 | 87 | /** @var \xPDOManager $manager */ |
| 88 | 88 | $manager = $this->modx->getManager(); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $columns = []; |
| 105 | 105 | |
| 106 | - $rs = $this->modx->query('SELECT * FROM ' . $this->modx->getTableName('BlendMigrations') . ' LIMIT 0'); |
|
| 106 | + $rs = $this->modx->query('SELECT * FROM '.$this->modx->getTableName('BlendMigrations').' LIMIT 0'); |
|
| 107 | 107 | for ($i = 0; $i < $rs->columnCount(); $i++) { |
| 108 | 108 | $col = $rs->getColumnMeta($i); |
| 109 | 109 | $columns[] = $col['name']; |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | if (!in_array('author', $columns)) { |
| 26 | 26 | if ($manager->addField('BlendMigrations', 'author', ['after' => 'status'])) { |
| 27 | - $this->blender->outSuccess('The author column was add to the BlendMigrations class (' . |
|
| 28 | - $this->modx->getTableName('BlendMigrations') . ') successfully'); |
|
| 27 | + $this->blender->outSuccess('The author column was add to the BlendMigrations class ('. |
|
| 28 | + $this->modx->getTableName('BlendMigrations').') successfully'); |
|
| 29 | 29 | |
| 30 | 30 | } else { |
| 31 | - $this->blender->out('The author column was not added to the BlendMigrations class (' . |
|
| 32 | - $this->modx->getTableName('BlendMigrations') . ') successfully', true); |
|
| 31 | + $this->blender->out('The author column was not added to the BlendMigrations class ('. |
|
| 32 | + $this->modx->getTableName('BlendMigrations').') successfully', true); |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->modx->cacheManager->refresh(); |
| 62 | 62 | |
| 63 | 63 | $previous_version = $this->modx->getOption('blend.version'); |
| 64 | - if (!$previous_version || version_compare($this->getVersion(), $previous_version, '>') ) { |
|
| 64 | + if (!$previous_version || version_compare($this->getVersion(), $previous_version, '>')) { |
|
| 65 | 65 | |
| 66 | 66 | /** @var \xPDOManager $manager */ |
| 67 | 67 | $manager = $this->modx->getManager(); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | { |
| 83 | 83 | $columns = []; |
| 84 | 84 | |
| 85 | - $rs = $this->modx->query('SELECT * FROM ' . $this->modx->getTableName('BlendMigrations') . ' LIMIT 0'); |
|
| 85 | + $rs = $this->modx->query('SELECT * FROM '.$this->modx->getTableName('BlendMigrations').' LIMIT 0'); |
|
| 86 | 86 | for ($i = 0; $i < $rs->columnCount(); $i++) { |
| 87 | 87 | $col = $rs->getColumnMeta($i); |
| 88 | 88 | $columns[] = $col['name']; |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $xpdo_meta_map['BlendMigrations']= array ( |
| 3 | - 'package' => 'blend', |
|
| 4 | - 'version' => '1.1', |
|
| 5 | - 'table' => 'blend_migrations', |
|
| 6 | - 'extends' => 'xPDOSimpleObject', |
|
| 7 | - 'fields' => |
|
| 8 | - array ( |
|
| 3 | + 'package' => 'blend', |
|
| 4 | + 'version' => '1.1', |
|
| 5 | + 'table' => 'blend_migrations', |
|
| 6 | + 'extends' => 'xPDOSimpleObject', |
|
| 7 | + 'fields' => |
|
| 8 | + array ( |
|
| 9 | 9 | 'project' => 'local', |
| 10 | 10 | 'name' => NULL, |
| 11 | 11 | 'version' => NULL, |
@@ -16,78 +16,78 @@ discard block |
||
| 16 | 16 | 'created_at' => 'CURRENT_TIMESTAMP', |
| 17 | 17 | 'processed_at' => NULL, |
| 18 | 18 | 'ran_sequence' => NULL, |
| 19 | - ), |
|
| 20 | - 'fieldMeta' => |
|
| 21 | - array ( |
|
| 19 | + ), |
|
| 20 | + 'fieldMeta' => |
|
| 21 | + array ( |
|
| 22 | 22 | 'project' => |
| 23 | 23 | array ( |
| 24 | - 'dbtype' => 'varchar', |
|
| 25 | - 'precision' => '255', |
|
| 26 | - 'phptype' => 'string', |
|
| 27 | - 'null' => false, |
|
| 28 | - 'default' => 'local', |
|
| 24 | + 'dbtype' => 'varchar', |
|
| 25 | + 'precision' => '255', |
|
| 26 | + 'phptype' => 'string', |
|
| 27 | + 'null' => false, |
|
| 28 | + 'default' => 'local', |
|
| 29 | 29 | ), |
| 30 | 30 | 'name' => |
| 31 | 31 | array ( |
| 32 | - 'dbtype' => 'varchar', |
|
| 33 | - 'precision' => '255', |
|
| 34 | - 'phptype' => 'string', |
|
| 35 | - 'null' => false, |
|
| 32 | + 'dbtype' => 'varchar', |
|
| 33 | + 'precision' => '255', |
|
| 34 | + 'phptype' => 'string', |
|
| 35 | + 'null' => false, |
|
| 36 | 36 | ), |
| 37 | 37 | 'version' => |
| 38 | 38 | array ( |
| 39 | - 'dbtype' => 'varchar', |
|
| 40 | - 'precision' => '32', |
|
| 41 | - 'phptype' => 'string', |
|
| 42 | - 'null' => true, |
|
| 39 | + 'dbtype' => 'varchar', |
|
| 40 | + 'precision' => '32', |
|
| 41 | + 'phptype' => 'string', |
|
| 42 | + 'null' => true, |
|
| 43 | 43 | ), |
| 44 | 44 | 'type' => |
| 45 | 45 | array ( |
| 46 | - 'dbtype' => 'set', |
|
| 47 | - 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
|
| 48 | - 'phptype' => 'string', |
|
| 49 | - 'null' => false, |
|
| 50 | - 'default' => 'master', |
|
| 46 | + 'dbtype' => 'set', |
|
| 47 | + 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
|
| 48 | + 'phptype' => 'string', |
|
| 49 | + 'null' => false, |
|
| 50 | + 'default' => 'master', |
|
| 51 | 51 | ), |
| 52 | 52 | 'description' => |
| 53 | 53 | array ( |
| 54 | - 'dbtype' => 'text', |
|
| 55 | - 'phptype' => 'string', |
|
| 56 | - 'null' => true, |
|
| 54 | + 'dbtype' => 'text', |
|
| 55 | + 'phptype' => 'string', |
|
| 56 | + 'null' => true, |
|
| 57 | 57 | ), |
| 58 | 58 | 'status' => |
| 59 | 59 | array ( |
| 60 | - 'dbtype' => 'varchar', |
|
| 61 | - 'precision' => '16', |
|
| 62 | - 'phptype' => 'string', |
|
| 63 | - 'null' => false, |
|
| 64 | - 'default' => 'ready', |
|
| 60 | + 'dbtype' => 'varchar', |
|
| 61 | + 'precision' => '16', |
|
| 62 | + 'phptype' => 'string', |
|
| 63 | + 'null' => false, |
|
| 64 | + 'default' => 'ready', |
|
| 65 | 65 | ), |
| 66 | 66 | 'author' => |
| 67 | 67 | array ( |
| 68 | - 'dbtype' => 'varchar', |
|
| 69 | - 'precision' => '255', |
|
| 70 | - 'phptype' => 'string', |
|
| 71 | - 'null' => true, |
|
| 68 | + 'dbtype' => 'varchar', |
|
| 69 | + 'precision' => '255', |
|
| 70 | + 'phptype' => 'string', |
|
| 71 | + 'null' => true, |
|
| 72 | 72 | ), |
| 73 | 73 | 'created_at' => |
| 74 | 74 | array ( |
| 75 | - 'dbtype' => 'timestamp', |
|
| 76 | - 'phptype' => 'timestamp', |
|
| 77 | - 'null' => false, |
|
| 78 | - 'default' => 'CURRENT_TIMESTAMP', |
|
| 75 | + 'dbtype' => 'timestamp', |
|
| 76 | + 'phptype' => 'timestamp', |
|
| 77 | + 'null' => false, |
|
| 78 | + 'default' => 'CURRENT_TIMESTAMP', |
|
| 79 | 79 | ), |
| 80 | 80 | 'processed_at' => |
| 81 | 81 | array ( |
| 82 | - 'dbtype' => 'timestamp', |
|
| 83 | - 'phptype' => 'timestamp', |
|
| 84 | - 'null' => true, |
|
| 82 | + 'dbtype' => 'timestamp', |
|
| 83 | + 'phptype' => 'timestamp', |
|
| 84 | + 'null' => true, |
|
| 85 | 85 | ), |
| 86 | 86 | 'ran_sequence' => |
| 87 | 87 | array( |
| 88 | - 'dbtype' => 'int', |
|
| 89 | - 'phptype' => 'int', |
|
| 90 | - 'null' => true |
|
| 88 | + 'dbtype' => 'int', |
|
| 89 | + 'phptype' => 'int', |
|
| 90 | + 'null' => true |
|
| 91 | 91 | ) |
| 92 | - ), |
|
| 92 | + ), |
|
| 93 | 93 | ); |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -$xpdo_meta_map['BlendMigrations']= array ( |
|
| 2 | +$xpdo_meta_map['BlendMigrations'] = array( |
|
| 3 | 3 | 'package' => 'blend', |
| 4 | 4 | 'version' => '1.1', |
| 5 | 5 | 'table' => 'blend_migrations', |
| 6 | 6 | 'extends' => 'xPDOSimpleObject', |
| 7 | 7 | 'fields' => |
| 8 | - array ( |
|
| 8 | + array( |
|
| 9 | 9 | 'project' => 'local', |
| 10 | 10 | 'name' => NULL, |
| 11 | 11 | 'version' => NULL, |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | 'ran_sequence' => NULL, |
| 19 | 19 | ), |
| 20 | 20 | 'fieldMeta' => |
| 21 | - array ( |
|
| 21 | + array( |
|
| 22 | 22 | 'project' => |
| 23 | - array ( |
|
| 23 | + array( |
|
| 24 | 24 | 'dbtype' => 'varchar', |
| 25 | 25 | 'precision' => '255', |
| 26 | 26 | 'phptype' => 'string', |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | 'default' => 'local', |
| 29 | 29 | ), |
| 30 | 30 | 'name' => |
| 31 | - array ( |
|
| 31 | + array( |
|
| 32 | 32 | 'dbtype' => 'varchar', |
| 33 | 33 | 'precision' => '255', |
| 34 | 34 | 'phptype' => 'string', |
| 35 | 35 | 'null' => false, |
| 36 | 36 | ), |
| 37 | 37 | 'version' => |
| 38 | - array ( |
|
| 38 | + array( |
|
| 39 | 39 | 'dbtype' => 'varchar', |
| 40 | 40 | 'precision' => '32', |
| 41 | 41 | 'phptype' => 'string', |
| 42 | 42 | 'null' => true, |
| 43 | 43 | ), |
| 44 | 44 | 'type' => |
| 45 | - array ( |
|
| 45 | + array( |
|
| 46 | 46 | 'dbtype' => 'set', |
| 47 | 47 | 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
| 48 | 48 | 'phptype' => 'string', |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | 'default' => 'master', |
| 51 | 51 | ), |
| 52 | 52 | 'description' => |
| 53 | - array ( |
|
| 53 | + array( |
|
| 54 | 54 | 'dbtype' => 'text', |
| 55 | 55 | 'phptype' => 'string', |
| 56 | 56 | 'null' => true, |
| 57 | 57 | ), |
| 58 | 58 | 'status' => |
| 59 | - array ( |
|
| 59 | + array( |
|
| 60 | 60 | 'dbtype' => 'varchar', |
| 61 | 61 | 'precision' => '16', |
| 62 | 62 | 'phptype' => 'string', |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | 'default' => 'ready', |
| 65 | 65 | ), |
| 66 | 66 | 'author' => |
| 67 | - array ( |
|
| 67 | + array( |
|
| 68 | 68 | 'dbtype' => 'varchar', |
| 69 | 69 | 'precision' => '255', |
| 70 | 70 | 'phptype' => 'string', |
| 71 | 71 | 'null' => true, |
| 72 | 72 | ), |
| 73 | 73 | 'created_at' => |
| 74 | - array ( |
|
| 74 | + array( |
|
| 75 | 75 | 'dbtype' => 'timestamp', |
| 76 | 76 | 'phptype' => 'timestamp', |
| 77 | 77 | 'null' => false, |
| 78 | 78 | 'default' => 'CURRENT_TIMESTAMP', |
| 79 | 79 | ), |
| 80 | 80 | 'processed_at' => |
| 81 | - array ( |
|
| 81 | + array( |
|
| 82 | 82 | 'dbtype' => 'timestamp', |
| 83 | 83 | 'phptype' => 'timestamp', |
| 84 | 84 | 'null' => true, |
@@ -6,13 +6,13 @@ discard block |
||
| 6 | 6 | class BlendMigrations extends \LCI\Blend\Model\xPDO\BlendMigrations |
| 7 | 7 | { |
| 8 | 8 | |
| 9 | - public static $metaMap = array ( |
|
| 9 | + public static $metaMap = array( |
|
| 10 | 10 | 'package' => 'LCI\\Blend\\Model\\xPDO', |
| 11 | 11 | 'version' => '3.0', |
| 12 | 12 | 'table' => 'blend_migrations', |
| 13 | 13 | 'extends' => 'xPDO\\Om\\xPDOSimpleObject', |
| 14 | 14 | 'fields' => |
| 15 | - array ( |
|
| 15 | + array( |
|
| 16 | 16 | 'project' => 'local', |
| 17 | 17 | 'name' => NULL, |
| 18 | 18 | 'version' => NULL, |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | 'ran_sequence' => NULL, |
| 26 | 26 | ), |
| 27 | 27 | 'fieldMeta' => |
| 28 | - array ( |
|
| 28 | + array( |
|
| 29 | 29 | 'project' => |
| 30 | - array ( |
|
| 30 | + array( |
|
| 31 | 31 | 'dbtype' => 'varchar', |
| 32 | 32 | 'precision' => '255', |
| 33 | 33 | 'phptype' => 'string', |
@@ -35,21 +35,21 @@ discard block |
||
| 35 | 35 | 'default' => 'local', |
| 36 | 36 | ), |
| 37 | 37 | 'name' => |
| 38 | - array ( |
|
| 38 | + array( |
|
| 39 | 39 | 'dbtype' => 'varchar', |
| 40 | 40 | 'precision' => '255', |
| 41 | 41 | 'phptype' => 'string', |
| 42 | 42 | 'null' => false, |
| 43 | 43 | ), |
| 44 | 44 | 'version' => |
| 45 | - array ( |
|
| 45 | + array( |
|
| 46 | 46 | 'dbtype' => 'varchar', |
| 47 | 47 | 'precision' => '32', |
| 48 | 48 | 'phptype' => 'string', |
| 49 | 49 | 'null' => true, |
| 50 | 50 | ), |
| 51 | 51 | 'type' => |
| 52 | - array ( |
|
| 52 | + array( |
|
| 53 | 53 | 'dbtype' => 'set', |
| 54 | 54 | 'precision' => '\'master\',\'stagging\',\'dev\',\'local\'', |
| 55 | 55 | 'phptype' => 'string', |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | 'default' => 'master', |
| 58 | 58 | ), |
| 59 | 59 | 'description' => |
| 60 | - array ( |
|
| 60 | + array( |
|
| 61 | 61 | 'dbtype' => 'text', |
| 62 | 62 | 'phptype' => 'string', |
| 63 | 63 | 'null' => true, |
| 64 | 64 | ), |
| 65 | 65 | 'status' => |
| 66 | - array ( |
|
| 66 | + array( |
|
| 67 | 67 | 'dbtype' => 'varchar', |
| 68 | 68 | 'precision' => '16', |
| 69 | 69 | 'phptype' => 'string', |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | 'default' => 'ready', |
| 72 | 72 | ), |
| 73 | 73 | 'author' => |
| 74 | - array ( |
|
| 74 | + array( |
|
| 75 | 75 | 'dbtype' => 'varchar', |
| 76 | 76 | 'precision' => '255', |
| 77 | 77 | 'phptype' => 'string', |
| 78 | 78 | 'null' => true, |
| 79 | 79 | ), |
| 80 | 80 | 'created_at' => |
| 81 | - array ( |
|
| 81 | + array( |
|
| 82 | 82 | 'dbtype' => 'timestamp', |
| 83 | 83 | 'phptype' => 'timestamp', |
| 84 | 84 | 'null' => false, |
| 85 | 85 | 'default' => 'CURRENT_TIMESTAMP', |
| 86 | 86 | ), |
| 87 | 87 | 'processed_at' => |
| 88 | - array ( |
|
| 88 | + array( |
|
| 89 | 89 | 'dbtype' => 'timestamp', |
| 90 | 90 | 'phptype' => 'timestamp', |
| 91 | 91 | 'null' => true, |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | /** @var \LCI\Blend\Blendable\Resource $blendResource */ |
| 369 | 369 | $blendResource = new Resource($this->modx, $this->blender, $this->blender->getAliasFromSeedKey($seed_key), $context); |
| 370 | 370 | |
| 371 | - if(!$this->revertOneFromMany($blendResource, $seed_key, 'Resource', $seeds_dir)) { |
|
| 371 | + if (!$this->revertOneFromMany($blendResource, $seed_key, 'Resource', $seeds_dir)) { |
|
| 372 | 372 | $saved = false; |
| 373 | 373 | } |
| 374 | 374 | } |
@@ -498,11 +498,11 @@ discard block |
||
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | if ($success = $blendable->blendFromSeed($seed_key, $overwrite)) { |
| 501 | - $this->blender->outSuccess($seed_key.' ' . $object_type . ' has been blended into primary key: ' . |
|
| 501 | + $this->blender->outSuccess($seed_key.' '.$object_type.' has been blended into primary key: '. |
|
| 502 | 502 | $blendable->getXPDOSimpleObject()->getPrimaryKey()); |
| 503 | 503 | |
| 504 | 504 | } elseif ($blendable->isExists()) { |
| 505 | - $this->blender->outError($seed_key.' ' . $object_type .' already exists'); |
|
| 505 | + $this->blender->outError($seed_key.' '.$object_type.' already exists'); |
|
| 506 | 506 | if ($this->userInteractionHandler->promptConfirm('Would you like to update?', true)) { |
| 507 | 507 | if ($success = $blendable->blendFromSeed($seed_key, true)) { |
| 508 | 508 | $this->blender->out($seed_key.' has been blended'); |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | } else { |
| 513 | - $this->blender->outError('There was an error saving the ' . $object_type . ' for seed key '. $seed_key); |
|
| 513 | + $this->blender->outError('There was an error saving the '.$object_type.' for seed key '.$seed_key); |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | return $success; |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | if ($success = $blendable->revertBlend()) { |
| 534 | - $this->blender->outSuccess($seed_key.' ' . $object_type . ' has been reverted to '.$seeds_dir); |
|
| 534 | + $this->blender->outSuccess($seed_key.' '.$object_type.' has been reverted to '.$seeds_dir); |
|
| 535 | 535 | |
| 536 | 536 | } else { |
| 537 | 537 | $this->blender->outError($seed_key.' chunk was not reverted'); |
@@ -143,14 +143,14 @@ discard block |
||
| 143 | 143 | // How to mark as deprecated? |
| 144 | 144 | if (method_exists($this->blendableLoader, $name)) { |
| 145 | 145 | |
| 146 | - $message = get_class($this) . '->'.$name.'() has been deprecated, please use ' . get_class($this) . '->getBlendableLoader()->' . $name; |
|
| 146 | + $message = get_class($this).'->'.$name.'() has been deprecated, please use '.get_class($this).'->getBlendableLoader()->'.$name; |
|
| 147 | 147 | trigger_error($message, E_USER_WARNING); |
| 148 | 148 | $this->modx->log(\modX::LOG_LEVEL_ERROR, $message); |
| 149 | 149 | |
| 150 | 150 | return call_user_func_array(array($this->blendableLoader, $name), $arguments); |
| 151 | 151 | |
| 152 | 152 | } else { |
| 153 | - throw new MigratorException('Call to undefined Method ' . get_class($this) . '->' . $name); |
|
| 153 | + throw new MigratorException('Call to undefined Method '.get_class($this).'->'.$name); |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @see https://symfony.com/doc/current/console/verbosity.html |
| 192 | 192 | * @return $this |
| 193 | 193 | */ |
| 194 | - public function setVerbose(int $verbose=self::VERBOSITY_NORMAL) |
|
| 194 | + public function setVerbose(int $verbose = self::VERBOSITY_NORMAL) |
|
| 195 | 195 | { |
| 196 | 196 | $this->config['verbose'] = $verbose; |
| 197 | 197 | return $this; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @param int $verbose |
| 308 | 308 | * @param bool $error |
| 309 | 309 | */ |
| 310 | - public function out($message, $verbose=Blender::VERBOSITY_NORMAL, $error = false) |
|
| 310 | + public function out($message, $verbose = Blender::VERBOSITY_NORMAL, $error = false) |
|
| 311 | 311 | { |
| 312 | 312 | if ($this->getVerbose() >= $verbose) { |
| 313 | 313 | if ($error) { |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | * @param string $message |
| 324 | 324 | * @param int $verbose |
| 325 | 325 | */ |
| 326 | - public function outError($message, $verbose=Blender::VERBOSITY_NORMAL) |
|
| 326 | + public function outError($message, $verbose = Blender::VERBOSITY_NORMAL) |
|
| 327 | 327 | { |
| 328 | 328 | if ($this->getVerbose() >= $verbose) { |
| 329 | 329 | $this->userInteractionHandler->tellUser($message, userInteractionHandler::MASSAGE_ERROR); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | * @param string $message |
| 335 | 335 | * @param int $verbose |
| 336 | 336 | */ |
| 337 | - public function outSuccess($message, $verbose=Blender::VERBOSITY_NORMAL) |
|
| 337 | + public function outSuccess($message, $verbose = Blender::VERBOSITY_NORMAL) |
|
| 338 | 338 | { |
| 339 | 339 | if ($this->getVerbose() >= $verbose) { |
| 340 | 340 | $this->userInteractionHandler->tellUser($message, userInteractionHandler::MASSAGE_SUCCESS); |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | $current_version = $this->modx->getOption('blend.version'); |
| 456 | 456 | // FILE version, DB Version |
| 457 | 457 | if ($this->isBlendInstalledInModx() && (!$current_version || version_compare($this->getVersion(), $current_version) === 1)) { |
| 458 | - $this->outError('MODX System Setting Version: '. $current_version.' Code version: '.$this->getVersion(), Blender::VERBOSITY_DEBUG); |
|
| 458 | + $this->outError('MODX System Setting Version: '.$current_version.' Code version: '.$this->getVersion(), Blender::VERBOSITY_DEBUG); |
|
| 459 | 459 | $upgrade = true; |
| 460 | 460 | } |
| 461 | 461 | |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | * @param bool $check_install_log |
| 467 | 467 | * @return bool |
| 468 | 468 | */ |
| 469 | - public function isBlendInstalledInModx($check_install_log=true) |
|
| 469 | + public function isBlendInstalledInModx($check_install_log = true) |
|
| 470 | 470 | { |
| 471 | 471 | $installed = false; |
| 472 | 472 | try { |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $installed = true; |
| 479 | 479 | |
| 480 | 480 | } catch (\Exception $exception) { |
| 481 | - $this->out(__METHOD__ . ' Exception: '. $exception->getMessage(), Blender::VERBOSITY_DEBUG); |
|
| 481 | + $this->out(__METHOD__.' Exception: '.$exception->getMessage(), Blender::VERBOSITY_DEBUG); |
|
| 482 | 482 | // We got an exception == table not found |
| 483 | 483 | return false; |
| 484 | 484 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | $this->out(print_r($installMigration->toArray(), true), Blender::VERBOSITY_DEBUG); |
| 500 | 500 | $installed = true; |
| 501 | 501 | } |
| 502 | - $this->out(__METHOD__ . ' Blend install log not found', Blender::VERBOSITY_DEBUG); |
|
| 502 | + $this->out(__METHOD__.' Blend install log not found', Blender::VERBOSITY_DEBUG); |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | return $installed; |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | * @param string $context |
| 594 | 594 | * @return bool|int |
| 595 | 595 | */ |
| 596 | - public function getResourceIDFromLocalAlias($alias, $context='web') |
|
| 596 | + public function getResourceIDFromLocalAlias($alias, $context = 'web') |
|
| 597 | 597 | { |
| 598 | 598 | $seed_key = $this->getSeedKeyFromAlias($alias); |
| 599 | 599 | return $this->getResourceIDFromSeedKey($seed_key, $context); |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | * @param array $data |
| 112 | 112 | * @param bool $force_save_attempt |
| 113 | 113 | */ |
| 114 | - public function logMigration($data, $force_save_attempt=false) |
|
| 114 | + public function logMigration($data, $force_save_attempt = false) |
|
| 115 | 115 | { |
| 116 | 116 | if ($this->delay_logging && !$force_save_attempt) {// attempt |
| 117 | - $key = $data['project'] . $data['name']; |
|
| 117 | + $key = $data['project'].$data['name']; |
|
| 118 | 118 | $this->delayed_logs[$key] = $data; |
| 119 | 119 | |
| 120 | 120 | } else { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | // 1. Get all migrations currently in DB: |
| 188 | 188 | $blendMigrations = $this->getBlendMigrationCollection(); |
| 189 | 189 | |
| 190 | - $this->out('Searching directory for Migration classes ' . $this->blender->getMigrationPath()); |
|
| 190 | + $this->out('Searching directory for Migration classes '.$this->blender->getMigrationPath()); |
|
| 191 | 191 | |
| 192 | 192 | $loaded_migrations = []; |
| 193 | 193 | $reload = false; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | protected function runExistingDBMigrations() |
| 243 | 243 | { |
| 244 | - $this->out(__METHOD__ . ' Start', Blender::VERBOSITY_DEBUG); |
|
| 244 | + $this->out(__METHOD__.' Start', Blender::VERBOSITY_DEBUG); |
|
| 245 | 245 | /** @var \BlendMigrations $migrationLog */ |
| 246 | 246 | foreach ($this->blendMigrations as $name => $migrationLog) { |
| 247 | 247 | if (!$this->canRunMigrationVerifyLog($migrationLog)) { |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $migration->{$this->migration_method}(); |
| 263 | 263 | |
| 264 | 264 | $migrationLog->set('ran_sequence', $this->getRanSequence((int)$migrationLog->get('ran_sequence'))); |
| 265 | - $migrationLog->set('status', $this->migration_method . '_complete'); |
|
| 265 | + $migrationLog->set('status', $this->migration_method.'_complete'); |
|
| 266 | 266 | $migrationLog->set('processed_at', date('Y-m-d H:i:s')); |
| 267 | 267 | |
| 268 | 268 | if ($this->delay_logging) { |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | |
| 276 | 276 | } else { |
| 277 | 277 | // error |
| 278 | - throw new MigratorException('Class: ' . $name .' is not an instance of LCI\BLend\Migrations'); |
|
| 278 | + throw new MigratorException('Class: '.$name.' is not an instance of LCI\BLend\Migrations'); |
|
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | protected function runLoadedFileMigrations($loaded_migrations) |
| 287 | 287 | { |
| 288 | - $this->out(__METHOD__ . ' Start', Blender::VERBOSITY_DEBUG); |
|
| 288 | + $this->out(__METHOD__.' Start', Blender::VERBOSITY_DEBUG); |
|
| 289 | 289 | $logged_migrations = $this->getBlendMigrationCollection(); |
| 290 | 290 | |
| 291 | 291 | $count = 0; |
@@ -306,11 +306,11 @@ discard block |
||
| 306 | 306 | /** @var \BlendMigrations $migrationLog */ |
| 307 | 307 | $migrationLog = $logged_migrations[$name]; |
| 308 | 308 | $migrationLog->set('ran_sequence', $this->getRanSequence($migrationLog->get('ran_sequence'))); |
| 309 | - $migrationLog->set('status', $this->migration_method . '_complete'); |
|
| 309 | + $migrationLog->set('status', $this->migration_method.'_complete'); |
|
| 310 | 310 | $migrationLog->set('processed_at', date('Y-m-d H:i:s')); |
| 311 | 311 | |
| 312 | 312 | if ($this->delay_logging) { |
| 313 | - $this->delayed_logs[$this->project . $name] = $migrationLog; |
|
| 313 | + $this->delayed_logs[$this->project.$name] = $migrationLog; |
|
| 314 | 314 | |
| 315 | 315 | } else { |
| 316 | 316 | $migrationLog->save(); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | 'description' => $migration->getDescription(), |
| 325 | 325 | 'type' => $migration->getType(), |
| 326 | 326 | 'version' => $migration->getVersion(), |
| 327 | - 'status' => $this->migration_method . '_complete', |
|
| 327 | + 'status' => $this->migration_method.'_complete', |
|
| 328 | 328 | 'ran_sequence' => $this->getRanSequence($count++), |
| 329 | 329 | 'processed_at' => date('Y-m-d H:i:s') |
| 330 | 330 | ]); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | ($this->migration_method == 'up' && $status == 'up_complete') || |
| 384 | 384 | ($this->migration_method == 'down' && $status != 'up_complete') |
| 385 | 385 | ) { |
| 386 | - $this->out('canRunMigrationVerifyLog() Failed' . __LINE__, OutputInterface::VERBOSITY_DEBUG); |
|
| 386 | + $this->out('canRunMigrationVerifyLog() Failed'.__LINE__, OutputInterface::VERBOSITY_DEBUG); |
|
| 387 | 387 | $can = false; |
| 388 | 388 | } |
| 389 | 389 | |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | } |
| 430 | 430 | $query->prepare(); |
| 431 | 431 | |
| 432 | - $this->out(__METHOD__ .':: sql: ' . $query->toSQL(), OutputInterface::VERBOSITY_DEBUG); |
|
| 432 | + $this->out(__METHOD__.':: sql: '.$query->toSQL(), OutputInterface::VERBOSITY_DEBUG); |
|
| 433 | 433 | |
| 434 | 434 | $migrationCollection = $this->modx->getCollection($this->blender->getBlendClassObject(), $query); |
| 435 | 435 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | * @param int $ran_sequence |
| 448 | 448 | * @return int|mixed |
| 449 | 449 | */ |
| 450 | - protected function getRanSequence(int $ran_sequence=0) |
|
| 450 | + protected function getRanSequence(int $ran_sequence = 0) |
|
| 451 | 451 | { |
| 452 | 452 | if ($this->migration_method == 'up') { |
| 453 | 453 | /** @var \xPDOQuery $query */ |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | * @param string $message |
| 502 | 502 | * @param int $verbose |
| 503 | 503 | */ |
| 504 | - protected function outError($message, $verbose=OutputInterface::VERBOSITY_NORMAL) |
|
| 504 | + protected function outError($message, $verbose = OutputInterface::VERBOSITY_NORMAL) |
|
| 505 | 505 | { |
| 506 | 506 | $this->blender->outError($message, $verbose); |
| 507 | 507 | } |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | * @param string $message |
| 511 | 511 | * @param int $verbose |
| 512 | 512 | */ |
| 513 | - protected function out($message, $verbose=OutputInterface::VERBOSITY_NORMAL) |
|
| 513 | + protected function out($message, $verbose = OutputInterface::VERBOSITY_NORMAL) |
|
| 514 | 514 | { |
| 515 | 515 | $this->blender->out($message, $verbose); |
| 516 | 516 | } |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | * @param string $context |
| 638 | 638 | * @return $this |
| 639 | 639 | */ |
| 640 | - public function setFieldParentFromAlias($alias, $context='web') |
|
| 640 | + public function setFieldParentFromAlias($alias, $context = 'web') |
|
| 641 | 641 | { |
| 642 | 642 | $this->blendable_xpdo_simple_object_data['parent'] = [ |
| 643 | 643 | 'seed_key' => $this->blender->getSeedKeyFromAlias($alias), |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | * @param string $context |
| 779 | 779 | * @return $this |
| 780 | 780 | */ |
| 781 | - public function setTVValueResourceIDFromAlias($tv_name, $alias, $context='web') |
|
| 781 | + public function setTVValueResourceIDFromAlias($tv_name, $alias, $context = 'web') |
|
| 782 | 782 | { |
| 783 | 783 | $value = $this->blender->getResourceIDFromLocalAlias($alias, $context); |
| 784 | 784 | |