| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class MissingTraitOnModel extends InvalidConfig implements ProvidesSolution |
||
| 10 | { |
||
| 11 | /** @var string */ |
||
| 12 | protected $modelClass; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | protected $trait; |
||
| 16 | |||
| 17 | public static function make(string $modelClass, string $trait): self |
||
| 18 | { |
||
| 19 | return (new static("The method `resolveTransition` was not found on model `{$modelClass}`, are you sure it uses the `{$trait} trait?`")) |
||
| 20 | ->setModelClass($modelClass) |
||
| 21 | ->setTrait($trait); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function setModelClass(string $modelClass): self |
||
| 29 | } |
||
| 30 | |||
| 31 | public function setTrait(string $trait): self |
||
| 32 | { |
||
| 33 | $this->trait = $trait; |
||
| 34 | |||
| 35 | return $this; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function getSolution(): Solution |
||
| 44 | ]); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |