Skip to content

Commit

Permalink
PHP 8.4 support
Browse files Browse the repository at this point in the history
- Fix idn_to_utf8() call for PHP 8.4.
- Update schemes and suffixes lists.
- Merge jobs in github actions workflow for better performance.
  • Loading branch information
otsch committed Nov 6, 2024
1 parent 5007904 commit 4f42f74
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 29 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,12 @@ name: CI
on: pull_request

jobs:
cs:
name: PHP CS Fixer
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP CS Fixer
run: composer cs

tests8x:
name: Tests
tests:
name: PestPHP Tests
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']

steps:
- name: Checkout code
Expand All @@ -45,8 +25,8 @@ jobs:
- name: Run tests
run: composer test

stan:
name: PHPStan
stanAndCs:
name: Static Analysis (PHPStan) and Code Style (PHP CS Fixer)
runs-on: ubuntu-latest

steps:
Expand All @@ -57,9 +37,13 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHP CS Fixer
run: composer cs

- name: Run PHPStan
run: composer stan
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.1.3] - 2024-11-06
### Fixed
- Improvement for PHP 8.4.
- Update schemes and suffixes lists.

## [2.1.2] - 2024-10-24
### Fixed
- Update schemes and suffixes lists.
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"phpstan/phpstan": "^1.8",
"pestphp/pest": "^1.22|^2.0|^3.0",
"pestphp/pest-plugin-parallel": "^1.2"
"pestphp/pest": "^1.22|^2.0|^3.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion data/schemes.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return ['aaa'=>0,'aaas'=>0,'about'=>0,'acap'=>0,'acct'=>0,'acd'=>0,'acr'=>0,'adiumxtra'=>0,'adt'=>0,'afp'=>0,'afs'=>0,'aim'=>0,'amss'=>0,'android'=>0,'appdata'=>0,'apt'=>0,'ar'=>0,'ark'=>0,'at'=>0,'attachment'=>0,'aw'=>0,'barion'=>0,'bb'=>0,'beshare'=>0,'bitcoin'=>0,'bitcoincash'=>0,'blob'=>0,'bluetooth'=>0,'bolo'=>0,'brid'=>0,'browserext'=>0,'cabal'=>0,'calculator'=>0,'callto'=>0,'cap'=>0,'cast'=>0,'casts'=>0,'chrome'=>0,'chrome-extension'=>0,'cid'=>0,'coap'=>0,'coap+tcp'=>0,'coap+ws'=>0,'coaps'=>0,'coaps+tcp'=>0,'coaps+ws'=>0,'com-eventbrite-attendee'=>0,'content'=>0,'content-type'=>0,'crid'=>0,'cstr'=>0,'cvs'=>0,'dab'=>0,'dat'=>0,'data'=>0,'dav'=>0,'dhttp'=>0,'diaspora'=>0,'dict'=>0,'did'=>0,'dis'=>0,'dlna-playcontainer'=>0,'dlna-playsingle'=>0,'dns'=>0,'dntp'=>0,'doi'=>0,'dpp'=>0,'drm'=>0,'drop'=>0,'dtmi'=>0,'dtn'=>0,'dvb'=>0,'dvx'=>0,'dweb'=>0,'ed2k'=>0,'eid'=>0,'elsi'=>0,'embedded'=>0,'ens'=>0,'ethereum'=>0,'example'=>0,'facetime'=>0,'fax'=>0,'feed'=>0,'feedready'=>0,'fido'=>0,'file'=>0,'filesystem'=>0,'finger'=>0,'first-run-pen-experience'=>0,'fish'=>0,'fm'=>0,'ftp'=>0,'fuchsia-pkg'=>0,'geo'=>0,'gg'=>0,'git'=>0,'gitoid'=>0,'gizmoproject'=>0,'go'=>0,'gopher'=>0,'graph'=>0,'grd'=>0,'gtalk'=>0,'h323'=>0,'ham'=>0,'hcap'=>0,'hcp'=>0,'hs20'=>0,'http'=>0,'https'=>0,'hxxp'=>0,'hxxps'=>0,'hydrazone'=>0,'hyper'=>0,'iax'=>0,'icap'=>0,'icon'=>0,'im'=>0,'imap'=>0,'info'=>0,'iotdisco'=>0,'ipfs'=>0,'ipn'=>0,'ipns'=>0,'ipp'=>0,'ipps'=>0,'irc'=>0,'irc6'=>0,'ircs'=>0,'iris'=>0,'iris.beep'=>0,'iris.lwz'=>0,'iris.xpc'=>0,'iris.xpcs'=>0,'isostore'=>0,'itms'=>0,'jabber'=>0,'jar'=>0,'jms'=>0,'keyparc'=>0,'lastfm'=>0,'lbry'=>0,'ldap'=>0,'ldaps'=>0,'leaptofrogans'=>0,'lid'=>0,'lorawan'=>0,'lpa'=>0,'lvlt'=>0,'machineProvisioningProgressReporter'=>0,'magnet'=>0,'mailserver'=>0,'mailto'=>0,'maps'=>0,'market'=>0,'matrix'=>0,'message'=>0,'microsoft.windows.camera'=>0,'microsoft.windows.camera.multipicker'=>0,'microsoft.windows.camera.picker'=>0,'mid'=>0,'mms'=>0,'modem'=>0,'mongodb'=>0,'moz'=>0,'ms-access'=>0,'ms-appinstaller'=>0,'ms-browser-extension'=>0,'ms-calculator'=>0,'ms-drive-to'=>0,'ms-enrollment'=>0,'ms-excel'=>0,'ms-eyecontrolspeech'=>0,'ms-gamebarservices'=>0,'ms-gamingoverlay'=>0,'ms-getoffice'=>0,'ms-help'=>0,'ms-infopath'=>0,'ms-inputapp'=>0,'ms-launchremotedesktop'=>0,'ms-lockscreencomponent-config'=>0,'ms-media-stream-id'=>0,'ms-meetnow'=>0,'ms-mixedrealitycapture'=>0,'ms-mobileplans'=>0,'ms-newsandinterests'=>0,'ms-officeapp'=>0,'ms-people'=>0,'ms-personacard'=>0,'ms-project'=>0,'ms-powerpoint'=>0,'ms-publisher'=>0,'ms-recall'=>0,'ms-remotedesktop'=>0,'ms-remotedesktop-launch'=>0,'ms-restoretabcompanion'=>0,'ms-screenclip'=>0,'ms-screensketch'=>0,'ms-search'=>0,'ms-search-repair'=>0,'ms-secondary-screen-controller'=>0,'ms-secondary-screen-setup'=>0,'ms-settings'=>0,'ms-settings-airplanemode'=>0,'ms-settings-bluetooth'=>0,'ms-settings-camera'=>0,'ms-settings-cellular'=>0,'ms-settings-cloudstorage'=>0,'ms-settings-connectabledevices'=>0,'ms-settings-displays-topology'=>0,'ms-settings-emailandaccounts'=>0,'ms-settings-language'=>0,'ms-settings-location'=>0,'ms-settings-lock'=>0,'ms-settings-nfctransactions'=>0,'ms-settings-notifications'=>0,'ms-settings-power'=>0,'ms-settings-privacy'=>0,'ms-settings-proximity'=>0,'ms-settings-screenrotation'=>0,'ms-settings-wifi'=>0,'ms-settings-workplace'=>0,'ms-spd'=>0,'ms-stickers'=>0,'ms-sttoverlay'=>0,'ms-transit-to'=>0,'ms-useractivityset'=>0,'ms-virtualtouchpad'=>0,'ms-visio'=>0,'ms-walk-to'=>0,'ms-whiteboard'=>0,'ms-whiteboard-cmd'=>0,'ms-word'=>0,'msnim'=>0,'msrp'=>0,'msrps'=>0,'mss'=>0,'mt'=>0,'mtqp'=>0,'mumble'=>0,'mupdate'=>0,'mvn'=>0,'mvrp'=>0,'mvrps'=>0,'news'=>0,'nfs'=>0,'ni'=>0,'nih'=>0,'nntp'=>0,'notes'=>0,'num'=>0,'ocf'=>0,'oid'=>0,'onenote'=>0,'onenote-cmd'=>0,'opaquelocktoken'=>0,'openid'=>0,'openpgp4fpr'=>0,'otpauth'=>0,'p1'=>0,'pack'=>0,'palm'=>0,'paparazzi'=>0,'payment'=>0,'payto'=>0,'pkcs11'=>0,'platform'=>0,'pop'=>0,'pres'=>0,'prospero'=>0,'proxy'=>0,'pwid'=>0,'psyc'=>0,'pttp'=>0,'qb'=>0,'query'=>0,'quic-transport'=>0,'redis'=>0,'rediss'=>0,'reload'=>0,'res'=>0,'resource'=>0,'rmi'=>0,'rsync'=>0,'rtmfp'=>0,'rtmp'=>0,'rtsp'=>0,'rtsps'=>0,'rtspu'=>0,'sarif'=>0,'secondlife'=>0,'secret-token'=>0,'service'=>0,'session'=>0,'sftp'=>0,'sgn'=>0,'shc'=>0,'shttp (OBSOLETE)'=>0,'sieve'=>0,'simpleledger'=>0,'simplex'=>0,'sip'=>0,'sips'=>0,'skype'=>0,'smb'=>0,'smp'=>0,'sms'=>0,'smtp'=>0,'snews'=>0,'snmp'=>0,'soap.beep'=>0,'soap.beeps'=>0,'soldat'=>0,'spiffe'=>0,'spotify'=>0,'ssb'=>0,'ssh'=>0,'starknet'=>0,'steam'=>0,'stun'=>0,'stuns'=>0,'submit'=>0,'svn'=>0,'swh'=>0,'swid'=>0,'swidpath'=>0,'tag'=>0,'taler'=>0,'teamspeak'=>0,'tel'=>0,'teliaeid'=>0,'telnet'=>0,'tftp'=>0,'things'=>0,'thismessage'=>0,'thzp'=>0,'tip'=>0,'tn3270'=>0,'tool'=>0,'turn'=>0,'turns'=>0,'tv'=>0,'udp'=>0,'unreal'=>0,'upt'=>0,'urn'=>0,'ut2004'=>0,'uuid-in-package'=>0,'v-event'=>0,'vemmi'=>0,'ventrilo'=>0,'ves'=>0,'videotex'=>0,'vnc'=>0,'view-source'=>0,'vscode'=>0,'vscode-insiders'=>0,'vsls'=>0,'w3'=>0,'wais'=>0,'web3'=>0,'wcr'=>0,'webcal'=>0,'web+ap'=>0,'wifi'=>0,'wpid'=>0,'ws'=>0,'wss'=>0,'wtai'=>0,'wyciwyg'=>0,'xcon'=>0,'xcon-userid'=>0,'xfire'=>0,'xmlrpc.beep'=>0,'xmlrpc.beeps'=>0,'xmpp'=>0,'xftp'=>0,'xrcp'=>0,'xri'=>0,'ymsgr'=>0,'z39.50'=>0,'z39.50r'=>0,'z39.50s'=>0,];
<?php return ['aaa'=>0,'aaas'=>0,'about'=>0,'acap'=>0,'acct'=>0,'acd'=>0,'acr'=>0,'adiumxtra'=>0,'adt'=>0,'afp'=>0,'afs'=>0,'aim'=>0,'amss'=>0,'android'=>0,'appdata'=>0,'apt'=>0,'ar'=>0,'ark'=>0,'at'=>0,'attachment'=>0,'aw'=>0,'barion'=>0,'bb'=>0,'beshare'=>0,'bitcoin'=>0,'bitcoincash'=>0,'blob'=>0,'bluetooth'=>0,'bolo'=>0,'brid'=>0,'browserext'=>0,'cabal'=>0,'calculator'=>0,'callto'=>0,'cap'=>0,'cast'=>0,'casts'=>0,'chrome'=>0,'chrome-extension'=>0,'cid'=>0,'coap'=>0,'coap+tcp'=>0,'coap+ws'=>0,'coaps'=>0,'coaps+tcp'=>0,'coaps+ws'=>0,'com-eventbrite-attendee'=>0,'content'=>0,'content-type'=>0,'crid'=>0,'cstr'=>0,'cvs'=>0,'dab'=>0,'dat'=>0,'data'=>0,'dav'=>0,'dhttp'=>0,'diaspora'=>0,'dict'=>0,'did'=>0,'dis'=>0,'dlna-playcontainer'=>0,'dlna-playsingle'=>0,'dns'=>0,'dntp'=>0,'doi'=>0,'dpp'=>0,'drm'=>0,'drop'=>0,'dtmi'=>0,'dtn'=>0,'dvb'=>0,'dvx'=>0,'dweb'=>0,'ed2k'=>0,'eid'=>0,'elsi'=>0,'embedded'=>0,'ens'=>0,'ethereum'=>0,'example'=>0,'facetime'=>0,'fax'=>0,'feed'=>0,'feedready'=>0,'fido'=>0,'file'=>0,'filesystem'=>0,'finger'=>0,'first-run-pen-experience'=>0,'fish'=>0,'fm'=>0,'ftp'=>0,'fuchsia-pkg'=>0,'geo'=>0,'gg'=>0,'git'=>0,'gitoid'=>0,'gizmoproject'=>0,'go'=>0,'gopher'=>0,'graph'=>0,'grd'=>0,'gtalk'=>0,'h323'=>0,'ham'=>0,'hcap'=>0,'hcp'=>0,'hs20'=>0,'http'=>0,'https'=>0,'hxxp'=>0,'hxxps'=>0,'hydrazone'=>0,'hyper'=>0,'iax'=>0,'icap'=>0,'icon'=>0,'im'=>0,'imap'=>0,'info'=>0,'iotdisco'=>0,'ipfs'=>0,'ipn'=>0,'ipns'=>0,'ipp'=>0,'ipps'=>0,'irc'=>0,'irc6'=>0,'ircs'=>0,'iris'=>0,'iris.beep'=>0,'iris.lwz'=>0,'iris.xpc'=>0,'iris.xpcs'=>0,'isostore'=>0,'itms'=>0,'jabber'=>0,'jar'=>0,'jms'=>0,'keyparc'=>0,'lastfm'=>0,'lbry'=>0,'ldap'=>0,'ldaps'=>0,'leaptofrogans'=>0,'lid'=>0,'lorawan'=>0,'lpa'=>0,'lvlt'=>0,'machineProvisioningProgressReporter'=>0,'magnet'=>0,'mailserver'=>0,'mailto'=>0,'maps'=>0,'market'=>0,'matrix'=>0,'message'=>0,'microsoft.windows.camera'=>0,'microsoft.windows.camera.multipicker'=>0,'microsoft.windows.camera.picker'=>0,'mid'=>0,'mms'=>0,'modem'=>0,'mongodb'=>0,'moz'=>0,'ms-access'=>0,'ms-appinstaller'=>0,'ms-browser-extension'=>0,'ms-calculator'=>0,'ms-drive-to'=>0,'ms-enrollment'=>0,'ms-excel'=>0,'ms-eyecontrolspeech'=>0,'ms-gamebarservices'=>0,'ms-gamingoverlay'=>0,'ms-getoffice'=>0,'ms-help'=>0,'ms-infopath'=>0,'ms-inputapp'=>0,'ms-launchremotedesktop'=>0,'ms-lockscreencomponent-config'=>0,'ms-media-stream-id'=>0,'ms-meetnow'=>0,'ms-mixedrealitycapture'=>0,'ms-mobileplans'=>0,'ms-newsandinterests'=>0,'ms-officeapp'=>0,'ms-people'=>0,'ms-personacard'=>0,'ms-project'=>0,'ms-powerpoint'=>0,'ms-publisher'=>0,'ms-recall'=>0,'ms-remotedesktop'=>0,'ms-remotedesktop-launch'=>0,'ms-restoretabcompanion'=>0,'ms-screenclip'=>0,'ms-screensketch'=>0,'ms-search'=>0,'ms-search-repair'=>0,'ms-secondary-screen-controller'=>0,'ms-secondary-screen-setup'=>0,'ms-settings'=>0,'ms-settings-airplanemode'=>0,'ms-settings-bluetooth'=>0,'ms-settings-camera'=>0,'ms-settings-cellular'=>0,'ms-settings-cloudstorage'=>0,'ms-settings-connectabledevices'=>0,'ms-settings-displays-topology'=>0,'ms-settings-emailandaccounts'=>0,'ms-settings-language'=>0,'ms-settings-location'=>0,'ms-settings-lock'=>0,'ms-settings-nfctransactions'=>0,'ms-settings-notifications'=>0,'ms-settings-power'=>0,'ms-settings-privacy'=>0,'ms-settings-proximity'=>0,'ms-settings-screenrotation'=>0,'ms-settings-wifi'=>0,'ms-settings-workplace'=>0,'ms-spd'=>0,'ms-stickers'=>0,'ms-sttoverlay'=>0,'ms-transit-to'=>0,'ms-useractivityset'=>0,'ms-virtualtouchpad'=>0,'ms-visio'=>0,'ms-walk-to'=>0,'ms-whiteboard'=>0,'ms-whiteboard-cmd'=>0,'ms-word'=>0,'msnim'=>0,'msrp'=>0,'msrps'=>0,'mss'=>0,'mt'=>0,'mtqp'=>0,'mumble'=>0,'mupdate'=>0,'mvn'=>0,'mvrp'=>0,'mvrps'=>0,'news'=>0,'nfs'=>0,'ni'=>0,'nih'=>0,'nntp'=>0,'notes'=>0,'num'=>0,'ocf'=>0,'oid'=>0,'onenote'=>0,'onenote-cmd'=>0,'opaquelocktoken'=>0,'openid'=>0,'openpgp4fpr'=>0,'otpauth'=>0,'p1'=>0,'pack'=>0,'palm'=>0,'paparazzi'=>0,'payment'=>0,'payto'=>0,'pkcs11'=>0,'platform'=>0,'pop'=>0,'pres'=>0,'prospero'=>0,'proxy'=>0,'pwid'=>0,'psyc'=>0,'pttp'=>0,'qb'=>0,'query'=>0,'quic-transport'=>0,'redis'=>0,'rediss'=>0,'reload'=>0,'res'=>0,'resource'=>0,'rmi'=>0,'rsync'=>0,'rtmfp'=>0,'rtmp'=>0,'rtsp'=>0,'rtsps'=>0,'rtspu'=>0,'sarif'=>0,'secondlife'=>0,'secret-token'=>0,'service'=>0,'session'=>0,'sftp'=>0,'sgn'=>0,'shc'=>0,'shelter'=>0,'shttp (OBSOLETE)'=>0,'sieve'=>0,'simpleledger'=>0,'simplex'=>0,'sip'=>0,'sips'=>0,'skype'=>0,'smb'=>0,'smp'=>0,'sms'=>0,'smtp'=>0,'snews'=>0,'snmp'=>0,'soap.beep'=>0,'soap.beeps'=>0,'soldat'=>0,'spiffe'=>0,'spotify'=>0,'ssb'=>0,'ssh'=>0,'starknet'=>0,'steam'=>0,'stun'=>0,'stuns'=>0,'submit'=>0,'svn'=>0,'swh'=>0,'swid'=>0,'swidpath'=>0,'tag'=>0,'taler'=>0,'teamspeak'=>0,'tel'=>0,'teliaeid'=>0,'telnet'=>0,'tftp'=>0,'things'=>0,'thismessage'=>0,'thzp'=>0,'tip'=>0,'tn3270'=>0,'tool'=>0,'turn'=>0,'turns'=>0,'tv'=>0,'udp'=>0,'unreal'=>0,'upt'=>0,'urn'=>0,'ut2004'=>0,'uuid-in-package'=>0,'v-event'=>0,'vemmi'=>0,'ventrilo'=>0,'ves'=>0,'videotex'=>0,'vnc'=>0,'view-source'=>0,'vscode'=>0,'vscode-insiders'=>0,'vsls'=>0,'w3'=>0,'wais'=>0,'web3'=>0,'wcr'=>0,'webcal'=>0,'web+ap'=>0,'wifi'=>0,'wpid'=>0,'ws'=>0,'wss'=>0,'wtai'=>0,'wyciwyg'=>0,'xcon'=>0,'xcon-userid'=>0,'xfire'=>0,'xmlrpc.beep'=>0,'xmlrpc.beeps'=>0,'xmpp'=>0,'xftp'=>0,'xrcp'=>0,'xri'=>0,'ymsgr'=>0,'z39.50'=>0,'z39.50r'=>0,'z39.50s'=>0,];
2 changes: 1 addition & 1 deletion data/suffixes.php

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ public static function idn_to_ascii(string $string): string
*/
public static function idn_to_utf8(string $string): string
{
if (empty($string)) {
return $string;
}

$converted = idn_to_utf8($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);

return $converted !== false ? $converted : $string;
Expand Down

0 comments on commit 4f42f74

Please sign in to comment.