Skip to content

Commit

Permalink
Use getName() instead of directly accessing private $name
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankay committed Feb 17, 2019
1 parent a5c4503 commit 9d70485
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Command/Fastdump.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$path = null;

foreach ($schemaDefinitionPaths as $schemaPath) {
$possiblePath = "$schemaPath/{$table->name}.sql";
$possiblePath = sprintf('%s/%s.sql', $schemaPath, $table->getName());
if (file_exists($possiblePath)) {
$path = $possiblePath;
break;
}
}

if (! $path) {
$path = "{$schemaDefinitionPaths[0]}/{$table->name}.sql";
$path = sprintf('%s/%s.sql', $schemaDefinitionPaths[0], $table->getName());
}

$text = '';
Expand Down
4 changes: 2 additions & 2 deletions src/Parse/MysqlDump.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ public function diff(MysqlDump $that, array $flags = [])
$diff[] = $thatDatabase->getDDL();
$diff[] = "USE " . Token::escapeIdentifier($databaseName);
foreach ($thatDatabase->tables as $table) {
if (($includeTablesRegex == '' || preg_match($includeTablesRegex, $table->name)) &&
($excludeTablesRegex == '' || !preg_match($excludeTablesRegex, $table->name))
if (($includeTablesRegex == '' || preg_match($includeTablesRegex, $table->getName())) &&
($excludeTablesRegex == '' || !preg_match($excludeTablesRegex, $table->getName()))
) {
$diff[] = $table->getDDL($thatDatabase->getCollation());
}
Expand Down

0 comments on commit 9d70485

Please sign in to comment.