| Total Complexity | 5 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 84.21% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | abstract class Assignment extends Pivot |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @return string class name for the process this worklog is attached to. |
||
| 19 | */ |
||
| 20 | abstract protected function processClass(): string; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @inheritdoc |
||
| 24 | */ |
||
| 25 | 2 | public function rules() |
|
| 26 | { |
||
| 27 | return [ |
||
| 28 | 2 | [['process_id', 'user_id'], 'required'], |
|
| 29 | [['process_id', 'user_id'], 'integer'], |
||
| 30 | [ |
||
| 31 | ['process_id'], |
||
| 32 | 2 | 'exist', |
|
| 33 | 'targetAttribute' => ['process_id' => 'id'], |
||
| 34 | 2 | 'targetClass' => $this->processClass(), |
|
| 35 | ], |
||
| 36 | [ |
||
| 37 | ['user_id'], |
||
| 38 | 2 | 'exist', |
|
| 39 | 'targetAttribute' => ['user_id' => 'id'], |
||
| 40 | 2 | 'targetClass' => Yii::$app->user->identityClass, |
|
| 41 | ], |
||
| 42 | ]; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritdoc |
||
| 47 | */ |
||
| 48 | 3 | public function attributeLabels() |
|
| 49 | { |
||
| 50 | 3 | return array_merge([ |
|
| 51 | 3 | 'process_id' => 'Process ID', |
|
| 52 | 'user_id' => 'User ID', |
||
| 53 | 3 | ], parent::attributeLabels()); |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @inheritdoc |
||
| 58 | */ |
||
| 59 | 5 | public function init() |
|
| 60 | { |
||
| 61 | 5 | if (!is_subclass_of($this->processClass(), Process::class)) { |
|
| 62 | throw new InvalidConfigException( |
||
|
|
|||
| 63 | static::class . '::processClass() must extend ' |
||
| 64 | . Process::class |
||
| 65 | ); |
||
| 66 | } |
||
| 67 | 5 | parent::init(); |
|
| 68 | 5 | } |
|
| 69 | |||
| 70 | /** |
||
| 71 | * @return ActiveQuery |
||
| 72 | */ |
||
| 73 | 5 | public function getProcess(): ActiveQuery |
|
| 76 | } |
||
| 77 | } |
||
| 78 |
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