| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ToggleFavoriteContact extends Component |
||
| 9 | { |
||
| 10 | public $contact; |
||
| 11 | |||
| 12 | public $favorite = false; |
||
| 13 | |||
| 14 | protected $listeners = ['favorite_toggle' => 'favoriteToggle']; |
||
| 15 | |||
| 16 | public function mount(Contact $contact) |
||
| 17 | { |
||
| 18 | $this->contact = $contact; |
||
| 19 | $this->favorite = $contact->favorite; |
||
| 20 | } |
||
| 21 | |||
| 22 | |||
| 23 | public function favoriteToggle($id) |
||
| 24 | { |
||
| 25 | $contact = Contact::find($id); |
||
| 26 | if (isset($contact)) { |
||
| 27 | $contact->update([ |
||
| 28 | 'favorite' => !$contact->favorite |
||
| 29 | ]); |
||
| 30 | |||
| 31 | $this->favorite = $contact->favorite; |
||
| 32 | |||
| 33 | $this->contact = $contact; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | public function render() |
||
| 40 | } |
||
| 41 | } |
||
| 42 |
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