Conditions | 1 |
Paths | 1 |
Total Lines | 96 |
Code Lines | 91 |
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 | |||
40 | $this->addSql('ALTER TABLE app_anonymous_role DROP CONSTRAINT app_anonymous_role_pkey'); |
||
41 | $this->addSql('ALTER TABLE app_anonymous_role RENAME TO app_anonymous_role_prev'); |
||
42 | $this->addSql('DROP INDEX IDX_E2D1EAF6FA93803'); |
||
43 | $this->addSql('DROP INDEX IDX_E2D1EAF6D60322AC'); |
||
44 | $this->addSql('ALTER TABLE app_individual_role DROP CONSTRAINT app_individual_role_pkey'); |
||
45 | $this->addSql('ALTER TABLE app_individual_role RENAME TO app_individual_role_prev'); |
||
46 | $this->addSql('DROP INDEX IDX_C5713550AE271C0D'); |
||
47 | $this->addSql('DROP INDEX IDX_C5713550D60322AC'); |
||
48 | $this->addSql('ALTER TABLE app_organization_role DROP CONSTRAINT app_organization_role_pkey'); |
||
49 | $this->addSql('ALTER TABLE app_organization_role RENAME TO app_organization_role_prev'); |
||
50 | $this->addSql('DROP INDEX IDX_CF25196832C8A3DE'); |
||
51 | $this->addSql('DROP INDEX IDX_CF251968D60322AC'); |
||
52 | $this->addSql('ALTER TABLE app_staff_role DROP CONSTRAINT app_staff_role_pkey'); |
||
53 | $this->addSql('ALTER TABLE app_staff_role RENAME TO app_staff_role_prev'); |
||
54 | $this->addSql('DROP INDEX IDX_E3445799D4D57CD'); |
||
55 | $this->addSql('DROP INDEX IDX_E3445799D60322AC'); |
||
56 | $this->addSql('ALTER TABLE app_system_role DROP CONSTRAINT app_system_role_pkey'); |
||
57 | $this->addSql('ALTER TABLE app_system_role RENAME TO app_system_role_prev'); |
||
58 | $this->addSql('DROP INDEX IDX_1F401F20D0952FA5'); |
||
59 | $this->addSql('DROP INDEX IDX_1F401F20D60322AC'); |
||
60 | |||
61 | $this->addSql('CREATE SEQUENCE app_anonymous_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
62 | $this->addSql('CREATE SEQUENCE app_individual_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
63 | $this->addSql('CREATE SEQUENCE app_organization_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
64 | $this->addSql('CREATE SEQUENCE app_staff_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
65 | $this->addSql('CREATE SEQUENCE app_system_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
||
66 | $this->addSql('CREATE TABLE app_anonymous_role (id INT NOT NULL, anonymous_id INT DEFAULT NULL, role_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT 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))'); |
||
67 | $this->addSql('CREATE UNIQUE INDEX UNIQ_E2D1EAF6D17F50A6 ON app_anonymous_role (uuid)'); |
||
68 | $this->addSql('CREATE INDEX IDX_E2D1EAF6FA93803 ON app_anonymous_role (anonymous_id)'); |
||
69 | $this->addSql('CREATE INDEX IDX_E2D1EAF6D60322AC ON app_anonymous_role (role_id)'); |
||
70 | $this->addSql('CREATE TABLE app_anonymous_role_bu (anonymous_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(anonymous_role_id, business_unit_id))'); |
||
71 | $this->addSql('CREATE INDEX IDX_B09CAAD23089E0B ON app_anonymous_role_bu (anonymous_role_id)'); |
||
72 | $this->addSql('CREATE INDEX IDX_B09CAADA58ECB40 ON app_anonymous_role_bu (business_unit_id)'); |
||
73 | $this->addSql('CREATE TABLE app_individual_role (id INT NOT NULL, individual_id INT DEFAULT NULL, role_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT 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))'); |
||
74 | $this->addSql('CREATE UNIQUE INDEX UNIQ_C5713550D17F50A6 ON app_individual_role (uuid)'); |
||
75 | $this->addSql('CREATE INDEX IDX_C5713550AE271C0D ON app_individual_role (individual_id)'); |
||
76 | $this->addSql('CREATE INDEX IDX_C5713550D60322AC ON app_individual_role (role_id)'); |
||
77 | $this->addSql('CREATE TABLE app_individual_role_bu (individual_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(individual_role_id, business_unit_id))'); |
||
78 | $this->addSql('CREATE INDEX IDX_68A9160EFDFA321 ON app_individual_role_bu (individual_role_id)'); |
||
79 | $this->addSql('CREATE INDEX IDX_68A9160A58ECB40 ON app_individual_role_bu (business_unit_id)'); |
||
80 | $this->addSql('CREATE TABLE app_organization_role (id INT NOT NULL, organization_id INT DEFAULT NULL, role_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT 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))'); |
||
81 | $this->addSql('CREATE UNIQUE INDEX UNIQ_CF251968D17F50A6 ON app_organization_role (uuid)'); |
||
82 | $this->addSql('CREATE INDEX IDX_CF25196832C8A3DE ON app_organization_role (organization_id)'); |
||
83 | $this->addSql('CREATE INDEX IDX_CF251968D60322AC ON app_organization_role (role_id)'); |
||
84 | $this->addSql('CREATE TABLE app_organization_role_bu (organization_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(organization_role_id, business_unit_id))'); |
||
85 | $this->addSql('CREATE INDEX IDX_79C5DB011BD1AAEF ON app_organization_role_bu (organization_role_id)'); |
||
86 | $this->addSql('CREATE INDEX IDX_79C5DB01A58ECB40 ON app_organization_role_bu (business_unit_id)'); |
||
87 | $this->addSql('CREATE TABLE app_staff_role (id INT NOT NULL, staff_id INT DEFAULT NULL, role_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT 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))'); |
||
88 | $this->addSql('CREATE UNIQUE INDEX UNIQ_E3445799D17F50A6 ON app_staff_role (uuid)'); |
||
89 | $this->addSql('CREATE INDEX IDX_E3445799D4D57CD ON app_staff_role (staff_id)'); |
||
90 | $this->addSql('CREATE INDEX IDX_E3445799D60322AC ON app_staff_role (role_id)'); |
||
91 | $this->addSql('CREATE TABLE app_staff_role_bu (staff_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(staff_role_id, business_unit_id))'); |
||
92 | $this->addSql('CREATE INDEX IDX_998CF18F8AB5351A ON app_staff_role_bu (staff_role_id)'); |
||
93 | $this->addSql('CREATE INDEX IDX_998CF18FA58ECB40 ON app_staff_role_bu (business_unit_id)'); |
||
94 | $this->addSql('CREATE TABLE app_system_role (id INT NOT NULL, system_id INT DEFAULT NULL, role_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT 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))'); |
||
95 | $this->addSql('CREATE UNIQUE INDEX UNIQ_1F401F20D17F50A6 ON app_system_role (uuid)'); |
||
96 | $this->addSql('CREATE INDEX IDX_1F401F20D0952FA5 ON app_system_role (system_id)'); |
||
97 | $this->addSql('CREATE INDEX IDX_1F401F20D60322AC ON app_system_role (role_id)'); |
||
98 | $this->addSql('CREATE TABLE app_system_role_bu (system_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(system_role_id, business_unit_id))'); |
||
99 | $this->addSql('CREATE INDEX IDX_6CCE35F83A705E3F ON app_system_role_bu (system_role_id)'); |
||
100 | $this->addSql('CREATE INDEX IDX_6CCE35F8A58ECB40 ON app_system_role_bu (business_unit_id)'); |
||
101 | $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT FK_E2D1EAF6FA93803 FOREIGN KEY (anonymous_id) REFERENCES app_anonymous (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
102 | $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT FK_E2D1EAF6D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
103 | $this->addSql('ALTER TABLE app_anonymous_role_bu ADD CONSTRAINT FK_B09CAAD23089E0B FOREIGN KEY (anonymous_role_id) REFERENCES app_anonymous_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
104 | $this->addSql('ALTER TABLE app_anonymous_role_bu ADD CONSTRAINT FK_B09CAADA58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
105 | $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT FK_C5713550AE271C0D FOREIGN KEY (individual_id) REFERENCES app_individual (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
106 | $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT FK_C5713550D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
107 | $this->addSql('ALTER TABLE app_individual_role_bu ADD CONSTRAINT FK_68A9160EFDFA321 FOREIGN KEY (individual_role_id) REFERENCES app_individual_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
108 | $this->addSql('ALTER TABLE app_individual_role_bu ADD CONSTRAINT FK_68A9160A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
109 | $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT FK_CF25196832C8A3DE FOREIGN KEY (organization_id) REFERENCES app_organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
110 | $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT FK_CF251968D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
111 | $this->addSql('ALTER TABLE app_organization_role_bu ADD CONSTRAINT FK_79C5DB011BD1AAEF FOREIGN KEY (organization_role_id) REFERENCES app_organization_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
112 | $this->addSql('ALTER TABLE app_organization_role_bu ADD CONSTRAINT FK_79C5DB01A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
113 | $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT FK_E3445799D4D57CD FOREIGN KEY (staff_id) REFERENCES app_staff (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
114 | $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT FK_E3445799D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
115 | $this->addSql('ALTER TABLE app_staff_role_bu ADD CONSTRAINT FK_998CF18F8AB5351A FOREIGN KEY (staff_role_id) REFERENCES app_staff_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
116 | $this->addSql('ALTER TABLE app_staff_role_bu ADD CONSTRAINT FK_998CF18FA58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
117 | $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT FK_1F401F20D0952FA5 FOREIGN KEY (system_id) REFERENCES app_system (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
118 | $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT FK_1F401F20D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
119 | $this->addSql('ALTER TABLE app_system_role_bu ADD CONSTRAINT FK_6CCE35F83A705E3F FOREIGN KEY (system_role_id) REFERENCES app_system_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
120 | $this->addSql('ALTER TABLE app_system_role_bu ADD CONSTRAINT FK_6CCE35F8A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
121 | |||
122 | $this->addSql('INSERT INTO app_anonymous_role (id, anonymous_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_anonymous_role_id_seq\'), app_anonymous_role_prev.anonymous_id, app_anonymous_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_anonymous.owner, app_anonymous.owner_uuid, 1, app_anonymous.tenant, \'now()\', \'now()\' FROM app_anonymous_role_prev LEFT JOIN app_anonymous ON app_anonymous.id = app_anonymous_role_prev.anonymous_id'); |
||
123 | $this->addSql('DROP TABLE app_anonymous_role_prev'); |
||
124 | $this->addSql('INSERT INTO app_individual_role (id, individual_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_individual_role_id_seq\'), app_individual_role_prev.individual_id, app_individual_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_individual.owner, app_individual.owner_uuid, 1, app_individual.tenant, \'now()\', \'now()\' FROM app_individual_role_prev LEFT JOIN app_individual ON app_individual.id = app_individual_role_prev.individual_id'); |
||
125 | $this->addSql('DROP TABLE app_individual_role_prev'); |
||
126 | $this->addSql('INSERT INTO app_organization_role (id, organization_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_organization_role_id_seq\'), app_organization_role_prev.organization_id, app_organization_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_organization.owner, app_organization.owner_uuid, 1, app_organization.tenant, \'now()\', \'now()\' FROM app_organization_role_prev LEFT JOIN app_organization ON app_organization.id = app_organization_role_prev.organization_id'); |
||
127 | $this->addSql('DROP TABLE app_organization_role_prev'); |
||
128 | $this->addSql('INSERT INTO app_staff_role (id, staff_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_staff_role_id_seq\'), app_staff_role_prev.staff_id, app_staff_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_staff.owner, app_staff.owner_uuid, 1, app_staff.tenant, \'now()\', \'now()\' FROM app_staff_role_prev LEFT JOIN app_staff ON app_staff.id = app_staff_role_prev.staff_id'); |
||
129 | $this->addSql('DROP TABLE app_staff_role_prev'); |
||
130 | $this->addSql('INSERT INTO app_system_role (id, system_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_system_role_id_seq\'), app_system_role_prev.system_id, app_system_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_system.owner, app_system.owner_uuid, 1, app_system.tenant, \'now()\', \'now()\' FROM app_system_role_prev LEFT JOIN app_system ON app_system.id = app_system_role_prev.system_id'); |
||
131 | $this->addSql('DROP TABLE app_system_role_prev'); |
||
132 | } |
||
185 |
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