Passed
Push — main ( 3cfdb8...a45320 )
by PRATIK
10:34
created

PostStatus   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A statusChanged() 0 7 1
1
<?php
2
3
namespace Adminetic\Website\Http\Livewire\Admin\Post;
4
5
use Livewire\Component;
0 ignored issues
show
Bug introduced by
The type Livewire\Component was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Adminetic\Website\Models\Admin\Post;
7
8
class PostStatus extends Component
9
{
10
    public $post;
11
12
    protected $listeners = ['status_changed' => 'statusChanged'];
13
14
15
    public function statusChanged($status, Post $post)
16
    {
17
        $post->update([
18
            'status' => $status
19
        ]);
20
21
        $this->post = $post;
22
    }
23
24
    public function render()
25
    {
26
        return view('website::livewire.admin.post.post-status');
27
    }
28
}
29