Test Setup Failed
Push — master ( 84d668...ef9790 )
by Sergio
03:52
created

ServerType::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 2
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: sergio.rodenas
5
 * Date: 12/08/2018
6
 * Time: 17:28
7
 */
8
9
namespace Whisper\HetznerCloud\Clients;
10
11
12
use LaravelWhisper\Whisper\ClientInterface;
13
14
class ServerType implements ClientInterface
15
{
16
	public static $uri = 'server_types';
17
18
	public static function all(): array
19
	{
20
		return HetznerCloud::get(static::$uri)['server_types'];
0 ignored issues
show
Bug introduced by
The method get() does not exist on Whisper\HetznerCloud\Clients\HetznerCloud. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

20
		return HetznerCloud::/** @scrutinizer ignore-call */ get(static::$uri)['server_types'];
Loading history...
21
	}
22
23
	public static function find($identifier): array
24
	{
25
		return HetznerCloud::get(static::$uri.'/'.$identifier)['server_type'];
26
	}
27
28
	public static function create(array $data): array{}
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return array. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
29
	public static function update($identifier, array $data): void{}
30
	public static function delete($identifier): ?bool{}
31
}