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

EWPP-4991: Ensure PHP8.3 compatibility. #85

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
44 changes: 32 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,54 @@
name: ci
on: [push, pull_request]

jobs:
automated-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ["8.1", "8.2"]
composer_command: ["composer install", "composer update --prefer-lowest"]
php_version: ["8.1", "8.3"]
composer_command: ["composer install"]
env:
PHP_VERSION: ${{ matrix.php_version }}
steps:
- name: clone
- name: Clone repository
uses: actions/checkout@v2
- run: docker-compose up -d
- name: build

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Start services with Docker Compose
run: docker-compose up -d

- name: Build dependencies
run: docker-compose exec -T php ${{ matrix.composer_command }}
- name: test

- name: Run tests
run: docker-compose exec -T php ./vendor/bin/phpunit

code-sniffer:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ["8.1", "8.2"]
php_version: ["8.1", "8.3"]
Copy link
Member

Choose a reason for hiding this comment

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

Why 8.2 is dropped?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is irrelevant to test if we support both 8.1 and 8.3.

env:
PHP_VERSION: ${{ matrix.php_version }}
steps:
- name: clone
- name: Clone repository
uses: actions/checkout@v2
- run: docker-compose up -d
- name: build

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose

- name: Start services with Docker Compose
run: docker-compose up -d

- name: Install dependencies
run: docker-compose exec -T php composer install
- name: test
run: docker-compose exec -T php ./vendor/bin/grumphp run

- name: Run code sniffer
run: docker-compose exec -T php ./vendor/bin/grumphp run
14 changes: 3 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cweagans/composer-patches": "^1 || ^2",
"php-http/logger-plugin": "^1",
"php-http/message": "~1.13",
"phpro/soap-client": "~2.4",
"phpro/soap-client": "~3.4",
"psr/http-client": "^1",
"psr/http-client-implementation": "*",
"psr/http-factory": "^1",
Expand All @@ -21,7 +21,7 @@
"symfony/http-client": "~5.4 || ~6",
"symfony/serializer": "~5.4 || ~6",
"symfony/validator": "~5.4 || ~6",
"veewee/xml": "^2.0"
"veewee/xml": "^3.0"
},
"require-dev": {
"colinodell/psr-testlogger": "^1.1",
Expand Down Expand Up @@ -69,13 +69,5 @@
},
"bin": ["bin/epoetry"],
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"patches": {
"phpro/soap-client" : {
"https://github.com/phpro/soap-client/issues/446": "https://patch-diff.githubusercontent.com/raw/phpro/soap-client/pull/448.diff",
"https://github.com/phpro/soap-client/issues/444": "https://patch-diff.githubusercontent.com/raw/phpro/soap-client/pull/445.diff"
}
}
}
"prefer-stable": true
}
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "2"
services:
php:
image: wodby/php:8.1
image: wodby/php:8.3
environment:
# PHP_XDEBUG: 1 # Uncomment to enable XDebug.
PHP_FPM_USER: wodby
Expand Down
5 changes: 3 additions & 2 deletions tests/CodeGenerator/Assembler/AbstractAssemblerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Phpro\SoapClient\CodeGenerator\Model\Type;
use PHPUnit\Framework\TestCase;
use Laminas\Code\Generator\ClassGenerator;
use Soap\Engine\Metadata\Model\TypeMeta;

abstract class AbstractAssemblerTest extends TestCase
{
Expand Down Expand Up @@ -47,8 +48,8 @@ protected function createContext($propertyName = 'prop1')
];

$class = new ClassGenerator('MyType', 'MyNamespace');
$type = new Type('MyNamespace', 'MyType', $properties);
$property = new Property($propertyName, $properties[$propertyName], 'ns1');
$type = new Type('MyNamespace', 'MyType', $properties, new TypeMeta());
$property = new Property($propertyName, $properties[$propertyName], 'ns1', new TypeMeta());

return new PropertyContext($class, $type, $property);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MyType
/**
* @var string[]|array
*/
private $prop1 = [];
private string $prop1 = [];
}

CODE;
Expand Down
2 changes: 1 addition & 1 deletion tests/CodeGenerator/Assembler/ArraySetterAssemblerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MyType
/**
* @param string[] $prop1
*/
public function setProp1(array $prop1)
public function setProp1(array $prop1) : void
{
$this->prop1 = $prop1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MyType
/**
* @var null|string
*/
private $prop1;
private string $prop1;
}

CODE;
Expand Down
Loading