Skip to content

Commit 07a370b

Browse files
Added Support for php8.4 and php8.5
1 parent 9c64ad5 commit 07a370b

79 files changed

Lines changed: 191 additions & 132 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/php-test-workflow.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ jobs:
1919
dependencies-preference: " "
2020
- php: '8.3'
2121
dependencies-preference: "--prefer-lowest"
22+
- php: '8.4'
23+
dependencies-preference: " "
24+
- php: '8.4'
25+
dependencies-preference: "--prefer-lowest"
26+
- php: '8.5'
27+
dependencies-preference: " "
28+
- php: '8.5'
29+
dependencies-preference: "--prefer-lowest"
2230
fail-fast: false
2331
steps:
2432
- uses: actions/checkout@v4

composer.json

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"homepage": "http://github.com/apigee/apigee-client-php",
1414
"license": "Apache-2.0",
1515
"require": {
16-
"php": "~8.2 || ~8.3",
16+
"php": "~8.2 || ~8.3 || ~8.4 || ~8.5",
1717
"ext-json": "*",
1818
"ext-openssl": "*",
1919
"ext-reflection": "*",
@@ -28,14 +28,15 @@
2828
"php-http/message-factory": "^1.0",
2929
"phpdocumentor/reflection-docblock": "^5.0",
3030
"psr/http-message": "^1.0 || ^2.0",
31-
"symfony/options-resolver": "^7.4.0",
32-
"symfony/property-access": "^7.4.4",
33-
"symfony/property-info": "^7.4.0",
34-
"symfony/serializer": "^7.3.0"
31+
"symfony/options-resolver": "^7.4.8",
32+
"symfony/property-access": "^7.4.8",
33+
"symfony/property-info": "^7.4.8",
34+
"symfony/serializer": "^7.4.8",
35+
"guzzlehttp/promises": "^2.0.3"
3536
},
3637
"require-dev": {
3738
"dms/phpunit-arraysubset-asserts": "^0.4.0",
38-
"friendsofphp/php-cs-fixer": "^3.68",
39+
"friendsofphp/php-cs-fixer": "^3.80",
3940
"fzaninotto/faker": "^1.7",
4041
"guzzlehttp/psr7": "^2.5",
4142
"league/flysystem": "^1.0",
@@ -46,10 +47,27 @@
4647
"phpmetrics/phpmetrics": "^2.7",
4748
"phpunit/phpunit": "^9.6",
4849
"sebastian/comparator": "^4.0.5",
49-
"symfony/cache": "^7.3.0",
50-
"symfony/type-info": "^7.3.0",
51-
"symfony/var-exporter": "^7.3.0",
52-
"vimeo/psalm": "^5.20"
50+
"symfony/cache": "^7.4.8",
51+
"symfony/type-info": "^7.4.8",
52+
"symfony/var-exporter": "^7.4.8",
53+
"vimeo/psalm": "^6.14.0",
54+
"amphp/amp": "^3.1.1",
55+
"amphp/byte-stream": "^2.1.2",
56+
"amphp/cache": "^2.0.1",
57+
"amphp/dns": "^2.4.1",
58+
"amphp/parallel": "^2.3.3",
59+
"amphp/parser": "^1.1.1",
60+
"amphp/socket": "^2.4.0",
61+
"daverandom/libdns": "^2.1.0",
62+
"symfony/console": "^6.4.36 || ^7.0",
63+
"spatie/array-to-xml": "^3.4.4",
64+
"nikic/php-parser": "^5.7.0",
65+
"amphp/pipeline": "^1.2.3",
66+
"amphp/process": "^2.0.3",
67+
"amphp/serialization": "^1.1.0",
68+
"amphp/sync": "^2.0",
69+
"revolt/event-loop": "^1.1.0",
70+
"symfony/filesystem": "^7.4.8"
5371
},
5472
"autoload": {
5573
"psr-4": {

phpunit.xml.dist

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!--
43
~ Copyright 2018 Google LLC
54
~
@@ -15,17 +14,15 @@
1514
~ See the License for the specific language governing permissions and
1615
~ limitations under the License.
1716
-->
18-
19-
<phpunit
20-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.4/phpunit.xsd"
22-
colors="true"
23-
bootstrap="./vendor/autoload.php"
24-
printerClass="LimeDeck\Testing\Printer"
25-
verbose="true">
26-
<php>
27-
<!-- Apigee Edge credentials - uncomment and change these lines to change to an online test. -->
28-
<!--
17+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" colors="true" bootstrap="./vendor/autoload.php" printerClass="LimeDeck\Testing\Printer" verbose="true">
18+
<coverage>
19+
<include>
20+
<directory suffix=".php">./src</directory>
21+
</include>
22+
</coverage>
23+
<php>
24+
<!-- Apigee Edge credentials - uncomment and change these lines to change to an online test. -->
25+
<!--
2926
<env name="APIGEE_EDGE_PHP_CLIENT_API_CLIENT" value="\Apigee\Edge\Tests\Test\Client"/>
3027
<env name="APIGEE_EDGE_PHP_CLIENT_HTTP_CLIENT" value="\Http\Adapter\Guzzle6\Client"/>
3128
<env name="APIGEE_EDGE_PHP_CLIENT_ORGANIZATION" value="myorg"/>
@@ -34,15 +31,10 @@
3431
<env name="APIGEE_EDGE_PHP_CLIENT_ENVIRONMENT" value="prod"/>
3532
<env name="APIGEE_EDGE_ENDPOINT" value="https://api.enterprise.apigee.com/v1"/>
3633
-->
37-
</php>
38-
<testsuites>
39-
<testsuite name="All Apigee Edge PHP API Client Tests">
40-
<directory>tests/</directory>
41-
</testsuite>
42-
</testsuites>
43-
<filter>
44-
<whitelist>
45-
<directory suffix=".php">./src</directory>
46-
</whitelist>
47-
</filter>
34+
</php>
35+
<testsuites>
36+
<testsuite name="All Apigee Edge PHP API Client Tests">
37+
<directory>tests/</directory>
38+
</testsuite>
39+
</testsuites>
4840
</phpunit>

psalm.xml.dist

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
allowStringToStandInForClass="true"
88
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xmlns="https://getpsalm.org/schema/config"
10-
xsi:schemaLocation="https://getpsalm.org/schema/config file:///var/www/html/vendor/vimeo/psalm/config.xsd"
10+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
1111
>
1212
<projectFiles>
1313
<directory name="src" />
@@ -54,6 +54,19 @@
5454
<DeprecatedInterface errorLevel="info" />
5555

5656
<RiskyTruthyFalsyComparison errorLevel="info" />
57+
58+
<ClassMustBeFinal errorLevel="info" />
59+
<MissingOverrideAttribute errorLevel="info" />
60+
<PossiblyUnusedMethod errorLevel="info" />
61+
<PossiblyUnusedReturnValue errorLevel="info" />
62+
<PossiblyUnusedParam errorLevel="info" />
63+
<UnusedProperty errorLevel="info" />
64+
<UnusedClass errorLevel="info" />
65+
<UnusedVariable errorLevel="info" />
66+
<UnusedDocblockParam errorLevel="info" />
67+
<UnnecessaryVarAnnotation errorLevel="info" />
68+
<PossiblyUnusedProperty errorLevel="info" />
69+
<UnusedParam errorLevel="info" />
5770

5871
</issueHandlers>
5972
</psalm>

src/Api/ApigeeX/Controller/AcceptedRatePlanController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function acceptRatePlan(RatePlanInterface $ratePlan): AcceptedRatePlanInt
8989

9090
$tmp = json_decode($payload, true);
9191

92-
$payload = json_encode($tmp);
92+
$payload = (string) json_encode($tmp);
9393

9494
$response = $this->client->post($this->getBaseEndpointUri(), $payload);
9595
$this->getEntitySerializer()->setPropertiesFromResponse($response, $acceptedRatePlan);

src/Api/ApigeeX/Controller/ApiProductController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private function getEligibleProducts(string $type, string $entityId): array
134134
}
135135
}
136136

137-
$current_ms = substr((string) (microtime(true) * 1000), 0);
137+
$current_ms = substr((string) (microtime(true) * 1000.0), 0);
138138

139139
foreach ($this->getAvailablexApiProducts($type, $entityId, true) as $item) {
140140
// Create a new rate plan controller.

src/Api/ApigeeX/Controller/RatePlanController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function getEntities(?bool $showCurrentOnly = null, ?bool $showPrivate =
9292
public function createNewRevision(RatePlanRevisionInterface $entity): void
9393
{
9494
$payload = $this->getEntitySerializer()->serialize($entity, 'json');
95-
$response = $this->getClient()->post($this->getEntityEndpointUri($entity->getPreviousRatePlanRevision()->id()) . '/revision', $payload);
95+
$response = $this->getClient()->post((string) $this->getEntityEndpointUri($entity->getPreviousRatePlanRevision()->id()) . '/revision', $payload);
9696
$this->getEntitySerializer()->setPropertiesFromResponse($response, $entity);
9797
}
9898

src/Api/ApigeeX/Denormalizer/AcceptedRatePlanDenormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
5050
return false;
5151
}
5252

53-
return AcceptedRatePlanInterface::class === $type || $type instanceof AcceptedRatePlanInterface || in_array(AcceptedRatePlanInterface::class, class_implements($type));
53+
return AcceptedRatePlanInterface::class === $type || $type instanceof AcceptedRatePlanInterface || in_array(AcceptedRatePlanInterface::class, class_implements($type) ?: []);
5454
}
5555
}

src/Api/ApigeeX/Denormalizer/ApiProductDenormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ public function supportsDenormalization($data, $type, $format = null, array $con
5252
return false;
5353
}
5454

55-
return ApiProductInterface::class === $type || $type instanceof ApiProductInterface || in_array(ApiProductInterface::class, class_implements($type));
55+
return ApiProductInterface::class === $type || $type instanceof ApiProductInterface || in_array(ApiProductInterface::class, class_implements($type) ?: []);
5656
}
5757
}

src/Api/ApigeeX/Denormalizer/AppDenormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function supportsDenormalization($data, $type, $format = null, array $con
6868
return false;
6969
}
7070

71-
return AppInterface::class === $type || $type instanceof AppInterface || in_array(AppInterface::class, class_implements($type));
71+
return AppInterface::class === $type || $type instanceof AppInterface || in_array(AppInterface::class, class_implements($type) ?: []);
7272
}
7373

7474
/**

0 commit comments

Comments
 (0)