Skip to content

Commit 7ac20ea

Browse files
committed
Fixes after code review
1 parent 072ebfc commit 7ac20ea

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"phpro/grumphp": "^2.11",
1818
"phpstan/phpstan": "^2.1.8",
1919
"phpstan/phpstan-webmozart-assert": "^2.0.0",
20-
"phpunit/phpunit": "^10.5|^11.5|^12.0.7",
20+
"phpunit/phpunit": "^11.5",
2121
"roave/security-advisories": "dev-master",
22-
"symfony/phpunit-bridge": "6.1.*|^7.0"
22+
"symfony/phpunit-bridge": "6.1.*|^7.2"
2323
},
2424
"autoload": {
2525
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
44
bootstrap="./vendor/autoload.php"
55
backupGlobals="false"
66
beStrictAboutOutputDuringTests="true"

src/Client/RequestTransformer.php

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

55
namespace Answear\MwlBundle\Client;
66

7-
use Answear\MwlBundle\ConfigProvider;
87
use Answear\MwlBundle\Request\Request;
98
use GuzzleHttp\Psr7\Request as HttpRequest;
109
use GuzzleHttp\Psr7\Uri;
1110

1211
readonly class RequestTransformer
1312
{
13+
private const SERVICE_URI = '/mwl';
14+
1415
public function __construct(
1516
private Serializer $serializer,
1617
) {
@@ -20,7 +21,7 @@ public function transform(Request $request): HttpRequest
2021
{
2122
return new HttpRequest(
2223
$request->getMethod(),
23-
new Uri(ConfigProvider::SERVICE_URI . $request->getEndpoint()),
24+
new Uri(self::SERVICE_URI . $request->getEndpoint()),
2425
[
2526
'Content-type' => 'application/json',
2627
],

src/ConfigProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
readonly class ConfigProvider
88
{
9-
public const URL = 'https://mwl.meest.com';
10-
public const SERVICE_URI = '/mwl';
9+
private const URL = 'https://mwl.meest.com';
1110

1211
public function __construct(
1312
private string $partnerKey,

tests/Unit/Client/RequestTransformerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Answear\MwlBundle\Client\RequestTransformer;
88
use Answear\MwlBundle\Client\Serializer;
9-
use Answear\MwlBundle\ConfigProvider;
109
use Answear\MwlBundle\Request\GetPickupPointsRequest;
1110
use Answear\MwlBundle\Request\Request;
1211
use PHPUnit\Framework\Attributes\Test;
@@ -45,6 +44,6 @@ public function requestTransformed(): void
4544

4645
private function expectedPath(Request $request): string
4746
{
48-
return ConfigProvider::SERVICE_URI . $request->getEndpoint();
47+
return '/mwl' . $request->getEndpoint();
4948
}
5049
}

tests/Unit/ConfigProviderTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public function gettersAreValid(): void
1515
{
1616
$configuration = new ConfigProvider('test', 'Qwerty123!');
1717

18-
$this->assertSame('https://mwl.meest.com', ConfigProvider::URL);
19-
$this->assertSame('/mwl', ConfigProvider::SERVICE_URI);
2018
$this->assertSame(
2119
[
2220
'base_uri' => 'https://mwl.meest.com',

0 commit comments

Comments
 (0)