Skip to content

Commit 97f9d85

Browse files
committed
Use diff patching for Faker
1 parent 33ea56b commit 97f9d85

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.github/patches/Base.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/vendor/fakerphp/faker/src/Faker/Provider/Base.php b/vendor/fakerphp/faker/src/Faker/Provider/Base.php
2+
index 4ff4492..a6b69c4 100644
3+
--- a/vendor/fakerphp/faker/src/Faker/Provider/Base.php
4+
+++ b/vendor/fakerphp/faker/src/Faker/Provider/Base.php
5+
@@ -369,6 +369,14 @@ class Base
6+
return $string;
7+
}
8+
9+
+ if (strpos($callback, '::') !== false) {
10+
+ $parts = explode('::', $callback, 2);
11+
+
12+
+ if (strtolower($parts[0]) === 'static') {
13+
+ $callback = static::class . '::' . $parts[1];
14+
+ }
15+
+ }
16+
+
17+
for ($i = $pos, $last = strrpos($string, $wildcard, $pos) + 1; $i < $last; ++$i) {
18+
if ($string[$i] === $wildcard) {
19+
$string[$i] = call_user_func($callback);

.github/workflows/test-phpunit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ jobs:
153153
composer update --ansi --no-interaction ${{ matrix.composer-option }}
154154
composer remove --ansi --dev --unused ${{ matrix.composer-option }} -W -- rector/rector phpstan/phpstan friendsofphp/php-cs-fixer nexusphp/cs-config codeigniter/coding-standard
155155
156+
- name: Apply patch to Faker
157+
if: matrix.php-versions == '8.2'
158+
run: git apply --verbose .github/patches/Base.patch
159+
156160
- name: Profile slow tests in PHP ${{ env.COVERAGE_PHP_VERSION }}
157161
if: matrix.php-versions == env.COVERAGE_PHP_VERSION
158162
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV

0 commit comments

Comments
 (0)