Skip to content

Commit 224a100

Browse files
committed
Fix phpstan
1 parent 017f539 commit 224a100

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ before_script:
55
- php composer.phar install
66

77
script:
8-
- php vendor/bin/phpunit tests
9-
- php vendor/bin/php-cs-fixer fix --dry-run --config .php_cs.dist -v
10-
- php vendor/bin/phpstan analyse
8+
- php composer.phar test
119

1210
php:
1311
- 7.1

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
}
3131
},
3232
"scripts": {
33-
"lint": "php-cs-fixer fix --verbose --show-progress=estimating",
34-
"lint:check": [
33+
"fixer": "php-cs-fixer fix --verbose --show-progress=estimating",
34+
"fixer:check": [
3535
"php-cs-fixer fix --dry-run --verbose --show-progress=estimating"
3636
],
3737
"phpunit": "phpunit tests",
3838
"phpstan": "phpstan analyse",
3939
"test": [
40-
"@lint:check",
40+
"@fixer:check",
4141
"@phpunit",
4242
"@phpstan"
4343
]

src/Model/Resources.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@
1515

1616
namespace MultiTheftAuto\Sdk\Model;
1717

18+
use MultiTheftAuto\Sdk\Model\Resource as MtaResource;
19+
1820
class Resources
1921
{
2022
/**
21-
* @var Resource[]
23+
* @var MtaResource[]
2224
*/
2325
protected $resources = [];
2426

25-
public function findByName(string $name): ?Resource
27+
public function findByName(string $name): ?MtaResource
2628
{
27-
$found = array_filter($this->resources, function(Resource $resource) use ($name) {
29+
$found = array_filter($this->resources, function(MtaResource $resource) use ($name) {
2830
return $resource->getName() == $name;
2931
});
3032

3133
$resource = current($found);
3234
return $resource? $resource : null;
3335
}
3436

35-
public function add(Resource $resource): void
37+
public function add(MtaResource $resource): void
3638
{
3739
$this->resources[] = $resource;
3840
}

src/Mta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Http\Client\HttpClient;
2020
use Http\Discovery\HttpClientDiscovery;
2121
use Http\Discovery\MessageFactoryDiscovery;
22+
use Http\Message\Authentication\BasicAuth;
2223
use Http\Message\MessageFactory;
2324
use MultiTheftAuto\Sdk\Authentication\Credential;
2425
use MultiTheftAuto\Sdk\Model\Resource;
@@ -28,7 +29,6 @@
2829
use MultiTheftAuto\Sdk\Response\HttpStatusVerification;
2930
use MultiTheftAuto\Sdk\Utils\Input;
3031
use MultiTheftAuto\Sdk\Utils\Translator;
31-
use Http\Message\Authentication\BasicAuth;
3232

3333
class Mta
3434
{

tests/Functional/MtaTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
namespace MultiTheftAuto\Sdk;
66

7+
use Http\Mock\Client;
8+
use MultiTheftAuto\Sdk\Authentication\Credential;
79
use MultiTheftAuto\Sdk\Model\Element;
810
use MultiTheftAuto\Sdk\Model\Resource;
11+
use MultiTheftAuto\Sdk\Model\Server;
912
use PHPUnit\Framework\TestCase;
10-
use Http\Mock\Client;
1113
use Psr\Http\Message\ResponseInterface;
12-
use MultiTheftAuto\Sdk\Model\Server;
13-
use MultiTheftAuto\Sdk\Authentication\Credential;
1414

1515
class MtaTest extends TestCase
1616
{

tests/Unit/TranslatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
namespace MultiTheftAuto\Sdk\Utils;
1717

18-
use PHPUnit\Framework\TestCase;
19-
use MultiTheftAuto\Sdk\Model\Resource;
2018
use MultiTheftAuto\Sdk\Model\Element;
19+
use MultiTheftAuto\Sdk\Model\Resource;
20+
use PHPUnit\Framework\TestCase;
2121

2222
class TranslatorTest extends TestCase
2323
{

0 commit comments

Comments
 (0)