Skip to content

Commit 9215d3a

Browse files
committed
Support Symfony6
1 parent d4198b8 commit 9215d3a

File tree

13 files changed

+110
-62
lines changed

13 files changed

+110
-62
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
matrix:
1313
php-version:
1414
- "7.4"
15+
- "8.0"
16+
- "8.1"
1517
deps:
1618
- "normal"
1719
include:

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
matrix:
1313
php-version:
1414
- "7.4"
15+
- "8.0"
16+
- "8.1"
1517

1618
steps:
1719
- name: "Checkout"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/vendor/
2-
\.php_cs\.cache
2+
*.cache
33
.phpunit.result.cache
44
composer.lock
55
/.idea

.php_cs renamed to .php-cs-fixer.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
3+
declare(strict_types=1);
4+
5+
$config = new PhpCsFixer\Config();
6+
7+
$finder = $config->getFinder()
48
->exclude(
59
[
610
'vendor',
711
]
812
)
913
->in(__DIR__);
1014

11-
return PhpCsFixer\Config::create()
15+
return $config
16+
->registerCustomFixers([])
1217
->setRules(
1318
[
1419
'@Symfony' => true,
@@ -21,6 +26,15 @@
2126
'phpdoc_var_without_name' => false,
2227
'phpdoc_to_comment' => false,
2328
'single_line_throw' => false,
29+
'modernize_types_casting' => true,
30+
'function_declaration' => false,
31+
'ordered_imports' => [
32+
'imports_order' => [
33+
'class',
34+
'function',
35+
'const',
36+
],
37+
'sort_algorithm' => 'alpha',
38+
],
2439
]
25-
)
26-
->setFinder($finder);
40+
);

composer.json

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
{
2-
"name": "answear/speedy-pickup-point-bundle",
3-
"description": "API Client for Speedy.bg.",
4-
"type": "symfony-bundle",
5-
"license": "MIT",
6-
"require": {
7-
"php": ">=7.4",
8-
"ext-json": "*",
9-
"guzzlehttp/guzzle": "^6.0",
10-
"marc-mabe/php-enum": "^3.0|^4.3",
11-
"symfony/http-kernel": "^4.4|^5.0",
12-
"symfony/serializer": "^4.4|^5.0",
13-
"webmozart/assert": "^1.3"
14-
},
15-
"require-dev": {
16-
"friendsofphp/php-cs-fixer": "^2.16",
17-
"phpro/grumphp": "^1.3.0",
18-
"phpstan/phpstan": "^0.12.32",
19-
"phpstan/phpstan-webmozart-assert": "^0.12.2",
20-
"phpunit/phpunit": "^8.4",
21-
"roave/security-advisories": "dev-master",
22-
"symfony/phpunit-bridge": "^5.0"
23-
},
24-
"autoload": {
25-
"psr-4": {
26-
"Answear\\SpeedyBundle\\": "src/"
2+
"name": "answear/speedy-pickup-point-bundle",
3+
"description": "API Client for Speedy.bg.",
4+
"type": "symfony-bundle",
5+
"license": "MIT",
6+
"require": {
7+
"php": ">=7.4|^8.0",
8+
"ext-json": "*",
9+
"guzzlehttp/guzzle": "^6.0|^7.0",
10+
"marc-mabe/php-enum": "^3.0|^4.3",
11+
"symfony/http-kernel": "^5.4|^6.0",
12+
"symfony/serializer": "^5.4|^6.0",
13+
"webmozart/assert": "^1.3"
14+
},
15+
"require-dev": {
16+
"friendsofphp/php-cs-fixer": "^3.4",
17+
"phpro/grumphp": "^1.5.0",
18+
"phpstan/phpstan": "^1.4",
19+
"phpstan/phpstan-webmozart-assert": "^1.0",
20+
"phpunit/phpunit": "^9.5",
21+
"roave/security-advisories": "dev-master",
22+
"symfony/phpunit-bridge": "6.1.*"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Answear\\SpeedyBundle\\": "src/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Answear\\SpeedyBundle\\Tests\\": "tests/"
32+
}
33+
},
34+
"scripts": {
35+
"post-install-cmd": [
36+
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
37+
],
38+
"post-update-cmd": [
39+
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
40+
]
41+
},
42+
"extra": {
43+
"grumphp": {
44+
"config-default-path": "grumphp.yaml"
45+
}
46+
},
47+
"config": {
48+
"sort-packages": true,
49+
"allow-plugins": {
50+
"phpro/grumphp": true
51+
}
2752
}
28-
},
29-
"autoload-dev": {
30-
"psr-4": {
31-
"Answear\\SpeedyBundle\\Tests\\": "tests/"
32-
}
33-
},
34-
"scripts": {
35-
"post-install-cmd": [
36-
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
37-
],
38-
"post-update-cmd": [
39-
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
40-
]
41-
},
42-
"extra": {
43-
"grumphp": {
44-
"config-default-path": "grumphp.yaml"
45-
}
46-
},
47-
"config": {
48-
"sort-packages": true
49-
}
5053
}

grumphp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ grumphp:
1818
phpcsfixer:
1919
allow_risky: true
2020
cache_file: ~
21-
config: './.php_cs'
21+
config: './.php-cs-fixer.php'
2222
using_cache: true
2323
verbose: true
2424
phpstan:

phpstan-baseline.neon

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Property Answear\\\\SpeedyBundle\\\\Client\\\\Client\\:\\:\\$configuration is never read, only written\\.$#"
5+
count: 1
6+
path: src/Client/Client.php
7+
8+
-
9+
message: "#^Property Answear\\\\SpeedyBundle\\\\Request\\\\FindOfficeRequest\\:\\:\\$countryId is never read, only written\\.$#"
10+
count: 1
11+
path: src/Request/FindOfficeRequest.php
12+
13+
-
14+
message: "#^Property Answear\\\\SpeedyBundle\\\\Request\\\\FindOfficeRequest\\:\\:\\$limit is never read, only written\\.$#"
15+
count: 1
16+
path: src/Request/FindOfficeRequest.php
17+
18+
-
19+
message: "#^Property Answear\\\\SpeedyBundle\\\\Request\\\\FindOfficeRequest\\:\\:\\$name is never read, only written\\.$#"
20+
count: 1
21+
path: src/Request/FindOfficeRequest.php
22+
23+
-
24+
message: "#^Property Answear\\\\SpeedyBundle\\\\Request\\\\FindOfficeRequest\\:\\:\\$siteId is never read, only written\\.$#"
25+
count: 1
26+
path: src/Request/FindOfficeRequest.php

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
includes:
22
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
3+
- phpstan-baseline.neon
34

45
parameters:
56
level: 5

src/Client/Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function serialize(Request $request): string
1919
{
2020
return $this->getSerializer()->serialize(
2121
$request,
22-
static::FORMAT,
22+
self::FORMAT,
2323
[Normalizer\AbstractObjectNormalizer::SKIP_NULL_VALUES => true]
2424
);
2525
}

src/ConfigProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public function __construct(string $username, string $password, string $language
2424

2525
public function getUrl(): string
2626
{
27-
return static::URL;
27+
return self::URL;
2828
}
2929

3030
public function getApiVersion(): string
3131
{
32-
return static::API_VERSION;
32+
return self::API_VERSION;
3333
}
3434

3535
public function getUsername(): string

0 commit comments

Comments
 (0)