Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining PHP 8.1 as base version #79

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ jobs:
strategy:
matrix:
php-version:
- "8.3"
- "8.2"
- "8.1"
- "8.0"
- "7.4"

steps:
- uses: actions/checkout@v4
Expand All @@ -29,6 +28,7 @@ jobs:
SPEC=swagger php -S 127.0.0.1:8080 tests/rest/app.php &
SPEC=openapi php -S 127.0.0.1:8081 tests/rest/app.php &
- run: ./vendor/bin/phpunit
- run: ./vendor/bin/psalm

Documentation:
if: github.ref == 'refs/heads/master'
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/runConfigurations/Psalm.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"prefer-stable": true,
"license": "MIT",
"require": {
"byjg/webrequest": "4.9.*",
"php": ">=7.4",
"ext-json": "*"
"php": ">=8.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constraint also allows version 8.4, but this version of PHP is not covered by the GitHub workflow.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to upgrade the project https://github.com/byjg/docker-php to support PHP 8.4 since alpine:edge has the 8.4 beta already :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is different: this packages can be installed with version 8.4 of PHP but it is not tested with that version. This can therefore lead to problems on the user side, as PHP does not follow semantic versioning.
This would help:

"php": "~8.1.0 || ~8.2.0 || ~8.3.0",

https://getcomposer.org/doc/articles/versions.md

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I'll add this.

"ext-json": "*",
"byjg/webrequest": "^5.0"
},
"require-dev": {
"phpunit/phpunit": "5.7.*|7.4.*|^9.5",
"byjg/restserver": "4.9.*"
"phpunit/phpunit": "^9.6",
"byjg/restserver": "^5.0",
"vimeo/psalm": "^5.9"
},
"autoload": {
"psr-4": {
Expand All @@ -20,7 +21,7 @@
},
"autoload-dev": {
"psr-4": {
"Test\\": "tests/"
"Tests\\": "tests/"
}
}
}
6 changes: 3 additions & 3 deletions docs/mock-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class MyTest extends ApiTestCase
{
public function testExpectOK()
{
$expectedResponse = \ByJG\Util\Psr7\Response::getInstance(200)
->withBody(new \ByJG\Util\Psr7\MemoryStream(json_encode([
$expectedResponse = \ByJG\WebRequest\Psr7\Response::getInstance(200)
->withBody(new \ByJG\WebRequest\Psr7\MemoryStream(json_encode([
"id" => 1,
"name" => "Spike",
"photoUrls" => []
Expand All @@ -39,7 +39,7 @@ e.g.
```php
<?php

$psr7Request = \ByJG\Util\Psr7\Request::getInstance(new Uri("/method_to_be_tested?param1=value1"))
$psr7Request = \ByJG\WebRequest\Psr7\Request::getInstance(new Uri("/method_to_be_tested?param1=value1"))
->withMethod("GET")
->withBody('{"foo":"bar"}');

Expand Down
18 changes: 18 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<psalm
errorLevel="4"
resolveFromConfigFile="true"
findUnusedBaselineEntry="true"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
Loading