Test Failed
Push — ft/states ( eebc9c )
by Ben
29:42 queued 08:49
created

ArchivePage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 7 1
1
<?php
2
3
namespace Thinktomorrow\Chief\States\Application;
4
5
use Thinktomorrow\Chief\States\PageState;
6
use Thinktomorrow\Chief\States\Archivable\ArchivableContract;
7
8
class ArchivePage
9
{
10
    public function handle(ArchivableContract $page)
11
    {
12
        (new PageState($page))->apply('archive');
13
14
        $page->save();
0 ignored issues
show
Bug introduced by
The method save() does not exist on Thinktomorrow\Chief\Stat...able\ArchivableContract. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        $page->/** @scrutinizer ignore-call */ 
15
               save();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
15
16
        event(new PageArchived($page->id));
0 ignored issues
show
Bug introduced by
Accessing id on the interface Thinktomorrow\Chief\Stat...able\ArchivableContract suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
Bug introduced by
The type Thinktomorrow\Chief\Stat...pplication\PageArchived 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...
17
    }
18
}
19