Completed
Push — master ( c7652d...e90b5e )
by
unknown
02:21 queued 10s
created

ItemTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A it_gets_items_for_an_by_user_id() 0 10 1
1
<?php
2
3
require_once 'BaseTester.php';
4
5
/** @group Item */
6
class ItemTest extends BaseTester
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
7
{
8
    /** @test */
9
    public function it_gets_items_for_an_by_user_id()
10
    {
11
        $items = $this->steamClient->item()->GetPlayerItems($this->itemid, $this->id64);
0 ignored issues
show
Bug introduced by
The call to item() misses a required argument $appId.

This check looks for function calls that miss required arguments.

Loading history...
12
13
        $this->assertCount(1, $items);
0 ignored issues
show
Documentation introduced by
$items is of type null|array, but the function expects a object<Countable>|object...nit\Framework\iterable>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
14
15
        $item = $items->first();
0 ignored issues
show
Bug introduced by
The method first cannot be called on $items (of type null|array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
16
17
        $this->checkItemProperties($item);
0 ignored issues
show
Bug introduced by
The method checkItemProperties() cannot be called from this context as it is declared private in class BaseTester.

This check looks for access to methods that are not accessible from the current context.

If you need to make a method accessible to another context you can raise its visibility level in the defining class.

Loading history...
18
    }
19
}
20