Skip to content

Commit d2bf840

Browse files
authored
Create git workflow with php.yml (#3)
* Create git workflow with php.yml * Feat/update 2 - minors (#4)
1 parent afb6cdb commit d2bf840

File tree

5 files changed

+47
-11
lines changed

5 files changed

+47
-11
lines changed

.github/workflows/php.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Validate composer.json and composer.lock
21+
run: composer validate --strict
22+
23+
- name: Cache Composer packages
24+
id: composer-cache
25+
uses: actions/cache@v3
26+
with:
27+
path: vendor
28+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-php-
31+
32+
- name: Install dependencies
33+
run: composer install --prefer-dist --no-progress
34+
35+
- name: Run QA tools
36+
run: composer qa

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/worklog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ These fixes improve the code quality and type safety of the library, making it m
226226
## 9. 2025-07-16: Optimize Registry Loading and Remove Symfony Dependencies
227227

228228
1. Removed unnecessary symfony/intl checks in BCP47Normalizer:
229-
- Removed redundant checks that didn't affect the normalization behavior
229+
- Removed redundant checks that didn't affect the normalization behavior. Remnant of the previous thoughts.
230230
- Simplified the code by removing conditional logic that always returned the same value
231231

232232
2. Removed symfony/intl and symfony/validator dependencies:

src/Resources/IanaSubtagRegistry.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Do not edit manually
77

88
return array (
9-
'languages' =>
9+
'languages' =>
1010
array (
1111
0 => 'aa',
1212
1 => 'aaa',
@@ -8277,7 +8277,7 @@
82778277
8266 => 'zza',
82788278
8267 => 'zzj',
82798279
),
8280-
'scripts' =>
8280+
'scripts' =>
82818281
array (
82828282
0 => 'Adlm',
82838283
1 => 'Afak',
@@ -8505,7 +8505,7 @@
85058505
223 => 'Zyyy',
85068506
224 => 'Zzzz',
85078507
),
8508-
'regions' =>
8508+
'regions' =>
85098509
array (
85108510
0 => '001',
85118511
1 => '002',
@@ -8813,7 +8813,7 @@
88138813
303 => 'ZW',
88148814
304 => 'ZZ',
88158815
),
8816-
'variants' =>
8816+
'variants' =>
88178817
array (
88188818
0 => '1606nict',
88198819
1 => '1694acad',
@@ -8944,7 +8944,7 @@
89448944
126 => 'wadegile',
89458945
127 => 'xsistemo',
89468946
),
8947-
'grandfathered' =>
8947+
'grandfathered' =>
89488948
array (
89498949
0 => 'art-lojban',
89508950
1 => 'cel-gaulish',

tests/Registry/IanaSubtagRegistryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function provideValidScripts(): array
7676
return [
7777
'valid script' => ['Latn', true],
7878
'valid script lowercase' => ['latn', true],
79-
'invalid script' => ['Zzzz', false],
79+
'valid uncoded script' => ['Zzzz', true],
8080
];
8181
}
8282

@@ -85,7 +85,7 @@ public static function provideValidRegions(): array
8585
return [
8686
'valid region' => ['US', true],
8787
'valid region lowercase' => ['us', true],
88-
'invalid region' => ['ZZ', false],
88+
'valid unknown region' => ['ZZ', true],
8989
];
9090
}
9191

@@ -111,9 +111,9 @@ public static function provideValidLocales(): array
111111
'valid language only' => ['en', true],
112112
'valid language-region' => ['en-US', true],
113113
'valid language-script-region' => ['zh-Hans-CN', true],
114+
'valid Unknown or Invalid Territory Script in language-script-region' => ['en-Zzzz-US', true],
115+
'valid Unknown or Invalid Territory Region in language-region' => ['en-ZZ', true],
114116
'invalid language' => ['zz-US', false],
115-
'invalid script' => ['en-Zzzz-US', false],
116-
'invalid region' => ['en-ZZ', false],
117117
];
118118
}
119119
}

0 commit comments

Comments
 (0)