| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | protected function beforeUpdate(): void |
||
| 50 | { |
||
| 51 | $this->addValidator('name') |
||
| 52 | ->required() |
||
| 53 | ->latin() |
||
| 54 | ->callback( |
||
| 55 | function ($name) { |
||
| 56 | return !in_array(strtolower($name), Table::getInstance()->getBasicRoles(), false); |
||
| 57 | }, |
||
| 58 | 'Role is basic and can\'t be editable' |
||
| 59 | ) |
||
| 60 | ->callback( |
||
| 61 | function ($name) { |
||
| 62 | return $this->clean['name'] !== $name; |
||
| 63 | }, |
||
| 64 | 'Role name is the same as original' |
||
| 65 | ) |
||
| 66 | ->callback( |
||
| 67 | function ($name) { |
||
| 68 | return !Table::findRowWhere(['name' => $name]); |
||
| 69 | }, |
||
| 70 | 'Role already exists' |
||
| 71 | ); |
||
| 84 |
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