Conditions | 2 |
Paths | 2 |
Total Lines | 53 |
Code Lines | 49 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
75 | public function up(Schema $schema) |
||
76 | { |
||
77 | $parameters = Parameters::parseFile(static::DIRECTORY.'/parameters.yaml'); |
||
78 | $this->acl->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/acl.yaml', $parameters)); |
||
79 | $this->config->setContainer($this->container)->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/config.yaml', $parameters)); |
||
80 | $this->metadata->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/metadata.yaml', $parameters)); |
||
81 | $this->parameter->setContainer($this->container)->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/system/parameter.yaml', $parameters)); |
||
82 | $this->tenant->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/system/tenant.yaml', $parameters)); |
||
83 | |||
84 | switch ($this->platform->getName()) { |
||
85 | case 'postgresql': |
||
86 | $this->addSql('CREATE SEQUENCE app_data_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
87 | $this->addSql('CREATE SEQUENCE app_data_trans_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
88 | $this->addSql('CREATE SEQUENCE app_file_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
89 | $this->addSql('CREATE SEQUENCE app_file_trans_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
90 | $this->addSql('CREATE SEQUENCE app_page_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
91 | $this->addSql('CREATE SEQUENCE app_page_trans_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
92 | $this->addSql('CREATE SEQUENCE app_text_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
93 | $this->addSql('CREATE SEQUENCE app_text_trans_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
94 | $this->addSql('CREATE TABLE app_data (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, slug VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
95 | $this->addSql('CREATE UNIQUE INDEX UNIQ_A8DDD6C3D17F50A6 ON app_data (uuid)'); |
||
96 | $this->addSql('CREATE UNIQUE INDEX UNIQ_A8DDD6C3989D9B624E59C462 ON app_data (slug, tenant)'); |
||
97 | $this->addSql('CREATE TABLE app_data_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, data JSON NOT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
98 | $this->addSql('CREATE INDEX IDX_6885795E2C2AC5D3 ON app_data_trans (translatable_id)'); |
||
99 | $this->addSql('CREATE UNIQUE INDEX app_data_trans_unique_translation ON app_data_trans (translatable_id, locale)'); |
||
100 | $this->addSql('COMMENT ON COLUMN app_data_trans.data IS \'(DC2Type:json_array)\''); |
||
101 | $this->addSql('CREATE TABLE app_file (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, slug VARCHAR(255) NOT NULL, "type" VARCHAR(255) DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
102 | $this->addSql('CREATE UNIQUE INDEX UNIQ_89B113B0D17F50A6 ON app_file (uuid)'); |
||
103 | $this->addSql('CREATE UNIQUE INDEX UNIQ_89B113B0989D9B624E59C462 ON app_file (slug, tenant)'); |
||
104 | $this->addSql('CREATE TABLE app_file_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, presentation TEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
105 | $this->addSql('CREATE INDEX IDX_8CB905F62C2AC5D3 ON app_file_trans (translatable_id)'); |
||
106 | $this->addSql('CREATE UNIQUE INDEX app_file_trans_unique_translation ON app_file_trans (translatable_id, locale)'); |
||
107 | $this->addSql('CREATE TABLE app_page (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, slug VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
108 | $this->addSql('CREATE UNIQUE INDEX UNIQ_11249380D17F50A6 ON app_page (uuid)'); |
||
109 | $this->addSql('CREATE UNIQUE INDEX UNIQ_11249380989D9B624E59C462 ON app_page (slug, tenant)'); |
||
110 | $this->addSql('CREATE TABLE app_page_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
111 | $this->addSql('CREATE INDEX IDX_40BB4A172C2AC5D3 ON app_page_trans (translatable_id)'); |
||
112 | $this->addSql('CREATE UNIQUE INDEX app_page_trans_unique_translation ON app_page_trans (translatable_id, locale)'); |
||
113 | $this->addSql('CREATE TABLE app_text (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, slug VARCHAR(255) NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
114 | $this->addSql('CREATE UNIQUE INDEX UNIQ_3EA58267D17F50A6 ON app_text (uuid)'); |
||
115 | $this->addSql('CREATE UNIQUE INDEX UNIQ_3EA58267989D9B624E59C462 ON app_text (slug, tenant)'); |
||
116 | $this->addSql('CREATE TABLE app_text_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, value TEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
117 | $this->addSql('CREATE INDEX IDX_708E0F9C2C2AC5D3 ON app_text_trans (translatable_id)'); |
||
118 | $this->addSql('CREATE UNIQUE INDEX app_text_trans_unique_translation ON app_text_trans (translatable_id, locale)'); |
||
119 | $this->addSql('ALTER TABLE app_data_trans ADD CONSTRAINT FK_6885795E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_data (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
120 | $this->addSql('ALTER TABLE app_file_trans ADD CONSTRAINT FK_8CB905F62C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_file (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
121 | $this->addSql('ALTER TABLE app_page_trans ADD CONSTRAINT FK_40BB4A172C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_page (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
122 | $this->addSql('ALTER TABLE app_text_trans ADD CONSTRAINT FK_708E0F9C2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_text (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
123 | break; |
||
124 | |||
125 | default: |
||
126 | $this->abortIf(true,'Migration cannot be executed on "'.$this->platform->getName().'".'); |
||
127 | break; |
||
128 | } |
||
174 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths