-
Notifications
You must be signed in to change notification settings - Fork 3
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-5162: Setup project for PHP 8.3 and port Notifications and Authentication classes #87
Changes from all commits
224b496
46cd17a
85a46a9
c059f1e
2fecd19
ed0f407
5175134
6acf1ec
2990ee5
a8050b7
8e9b7b8
c503465
00fe412
3436008
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,69 @@ | ||
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.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 | ||
run: docker-compose exec -T php ./vendor/bin/phpunit | ||
code-sniffer: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php_version: ["8.1", "8.2"] | ||
env: | ||
PHP_VERSION: ${{ matrix.php_version }} | ||
steps: | ||
- name: clone | ||
uses: actions/checkout@v2 | ||
- run: docker-compose up -d | ||
- name: build | ||
run: docker-compose exec -T php composer install | ||
- name: test | ||
run: docker-compose exec -T php ./vendor/bin/grumphp run | ||
|
||
# - name: Run tests | ||
# run: docker-compose exec -T php ./vendor/bin/phpunit | ||
# While porting to 3.x run each test suite separately. | ||
# We will remove this one the job is done. | ||
- name: CodeGenerator | ||
run: "docker-compose exec -T php ./vendor/bin/phpunit --testsuite CodeGenerator" | ||
- name: ExtSoapEngine | ||
run: "docker-compose exec -T php ./vendor/bin/phpunit --testsuite ExtSoapEngine" | ||
- name: Notification | ||
run: "docker-compose exec -T php ./vendor/bin/phpunit --testsuite Notification" | ||
- name: Request | ||
run: "docker-compose exec -T php ./vendor/bin/phpunit --testsuite Request" | ||
- name: RequestClientFactoryTest | ||
run: "docker-compose exec -T php ./vendor/bin/phpunit --testsuite RequestClientFactoryTest" | ||
- name: SerializerTest | ||
run: "docker-compose exec -T php ./vendor/bin/phpunit --testsuite SerializerTest" | ||
|
||
# We will run codesniffer at the end of our refactoring effort. | ||
# code-sniffer: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# php_version: ["8.3"] | ||
# env: | ||
# PHP_VERSION: ${{ matrix.php_version }} | ||
# steps: | ||
# - name: Clone repository | ||
# uses: actions/checkout@v2 | ||
# | ||
# - 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: Run code sniffer | ||
# run: docker-compose exec -T php ./vendor/bin/grumphp run |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I understand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has been done. |
||
"psr/http-client": "^1", | ||
"psr/http-client-implementation": "*", | ||
"psr/http-factory": "^1", | ||
|
@@ -21,7 +21,7 @@ | |
"symfony/http-client": "~5.4 || ~6", | ||
"symfony/serializer": "~5.4 || ~6", | ||
"symfony/validator": "~5.4 || ~6", | ||
Comment on lines
21
to
23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need to keep the support of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll remove this in the next ticket. |
||
"veewee/xml": "^2.0" | ||
"veewee/xml": "^3.0" | ||
}, | ||
"require-dev": { | ||
"colinodell/psr-testlogger": "^1.1", | ||
sergepavle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -73,8 +73,7 @@ | |
"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" | ||
"add-anyuri-to-normalizer.patch": "./patches/add-anyuri-to-normalizer.patch" | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
<?php | ||
|
||
use OpenEuropa\EPoetry\CodeGenerator\ConfigProcessor; | ||
use Phpro\SoapClient\CodeGenerator\Config\Config; | ||
use Soap\ExtSoapEngine\ExtSoapOptions; | ||
use Phpro\SoapClient\Soap\DefaultEngineFactory; | ||
use Phpro\SoapClient\Soap\CodeGeneratorEngineFactory; | ||
use Phpro\SoapClient\CodeGenerator\Rules; | ||
use Phpro\SoapClient\CodeGenerator\Assembler; | ||
use OpenEuropa\EPoetry\CodeGenerator as OpenEuropa; | ||
|
||
$config = Config::create() | ||
->setEngine($engine = DefaultEngineFactory::create( | ||
ExtSoapOptions::defaults('./resources/notification.wsdl', []) | ||
->disableWsdlCache() | ||
)) | ||
$engine = CodeGeneratorEngineFactory::create('./resources/notification.wsdl'); | ||
return Config::create() | ||
->setEngine($engine) | ||
->setTypeDestination('src/Notification/Type') | ||
->setTypeNamespace('OpenEuropa\EPoetry\Notification\Type') | ||
->setClientDestination('src/Notification/') | ||
->setClientNamespace('OpenEuropa\EPoetry\Notification') | ||
->setClassMapDestination('src/Notification/') | ||
->setClassMapName('NotificationClassmap') | ||
->setClassMapNamespace('OpenEuropa\EPoetry\Notification'); | ||
|
||
return ConfigProcessor::addRules($config); | ||
->setClassMapNamespace('OpenEuropa\EPoetry\Notification') | ||
->setRuleSet(new Rules\RuleSet([ | ||
new Rules\AssembleRule(new Assembler\PropertyAssembler( | ||
Assembler\PropertyAssemblerOptions::create() | ||
->withTypeHints(false) | ||
) | ||
), | ||
new Rules\AssembleRule(new Assembler\FluentSetterAssembler( | ||
Assembler\FluentSetterAssemblerOptions::create() | ||
->withTypeHints() | ||
) | ||
), | ||
new Rules\AssembleRule(new Assembler\GetterAssembler( | ||
Assembler\GetterAssemblerOptions::create() | ||
->withReturnType() | ||
->withBoolGetters() | ||
) | ||
), | ||
new Rules\AssembleRule(new OpenEuropa\Assembler\HasPropertyAssembler()), | ||
new Rules\AssembleRule(new Assembler\ClassMapAssembler()), | ||
new Rules\AssembleRule(new Assembler\ClientConstructorAssembler()), | ||
new Rules\AssembleRule(new Assembler\ClientMethodAssembler()), | ||
])); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php | ||
index 0f33a7f..76bcea5 100644 | ||
--- a/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php | ||
+++ b/src/Phpro/SoapClient/CodeGenerator/Util/Normalizer.php | ||
@@ -15,6 +15,7 @@ class Normalizer | ||
'any' => 'mixed', | ||
'anytype' => 'mixed', | ||
'anyxml' => 'string', | ||
+ 'anyuri' => 'string', | ||
'anysimpletype' => 'mixed', | ||
'long' => 'int', | ||
'short' => 'int', |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ public static function getCollection() : \Soap\ExtSoapEngine\Configuration\Class | |
); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,18 @@ public function __construct(\Phpro\SoapClient\Caller\Caller $caller) | |
} | ||
|
||
/** | ||
* @param RequestInterface|Type\GetServiceTicket $getServiceTicketPart | ||
* @return ResultInterface|Type\GetServiceTicketResponse | ||
* @param RequestInterface & Type\GetServiceTicket $getServiceTicketPart | ||
* @return ResultInterface & Type\GetServiceTicketResponse | ||
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. think we should indicate one or the other, usually its the interface, but if we need it to be the class then lets go with that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is generated by the library, check the readme here. |
||
* @throws SoapException | ||
*/ | ||
public function getServiceTicket(\OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\GetServiceTicket $getServiceTicketPart) : \OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\GetServiceTicketResponse | ||
{ | ||
return ($this->caller)('getServiceTicket', $getServiceTicketPart); | ||
$response = ($this->caller)('getServiceTicket', $getServiceTicketPart); | ||
|
||
\Psl\Type\instance_of(\OpenEuropa\EPoetry\Authentication\ClientCertificate\Type\GetServiceTicketResponse::class)->assert($response); | ||
\Psl\Type\instance_of(\Phpro\SoapClient\Type\ResultInterface::class)->assert($response); | ||
|
||
return $response; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,27 +7,30 @@ | |
class GetServiceTicketResponse implements ResultInterface | ||
{ | ||
/** | ||
* Service ticket for the specified service. | ||
* | ||
* @var string | ||
*/ | ||
private $serviceTicket; | ||
private string $serviceTicket; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getServiceTicket() | ||
public function getServiceTicket() : string | ||
{ | ||
return $this->serviceTicket; | ||
} | ||
|
||
/** | ||
* @param string $serviceTicket | ||
* @return GetServiceTicketResponse | ||
* @return static | ||
*/ | ||
public function withServiceTicket($serviceTicket) | ||
public function withServiceTicket(string $serviceTicket) : static | ||
{ | ||
$new = clone $this; | ||
$new->serviceTicket = $serviceTicket; | ||
|
||
return $new; | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double newline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is generated by the library, check the readme here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the
^1
version?