Skip to content

Commit

Permalink
fix code style and namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Jul 24, 2020
1 parent 5638df5 commit 69c840f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions core-bundle/src/Migration/Version410/FolderUrlMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function shouldRun(): bool
if (!$this->getConfig()->has('folderUrl')) {
return false;
}

return $this->getConfig()->get('folderUrl') && !$this->hasUpdatedRootPages();
}

Expand Down Expand Up @@ -84,13 +84,15 @@ private function getConfig(): Config

private function hasRootPages(): bool
{
$query = "SELECT COUNT(id) FROM tl_page WHERE ".$this->connection->quoteIdentifier('type')." = 'root'";
$query = 'SELECT COUNT(id) FROM tl_page WHERE '.$this->connection->quoteIdentifier('type')." = 'root'";

return (int) $this->connection->executeQuery($query)->fetchColumn() > 0;
}

private function hasUpdatedRootPages(): bool
{
$query = "SELECT COUNT(id) FROM tl_page WHERE ".$this->connection->quoteIdentifier('type')." = 'root' AND useFolderUrl = '1'";
$query = 'SELECT COUNT(id) FROM tl_page WHERE '.$this->connection->quoteIdentifier('type')." = 'root' AND useFolderUrl = '1'";

return (int) $this->connection->executeQuery($query)->fetchColumn() > 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @license LGPL-3.0-or-later
*/

namespace Contao\CoreBundle\Tests\Migration\Version409;
namespace Contao\CoreBundle\Tests\Migration\Version410;

use Contao\Config;
use Contao\CoreBundle\Migration\Version410\FolderUrlMigration;
Expand Down

0 comments on commit 69c840f

Please sign in to comment.