api-platform / schema-generator

PHP Model Scaffolding from Schema.org and other RDF vocabularies
https://api-platform.com/docs/schema-generator/
MIT License
458 stars 108 forks source link

feat: Allow schema generator to use labels for naming #415

Closed Angatar closed 10 months ago

Angatar commented 10 months ago

API resources and PHP classes

Q A
Branch? main
Tickets Closes #412
License MIT
Doc PR api-platform/docs#1848

New feature: Allow schema generator to use labels for naming API resources and PHP classes

Branch:

Angatar commented 10 months ago

This PR (#415) only includes the relevant code directly related to the new feature added however the CI checks fail and according to the CI logs it seems the composer.lock was not updated for the required symfony/phpunit-bridge package used for running the tests: Here is a part of the CI Build&Test logs returned:

Created project in /home/runner/work/schema-generator/schema-generator/vendor/bin/.phpunit/phpunit-9-0 composer.json has been updated Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.

  • Required package "symfony/phpunit-bridge" is not present in the lock file.

Has it to be fixed in the CI pipeline with a composer update additional step or do I need to include the updated composer.json/composer.lock files in my PR?

Angatar commented 10 months ago

417 has updated the composer.json and composer.lock files, which had for side effect to fix issue #416.

Now it appears the tests fail with PHP 7.4 since PHP 8 syntax was used and I didn't realized it had to be PHP 7.4 compatible ... as PHP 8.3 just came out ;)

Angatar commented 10 months ago

It seems there is currently an issue with the PHPUnit version used in the CI pipeline:

PHP Fatal error: Declaration of PHPUnit\Framework\TestSuite::run(): void must be compatible with PHPUnit\Framework\Test::run(?PHPUnit\Framework\TestResult $result = null): PHPUnit\Framework\TestResult in /home/runner/work/schema-generator/schema-generator/vendor/phpunit/phpunit/src/Framework/TestSuite.php on line 318

Can you fix it?

Details: https://github.com/api-platform/schema-generator/actions/runs/7142451910/job/19451775510?pr=415

BTW: I got no error on the local runs of the PHPunit tests with PHP 7.4, 8.0, 8.1, 8.2 and 8.3

dunglas commented 10 months ago

@Angatar CI fixed in #414.

Angatar commented 10 months ago

Thx I'm gonna rebase and make a new PR

Angatar commented 9 months ago

420 fixed #419, thanks!

PR #421 is replacing this PR #415 PR #421 now pass CI :)