feat(metadata): use uri RFC 3986 on PHP8.5#7565
feat(metadata): use uri RFC 3986 on PHP8.5#7565SVillette wants to merge 1 commit intoapi-platform:mainfrom
Conversation
c91971d to
c442327
Compare
|
could you maybe rebase this? |
c442327 to
bc53a3b
Compare
|
@soyuka PR is rebased. |
|
I feel like this work could be simpler by exposing the require method in a BCHelper class or by using a polyfill like https://github.com/thephpleague/uri-polyfill |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
| @@ -25,6 +26,10 @@ class IriHelperTest extends TestCase | |||
| { | |||
| public function testHelpers(): void | |||
There was a problem hiding this comment.
| public function testHelpers(): void | |
| #[RequiresPhp('>= 8.5.0')] | |
| public function testHelpers(): void |
and the import:
use PHPUnit\Framework\Attributes\RequiresPhp;
This is supported by PHPUnit: https://docs.phpunit.de/en/12.5/writing-tests-for-phpunit.html#skipping-tests-using-attributes
Then the check on PHP_VERSION_ID can be removed.
Note: updated with full version to avoid an issue: symfony/symfony#63987
| $this->assertSame('/hello.json?foo=bar&bar=3&page=2', IriHelper::createIri($parsed['uri'], $parsed['parameters'], 'page', 2.)); | ||
| } | ||
|
|
||
| public function testHelpersWithNetworkPathAndRFC3986(): void |
There was a problem hiding this comment.
| public function testHelpersWithNetworkPathAndRFC3986(): void | |
| #[RequiresPhp('< 8.5.0')] | |
| public function testHelpersWithNetworkPathAndRFC3986(): void |
I like these ideas. @SVillette Would you like to update your PR with this idea? I’m not sure if adding a dependency for this is worth it. WDYT @soyuka ? |
This PR replaces the usage of
parse_url()method by the new rfc 3986 URI API on PHP8.5.cc @soyuka this is the subject we talk about at the SymfonyCon hackday.
Still in draft as it's missing some tests.