Completed
Push — master ( fedd40...a15cc2 )
by
unknown
9s
created

tests/Integration/API/VirtualCurrencyTest.php (2 issues)

Labels

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Xsolla\SDK\Tests\Integration\API;
4
5
/**
6
 * @group api
7
 */
8
class VirtualCurrencyTest extends AbstractAPITest
9
{
10
    public function testUpdateProjectVirtualCurrencySettings()
11
    {
12
        $response = static::$xsollaClient->UpdateProjectVirtualCurrencySettings([
0 ignored issues
show
Are you sure the assignment to $response is correct as static::$xsollaClient->U...=> static::$projectId)) (which targets Xsolla\SDK\API\XsollaCli...rtualCurrencySettings()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
13
            'request' => [
14
                'vc_name' => [
15
                    'en' => 'name',
16
                ],
17
                'base' => [
18
                    'USD' => 0.9,
19
                ],
20
                'min' => 0.01,
21
                'max' => 100.2,
22
                'default_currency' => 'USD',
23
            ],
24
            'project_id' => static::$projectId,
25
        ]);
26
        static::assertSame(204, $response->getStatusCode());
0 ignored issues
show
The method getStatusCode cannot be called on $response (of type null).

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...
27
    }
28
29
    public function testGetProjectVirtualCurrencySettings()
30
    {
31
        $response = static::$xsollaClient->GetProjectVirtualCurrencySettings(['project_id' => static::$projectId]);
32
        static::assertInternalType('array', $response);
33
    }
34
}
35