diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-01 09:52:38 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-01 09:52:38 +0200 |
commit | f808b01692a835673f328d7221ba8c212caa9b61 (patch) | |
tree | 0c3b1fc5b1ddbd7af72227303503177689e1d403 /app/DoctrineMigrations/Version20170606155640.php | |
parent | 822c877949aff8ae57677671115f8f4fc69588d5 (diff) | |
download | wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.gz wallabag-f808b01692a835673f328d7221ba8c212caa9b61.tar.zst wallabag-f808b01692a835673f328d7221ba8c212caa9b61.zip |
Add a real configuration for CS-Fixer
Diffstat (limited to 'app/DoctrineMigrations/Version20170606155640.php')
-rw-r--r-- | app/DoctrineMigrations/Version20170606155640.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/DoctrineMigrations/Version20170606155640.php b/app/DoctrineMigrations/Version20170606155640.php index e9b50428..5f58fc29 100644 --- a/app/DoctrineMigrations/Version20170606155640.php +++ b/app/DoctrineMigrations/Version20170606155640.php | |||
@@ -9,7 +9,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; | |||
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Remove wallabag_url from craue_config_setting. | 11 | * Remove wallabag_url from craue_config_setting. |
12 | * It has been moved into the parameters.yml | 12 | * It has been moved into the parameters.yml. |
13 | */ | 13 | */ |
14 | class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface | 14 | class Version20170606155640 extends AbstractMigration implements ContainerAwareInterface |
15 | { | 15 | { |
@@ -23,11 +23,6 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI | |||
23 | $this->container = $container; | 23 | $this->container = $container; |
24 | } | 24 | } |
25 | 25 | ||
26 | private function getTable($tableName) | ||
27 | { | ||
28 | return $this->container->getParameter('database_table_prefix').$tableName; | ||
29 | } | ||
30 | |||
31 | /** | 26 | /** |
32 | * @param Schema $schema | 27 | * @param Schema $schema |
33 | */ | 28 | */ |
@@ -36,11 +31,11 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI | |||
36 | $apiUserRegistration = $this->container | 31 | $apiUserRegistration = $this->container |
37 | ->get('doctrine.orm.default_entity_manager') | 32 | ->get('doctrine.orm.default_entity_manager') |
38 | ->getConnection() | 33 | ->getConnection() |
39 | ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'wallabag_url'"); | 34 | ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'"); |
40 | 35 | ||
41 | $this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.'); | 36 | $this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.'); |
42 | 37 | ||
43 | $this->addSql('DELETE FROM '.$this->getTable('craue_config_setting')." WHERE name = 'wallabag_url'"); | 38 | $this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'"); |
44 | } | 39 | } |
45 | 40 | ||
46 | /** | 41 | /** |
@@ -48,6 +43,11 @@ class Version20170606155640 extends AbstractMigration implements ContainerAwareI | |||
48 | */ | 43 | */ |
49 | public function down(Schema $schema) | 44 | public function down(Schema $schema) |
50 | { | 45 | { |
51 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')"); | 46 | $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')"); |
47 | } | ||
48 | |||
49 | private function getTable($tableName) | ||
50 | { | ||
51 | return $this->container->getParameter('database_table_prefix') . $tableName; | ||
52 | } | 52 | } |
53 | } | 53 | } |