-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64ceb8d
commit 77bbb17
Showing
30 changed files
with
1,269 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Daily Scripts spec update | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '55 17 * * *' | ||
|
||
jobs: | ||
update-specs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: composer install | ||
- name: Run standard update command | ||
run: composer update-spec -- --type=script | ||
- name: Run CSFixer | ||
run: composer cs:fix | ||
- name: Create Pull Request | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: Automatic Scripts spec update from upstream changes | ||
delete-branch: true | ||
title: 'Automatic Scripts spec update' | ||
branch: update-spec/scripts | ||
body: | | ||
This PR makes sure the content of this package is updated with upstream changes in the specs. | ||
labels: | | ||
spec-update | ||
automated pr | ||
reviewers: prinsfrank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace PrinsFrank\Standards\Dev\DataSource\Script; | ||
|
||
use PrinsFrank\Standards\Dev\DataSource\HtmlDataSource; | ||
use PrinsFrank\Standards\Scripts\ScriptAlias; | ||
use PrinsFrank\Standards\Scripts\ScriptName; | ||
use Symfony\Component\Panther\Client; | ||
use Symfony\Component\Panther\DomCrawler\Crawler; | ||
|
||
class ScriptAliasSource implements HtmlDataSource | ||
{ | ||
public static function url(): string | ||
{ | ||
return 'https://www.unicode.org/iso15924/iso15924-codes.html'; | ||
} | ||
|
||
public static function xPathIdentifierKey(): string | ||
{ | ||
return self::xPathIdentifierName(); | ||
} | ||
|
||
public static function xPathIdentifierName(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[3]'; | ||
} | ||
|
||
public static function xPathIdentifierValue(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[5]'; | ||
} | ||
|
||
public static function transformName(string $key): ?string | ||
{ | ||
return preg_replace('/_+/', '_', str_replace('+', '_', preg_replace('/\p{No}/u', '', $key) ?? '')); | ||
} | ||
|
||
public static function transformValue(string $value, ?string $key): string|int|null | ||
{ | ||
$value = str_replace(' ', '', trim($value)); | ||
if ($value === '' || $key === 'Khutsuri_Asomtavruli_and_Nuskhuri') { | ||
return null; | ||
} | ||
|
||
return $value; | ||
} | ||
|
||
public static function getSpecFQN(): string | ||
{ | ||
return ScriptAlias::class; | ||
} | ||
|
||
public static function getKeyEnumFQN(): string | ||
{ | ||
return ScriptName::class; | ||
} | ||
|
||
public static function afterPageLoad(Client $client, Crawler $crawler): void | ||
{ | ||
} | ||
|
||
public static function sort(): bool | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace PrinsFrank\Standards\Dev\DataSource\Script; | ||
|
||
use PrinsFrank\Standards\Dev\DataSource\HtmlDataSource; | ||
use PrinsFrank\Standards\Scripts\ScriptCode; | ||
use PrinsFrank\Standards\Scripts\ScriptName; | ||
use Symfony\Component\Panther\Client; | ||
use Symfony\Component\Panther\DomCrawler\Crawler; | ||
|
||
class ScriptCodeSource implements HtmlDataSource | ||
{ | ||
public static function url(): string | ||
{ | ||
return 'https://www.unicode.org/iso15924/iso15924-codes.html'; | ||
} | ||
|
||
public static function xPathIdentifierKey(): string | ||
{ | ||
return self::xPathIdentifierName(); | ||
} | ||
|
||
public static function xPathIdentifierName(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[3]'; | ||
} | ||
|
||
public static function xPathIdentifierValue(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[2]'; | ||
} | ||
|
||
public static function transformName(string $key): ?string | ||
{ | ||
return preg_replace('/_+/', '_', str_replace('+', '_', preg_replace('/\p{No}/u', '', $key) ?? '')); | ||
} | ||
|
||
public static function transformValue(string $value, ?string $key): string|int|null | ||
{ | ||
return str_replace(' ', '', trim($value)); | ||
} | ||
|
||
public static function getSpecFQN(): string | ||
{ | ||
return ScriptCode::class; | ||
} | ||
|
||
public static function getKeyEnumFQN(): string | ||
{ | ||
return ScriptName::class; | ||
} | ||
|
||
public static function afterPageLoad(Client $client, Crawler $crawler): void | ||
{ | ||
} | ||
|
||
public static function sort(): bool | ||
{ | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace PrinsFrank\Standards\Dev\DataSource\Script; | ||
|
||
use PrinsFrank\Standards\Dev\DataSource\HtmlDataSource; | ||
use PrinsFrank\Standards\Scripts\ScriptName; | ||
use Symfony\Component\Panther\Client; | ||
use Symfony\Component\Panther\DomCrawler\Crawler; | ||
|
||
class ScriptNameSource implements HtmlDataSource | ||
{ | ||
public static function url(): string | ||
{ | ||
return 'https://www.unicode.org/iso15924/iso15924-codes.html'; | ||
} | ||
|
||
public static function xPathIdentifierKey(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[1]'; | ||
} | ||
|
||
public static function xPathIdentifierName(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[3]'; | ||
} | ||
|
||
public static function xPathIdentifierValue(): string | ||
{ | ||
return '//table[@class="simple"]/tbody/tr/td[3]'; | ||
} | ||
|
||
public static function transformName(string $key): ?string | ||
{ | ||
return preg_replace('/_+/', '_', str_replace('+', '_', preg_replace('/\p{No}/u', '', $key) ?? '')); | ||
} | ||
|
||
public static function transformValue(string $value, ?string $key): string|int|null | ||
{ | ||
return str_replace(' ', '', trim($value)); | ||
} | ||
|
||
public static function getSpecFQN(): string | ||
{ | ||
return ScriptName::class; | ||
} | ||
|
||
public static function getKeyEnumFQN(): string | ||
{ | ||
return self::getSpecFQN(); | ||
} | ||
|
||
public static function afterPageLoad(Client $client, Crawler $crawler): void | ||
{ | ||
} | ||
|
||
public static function sort(): bool | ||
{ | ||
return true; | ||
} | ||
} |
Oops, something went wrong.