Skip to content

Commit e58b451

Browse files
authored
Merge pull request #9 from answear/support-symfony-7
Support symfony 7
2 parents 8074913 + c1b72f9 commit e58b451

26 files changed

+182
-476
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,10 @@ jobs:
1111
strategy:
1212
matrix:
1313
php-version:
14-
- "7.4"
15-
- "8.0"
16-
- "8.1"
14+
- "8.2"
1715
deps:
1816
- "normal"
19-
include:
20-
- deps: "low"
21-
php-version: "7.4"
17+
- "low"
2218

2319
steps:
2420
- name: "Checkout"

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
php-version:
14-
- "7.4"
15-
- "8.0"
16-
- "8.1"
14+
- "8.2"
1715

1816
steps:
1917
- name: "Checkout"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
\.php_cs\.cache
33
.phpunit.result.cache
44
composer.lock
5+
/.idea
6+
/.phpunit.cache
7+
/.php-cs-fixer.cache
8+

.php-cs-fixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'strict_param' => false,
2121
'array_syntax' => ['syntax' => 'short'],
2222
'concat_space' => ['spacing' => 'one'],
23-
'phpdoc_align' => [],
23+
'phpdoc_align' => ['align' => 'left'],
2424
'phpdoc_summary' => false,
2525
'void_return' => false,
2626
'phpdoc_var_without_name' => false,
@@ -37,4 +37,4 @@
3737
'sort_algorithm' => 'alpha',
3838
],
3939
]
40-
);
40+
);

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
public function pickupPoints(): void
4444
{
4545
/** @var SearchDivisionsResponse $response */
46-
$response = $this->meestClient->request(new SearchDivisions(DivisionTypeEnum::novaPoshtaPoint()));
46+
$response = $this->meestClient->request(new SearchDivisions(DivisionTypeEnum::NovaPoshtaPoint));
4747

4848
/** @var DivisionDTO $division */
4949
foreach ($response->return as $division) {

composer.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44
"type": "symfony-bundle",
55
"license": "MIT",
66
"require": {
7-
"php": ">=7.4|^8.0",
7+
"php": "^8.2",
88
"ext-soap": "*",
9-
"marc-mabe/php-enum": "^3.0|^4.0",
10-
"symfony/http-kernel": "^5.4|^6.0",
11-
"webmozart/assert": "^1.3"
9+
"symfony/http-kernel": "^6.0|^7.0",
10+
"webmozart/assert": "^1.11"
1211
},
1312
"require-dev": {
1413
"roave/security-advisories": "dev-master",
15-
"phpunit/phpunit": "^9.5",
16-
"symfony/phpunit-bridge": "6.1.*",
17-
"phpro/grumphp": "^1.5.0",
18-
"friendsofphp/php-cs-fixer": "^3.4",
19-
"phpstan/phpstan": "^1.4",
20-
"phpstan/phpstan-webmozart-assert": "^1.0"
14+
"phpunit/phpunit": "^10.5",
15+
"symfony/phpunit-bridge": "6.1.*|^7.0",
16+
"phpro/grumphp": "^2.8",
17+
"friendsofphp/php-cs-fixer": "^3.64",
18+
"phpstan/phpstan": "^1.12",
19+
"phpstan/phpstan-webmozart-assert": "^1.2"
2120
},
2221
"autoload": {
2322
"psr-4": {

phpunit.xml.dist

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
bootstrap="./vendor/autoload.php"
55
backupGlobals="false"
6-
beStrictAboutCoversAnnotation="true"
76
beStrictAboutOutputDuringTests="true"
87
beStrictAboutTestsThatDoNotTestAnything="true"
9-
beStrictAboutTodoAnnotatedTests="true"
108
colors="true"
11-
convertErrorsToExceptions="true"
12-
convertNoticesToExceptions="true"
13-
convertWarningsToExceptions="true"
14-
verbose="true"
9+
cacheDirectory=".phpunit.cache"
10+
beStrictAboutCoverageMetadata="true"
1511
>
1612
<php>
1713
<ini name="error_reporting" value="-1"/>
1814
</php>
19-
2015
<testsuites>
2116
<testsuite name="Answear Meest Test Suite">
2217
<directory>./tests</directory>
2318
</testsuite>
2419
</testsuites>
25-
26-
<listeners>
27-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
28-
</listeners>
2920
</phpunit>

src/Enum/DivisionTypeEnum.php

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,12 @@
44

55
namespace Answear\MeestBundle\Enum;
66

7-
use MabeEnum\Enum;
8-
9-
class DivisionTypeEnum extends Enum
7+
enum DivisionTypeEnum: string
108
{
11-
public const DIVISION_MEEST_EXPRESS = 'DIVISION';
12-
public const COLLECTION_POINT = 'DIVISION_PICKPOINT';
13-
public const PARCEL_LOCKER = 'POSTSTATION';
14-
public const NOVA_POSHTA_POINT = 'MEEST_PARTNER_PICKUP_POINT_NP';
15-
public const UKR_POSHTA_POINT = 'MEEST_PARTNER_PICKUP_POINT_UP';
16-
public const MEEST_PARTNER_PICKUP_POINT = 'MEEST_PARTNER_PICKUP_POINT';
17-
18-
public static function divisionMeestExpress(): self
19-
{
20-
return static::get(static::DIVISION_MEEST_EXPRESS);
21-
}
22-
23-
public static function collectionPoint(): self
24-
{
25-
return static::get(static::COLLECTION_POINT);
26-
}
27-
28-
public static function parcelLocker(): self
29-
{
30-
return static::get(static::PARCEL_LOCKER);
31-
}
32-
33-
public static function novaPoshtaPoint(): self
34-
{
35-
return static::get(static::NOVA_POSHTA_POINT);
36-
}
37-
38-
public static function ukrPoshtaPoint(): self
39-
{
40-
return static::get(static::UKR_POSHTA_POINT);
41-
}
42-
43-
public static function meestPartnerPickupPoint(): self
44-
{
45-
return static::get(static::MEEST_PARTNER_PICKUP_POINT);
46-
}
9+
case DivisionMeestExpress = 'DIVISION';
10+
case CollectionPoint = 'DIVISION_PICKPOINT';
11+
case ParcelLocker = 'POSTSTATION';
12+
case NovaPoshtaPoint = 'MEEST_PARTNER_PICKUP_POINT_NP';
13+
case UkrPoshtaPoint = 'MEEST_PARTNER_PICKUP_POINT_UP';
14+
case MeestPartnerPickupPoint = 'MEEST_PARTNER_PICKUP_POINT';
4715
}

src/Enum/RequestEnum.php

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,11 @@
44

55
namespace Answear\MeestBundle\Enum;
66

7-
use MabeEnum\Enum;
8-
9-
class RequestEnum extends Enum
7+
enum RequestEnum: string
108
{
11-
public const SEARCH_DIVISIONS = 'searchDivisions';
12-
13-
public const GET_API_VERSION = 'getApiVersion';
14-
15-
public const SEARCH_CITY_BY_POST_CODE = 'searchCityByPostCode';
16-
17-
public const SEARCH_CITY = 'searchCity';
18-
19-
public const SEARCH_STREET_BY_NAME_AND_CITY_ID_REF = 'searchStreetByNameAndCityIdRef';
20-
21-
public static function searchDivisions(): self
22-
{
23-
return static::get(static::SEARCH_DIVISIONS);
24-
}
25-
26-
public static function getApiVersion(): self
27-
{
28-
return static::get(static::GET_API_VERSION);
29-
}
30-
31-
public static function searchCityByPostCode(): self
32-
{
33-
return static::get(static::SEARCH_CITY_BY_POST_CODE);
34-
}
35-
36-
public static function searchCity(): self
37-
{
38-
return static::get(static::SEARCH_CITY);
39-
}
40-
41-
public static function searchStreetByNameAndCityIdRef(): self
42-
{
43-
return static::get(static::SEARCH_STREET_BY_NAME_AND_CITY_ID_REF);
44-
}
9+
case SearchDivisions = 'searchDivisions';
10+
case GetApiVersion = 'getApiVersion';
11+
case SearchCityByPostCode = 'searchCityByPostCode';
12+
case SearchCity = 'searchCity';
13+
case SearchStreetByNameAndCityIdRef = 'searchStreetByNameAndCityIdRef';
4514
}

src/Enum/ResponseEnum.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,12 @@
77
class ResponseEnum
88
{
99
public const SEARCH_DIVISIONS = 'searchDivisionsResponse';
10-
1110
public const GET_API_VERSION = 'getApiVersionResponse';
12-
1311
public const SEARCH_CITY_BY_POST_CODE = 'searchCityByPostCodeResponse';
14-
1512
public const SEARCH_CITY = 'searchCityResponse';
16-
1713
public const SEARCH_STREET_BY_NAME_AND_CITY_ID_REF = 'searchStreetByNameAndCityIdRefResponse';
18-
1914
// inner DTOs
2015
public const DIVISION_DTO = 'divisionApiBean';
21-
2216
public const CITY_DTO = 'cityApiBean';
23-
2417
public const STREET_DTO = 'streetApiBean';
2518
}

0 commit comments

Comments
 (0)