1 | <?php |
||||||
2 | |||||||
3 | namespace OhDear\PhpSdk\Actions; |
||||||
4 | |||||||
5 | use OhDear\PhpSdk\Resources\Site; |
||||||
6 | |||||||
7 | trait ManagesSites |
||||||
8 | { |
||||||
9 | public function sites(): array |
||||||
10 | { |
||||||
11 | return $this->transformCollection( |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
12 | $this->get('sites')['data'], |
||||||
0 ignored issues
–
show
It seems like
get() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
13 | Site::class, |
||||||
14 | ); |
||||||
15 | } |
||||||
16 | |||||||
17 | public function site(int $siteId): Site |
||||||
18 | { |
||||||
19 | $siteAttributes = $this->get("sites/{$siteId}"); |
||||||
20 | |||||||
21 | return new Site($siteAttributes, $this); |
||||||
22 | } |
||||||
23 | |||||||
24 | public function siteByUrl(string $siteUrl): Site |
||||||
25 | { |
||||||
26 | $siteAttributes = $this->get("sites/url/{$siteUrl}"); |
||||||
27 | |||||||
28 | return new Site($siteAttributes, $this); |
||||||
29 | } |
||||||
30 | |||||||
31 | public function createSite(array $data): Site |
||||||
32 | { |
||||||
33 | $siteAttributes = $this->post('sites', $data); |
||||||
0 ignored issues
–
show
It seems like
post() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
34 | |||||||
35 | return new Site($siteAttributes, $this); |
||||||
36 | } |
||||||
37 | |||||||
38 | public function deleteSite(int $siteId) |
||||||
39 | { |
||||||
40 | $this->delete("sites/$siteId"); |
||||||
0 ignored issues
–
show
The method
delete() does not exist on OhDear\PhpSdk\Actions\ManagesSites . Did you maybe mean deleteSite() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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. ![]() |
|||||||
41 | } |
||||||
42 | } |
||||||
43 |