@@ -39,7 +39,7 @@ |
||
| 39 | 39 | libxml_use_internal_errors(true); |
| 40 | 40 | $xml = new \DOMDocument(); |
| 41 | 41 | $xml->load($file); |
| 42 | - if ( ! $xml->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . "XML" . DIRECTORY_SEPARATOR . "configuration.xsd")) { |
|
| 42 | + if (!$xml->schemaValidate(__DIR__.DIRECTORY_SEPARATOR."XML".DIRECTORY_SEPARATOR."configuration.xsd")) { |
|
| 43 | 43 | libxml_clear_errors(); |
| 44 | 44 | throw MigrationException::configurationNotValid('XML configuration did not pass the validation test.'); |
| 45 | 45 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $config = Yaml::parse(file_get_contents($file)); |
| 40 | 40 | |
| 41 | - if ( ! is_array($config)) { |
|
| 41 | + if (!is_array($config)) { |
|
| 42 | 42 | throw new \InvalidArgumentException('Not valid configuration.'); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function onMigrationsMigrated(MigrationsEventArgs $args) |
| 35 | 35 | { |
| 36 | 36 | $conn = $args->getConnection(); |
| 37 | - if ( ! $args->isDryRun() && ! $conn->isAutoCommit()) { |
|
| 37 | + if (!$args->isDryRun() && !$conn->isAutoCommit()) { |
|
| 38 | 38 | $conn->commit(); |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function __construct(\Closure $closure = null) |
| 35 | 35 | { |
| 36 | 36 | if ($closure === null) { |
| 37 | - $closure = function ($message) { |
|
| 37 | + $closure = function($message) { |
|
| 38 | 38 | }; |
| 39 | 39 | } |
| 40 | 40 | $this->closure = $closure; |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | $replacements = [ |
| 118 | 118 | $configuration->getMigrationsNamespace(), |
| 119 | 119 | $version, |
| 120 | - $up ? " " . implode("\n ", explode("\n", $up)) : null, |
|
| 121 | - $down ? " " . implode("\n ", explode("\n", $down)) : null, |
|
| 120 | + $up ? " ".implode("\n ", explode("\n", $up)) : null, |
|
| 121 | + $down ? " ".implode("\n ", explode("\n", $down)) : null, |
|
| 122 | 122 | ]; |
| 123 | 123 | |
| 124 | 124 | $code = str_replace($placeHolders, $replacements, $this->getTemplate()); |
@@ -126,12 +126,12 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $directoryHelper = new MigrationDirectoryHelper($configuration); |
| 128 | 128 | $dir = $directoryHelper->getMigrationDirectory(); |
| 129 | - $path = $dir . '/Version' . $version . '.php'; |
|
| 129 | + $path = $dir.'/Version'.$version.'.php'; |
|
| 130 | 130 | |
| 131 | 131 | file_put_contents($path, $code); |
| 132 | 132 | |
| 133 | 133 | if ($editorCmd = $input->getOption('editor-cmd')) { |
| 134 | - proc_open($editorCmd . ' ' . escapeshellarg($path), [], $pipes); |
|
| 134 | + proc_open($editorCmd.' '.escapeshellarg($path), [], $pipes); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | return $path; |
@@ -145,18 +145,18 @@ discard block |
||
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $filePath = getcwd() . '/' . $customTemplate; |
|
| 148 | + $filePath = getcwd().'/'.$customTemplate; |
|
| 149 | 149 | |
| 150 | - if ( ! is_file($filePath) || ! is_readable($filePath)) { |
|
| 150 | + if (!is_file($filePath) || !is_readable($filePath)) { |
|
| 151 | 151 | throw new \InvalidArgumentException( |
| 152 | - 'The specified template "' . $customTemplate . '" cannot be found or is not readable.' |
|
| 152 | + 'The specified template "'.$customTemplate.'" cannot be found or is not readable.' |
|
| 153 | 153 | ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $content = file_get_contents($filePath); |
| 157 | 157 | |
| 158 | 158 | if ($content === false) { |
| 159 | - throw new \InvalidArgumentException('The specified template "' . $customTemplate . '" could not be read.'); |
|
| 159 | + throw new \InvalidArgumentException('The specified template "'.$customTemplate.'" could not be read.'); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $output->writeln(sprintf('Using custom migration template "<info>%s</info>"', $customTemplate)); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | protected $schemaProvider; |
| 45 | 45 | |
| 46 | - public function __construct(SchemaProviderInterface $schemaProvider=null) |
|
| 46 | + public function __construct(SchemaProviderInterface $schemaProvider = null) |
|
| 47 | 47 | { |
| 48 | 48 | $this->schemaProvider = $schemaProvider; |
| 49 | 49 | parent::__construct(); |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | $toSchema = $this->getSchemaProvider()->createSchema(); |
| 94 | 94 | |
| 95 | 95 | //Not using value from options, because filters can be set from config.yml |
| 96 | - if ( ! $isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) { |
|
| 96 | + if (!$isDbalOld && $filterExpr = $conn->getConfiguration()->getFilterSchemaAssetsExpression()) { |
|
| 97 | 97 | foreach ($toSchema->getTables() as $table) { |
| 98 | 98 | $tableName = $table->getName(); |
| 99 | - if ( ! preg_match($filterExpr, $this->resolveTableName($tableName))) { |
|
| 99 | + if (!preg_match($filterExpr, $this->resolveTableName($tableName))) { |
|
| 100 | 100 | $toSchema->dropTable($tableName); |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $input->getOption('line-length') |
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | - if (! $up && ! $down) { |
|
| 118 | + if (!$up && !$down) { |
|
| 119 | 119 | $output->writeln('<error>No changes detected in your mapping information.</error>'); |
| 120 | 120 | |
| 121 | 121 | return; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $output->writeln(file_get_contents($path)); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - private function buildCodeFromSql(Configuration $configuration, array $sql, $formatted=false, $lineLength=120) |
|
| 131 | + private function buildCodeFromSql(Configuration $configuration, array $sql, $formatted = false, $lineLength = 120) |
|
| 132 | 132 | { |
| 133 | 133 | $currentPlatform = $configuration->getConnection()->getDatabasePlatform()->getName(); |
| 134 | 134 | $code = []; |