| Conditions | 1 |
| Paths | 1 |
| Total Lines | 116 |
| Code Lines | 39 |
| 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 |
||
| 36 | public function up(Schema $schema) |
||
| 37 | { |
||
| 38 | $this->acl->up($schema); |
||
| 39 | $this->addSql('ALTER TABLE app_anonymous_role ADD entity_uuids JSON DEFAULT NULL'); |
||
| 40 | $this->addSql('COMMENT ON COLUMN app_anonymous_role.entity_uuids IS \'(DC2Type:json_array)\''); |
||
| 41 | $this->addSql('ALTER TABLE app_individual_role ADD entity_uuids JSON DEFAULT NULL'); |
||
| 42 | $this->addSql('COMMENT ON COLUMN app_individual_role.entity_uuids IS \'(DC2Type:json_array)\''); |
||
| 43 | $this->addSql('ALTER TABLE app_organization_role ADD entity_uuids JSON DEFAULT NULL'); |
||
| 44 | $this->addSql('COMMENT ON COLUMN app_organization_role.entity_uuids IS \'(DC2Type:json_array)\''); |
||
| 45 | $this->addSql('ALTER TABLE app_staff_role ADD entity_uuids JSON DEFAULT NULL'); |
||
| 46 | $this->addSql('COMMENT ON COLUMN app_staff_role.entity_uuids IS \'(DC2Type:json_array)\''); |
||
| 47 | $this->addSql('ALTER TABLE app_system_role ADD entity_uuids JSON DEFAULT NULL'); |
||
| 48 | $this->addSql('COMMENT ON COLUMN app_system_role.entity_uuids IS \'(DC2Type:json_array)\''); |
||
| 49 | $this->addSql(' |
||
| 50 | UPDATE |
||
| 51 | app_anonymous_role |
||
| 52 | SET |
||
| 53 | entity_uuids = ( |
||
| 54 | SELECT |
||
| 55 | array_to_json(array_agg(app_bu.uuid)) |
||
| 56 | FROM |
||
| 57 | app_anonymous_role_bu |
||
| 58 | INNER JOIN |
||
| 59 | app_bu ON |
||
| 60 | app_bu.id = app_anonymous_role_bu.business_unit_id |
||
| 61 | WHERE |
||
| 62 | app_anonymous_role_bu.anonymous_role_id = app_anonymous_role.id |
||
| 63 | ) |
||
| 64 | '); |
||
| 65 | $this->addSql('UPDATE app_anonymous_role SET entity_uuids = \'[]\' WHERE entity_uuids IS NULL'); |
||
| 66 | $this->addSql(' |
||
| 67 | UPDATE |
||
| 68 | app_individual_role |
||
| 69 | SET |
||
| 70 | entity_uuids = ( |
||
| 71 | SELECT |
||
| 72 | array_to_json(array_agg(app_bu.uuid)) |
||
| 73 | FROM |
||
| 74 | app_individual_role_bu |
||
| 75 | INNER JOIN |
||
| 76 | app_bu ON |
||
| 77 | app_bu.id = app_individual_role_bu.business_unit_id |
||
| 78 | WHERE |
||
| 79 | app_individual_role_bu.individual_role_id = app_individual_role.id |
||
| 80 | ) |
||
| 81 | '); |
||
| 82 | $this->addSql('UPDATE app_individual_role SET entity_uuids = \'[]\' WHERE entity_uuids IS NULL'); |
||
| 83 | $this->addSql(' |
||
| 84 | UPDATE |
||
| 85 | app_organization_role |
||
| 86 | SET |
||
| 87 | entity_uuids = ( |
||
| 88 | SELECT |
||
| 89 | array_to_json(array_agg(app_bu.uuid)) |
||
| 90 | FROM |
||
| 91 | app_organization_role_bu |
||
| 92 | INNER JOIN |
||
| 93 | app_bu ON |
||
| 94 | app_bu.id = app_organization_role_bu.business_unit_id |
||
| 95 | WHERE |
||
| 96 | app_organization_role_bu.organization_role_id = app_organization_role.id |
||
| 97 | ) |
||
| 98 | '); |
||
| 99 | $this->addSql('UPDATE app_organization_role SET entity_uuids = \'[]\' WHERE entity_uuids IS NULL'); |
||
| 100 | $this->addSql(' |
||
| 101 | UPDATE |
||
| 102 | app_staff_role |
||
| 103 | SET |
||
| 104 | entity_uuids = ( |
||
| 105 | SELECT |
||
| 106 | array_to_json(array_agg(app_bu.uuid)) |
||
| 107 | FROM |
||
| 108 | app_staff_role_bu |
||
| 109 | INNER JOIN |
||
| 110 | app_bu ON |
||
| 111 | app_bu.id = app_staff_role_bu.business_unit_id |
||
| 112 | WHERE |
||
| 113 | app_staff_role_bu.staff_role_id = app_staff_role.id |
||
| 114 | ) |
||
| 115 | '); |
||
| 116 | $this->addSql('UPDATE app_staff_role SET entity_uuids = \'[]\' WHERE entity_uuids IS NULL'); |
||
| 117 | $this->addSql(' |
||
| 118 | UPDATE |
||
| 119 | app_system_role |
||
| 120 | SET |
||
| 121 | entity_uuids = ( |
||
| 122 | SELECT |
||
| 123 | array_to_json(array_agg(app_bu.uuid)) |
||
| 124 | FROM |
||
| 125 | app_system_role_bu |
||
| 126 | INNER JOIN |
||
| 127 | app_bu ON |
||
| 128 | app_bu.id = app_system_role_bu.business_unit_id |
||
| 129 | WHERE |
||
| 130 | app_system_role_bu.system_role_id = app_system_role.id |
||
| 131 | ) |
||
| 132 | '); |
||
| 133 | $this->addSql('UPDATE app_system_role SET entity_uuids = \'[]\' WHERE entity_uuids IS NULL'); |
||
| 134 | $this->addSql('ALTER TABLE app_anonymous_role ALTER entity_uuids SET NOT NULL'); |
||
| 135 | $this->addSql('ALTER TABLE app_individual_role ALTER entity_uuids SET NOT NULL'); |
||
| 136 | $this->addSql('ALTER TABLE app_organization_role ALTER entity_uuids SET NOT NULL'); |
||
| 137 | $this->addSql('ALTER TABLE app_staff_role ALTER entity_uuids SET NOT NULL'); |
||
| 138 | $this->addSql('ALTER TABLE app_system_role ALTER entity_uuids SET NOT NULL'); |
||
| 139 | $this->addSql('DROP TABLE app_anonymous_role_bu'); |
||
| 140 | $this->addSql('DROP TABLE app_individual_role_bu'); |
||
| 141 | $this->addSql('DROP TABLE app_organization_role_bu'); |
||
| 142 | $this->addSql('DROP TABLE app_staff_role_bu'); |
||
| 143 | $this->addSql('DROP TABLE app_system_role_bu'); |
||
| 144 | $this->addSql('CREATE SEQUENCE app_bu_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
| 145 | $this->addSql('CREATE TABLE app_bu_role (id INT NOT NULL, business_unit_id INT DEFAULT NULL, role_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, entity_uuids JSON NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 146 | $this->addSql('CREATE UNIQUE INDEX UNIQ_FB9993E1D17F50A6 ON app_bu_role (uuid)'); |
||
| 147 | $this->addSql('CREATE INDEX IDX_FB9993E1A58ECB40 ON app_bu_role (business_unit_id)'); |
||
| 148 | $this->addSql('CREATE INDEX IDX_FB9993E1D60322AC ON app_bu_role (role_id)'); |
||
| 149 | $this->addSql('COMMENT ON COLUMN app_bu_role.entity_uuids IS \'(DC2Type:json_array)\''); |
||
| 150 | $this->addSql('ALTER TABLE app_bu_role ADD CONSTRAINT FK_A2DAA637A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 151 | $this->addSql('ALTER TABLE app_bu_role ADD CONSTRAINT FK_A2DAA637D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 152 | } |
||
| 256 |
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