Skip to content

Commit 8ff33e7

Browse files
authored
Merge pull request #561 from ampproject/fix/php85
2 parents dd3b69e + 10f9fb5 commit 8ff33e7

File tree

8 files changed

+34
-19
lines changed

8 files changed

+34
-19
lines changed

.github/workflows/sync-local-fallback-files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Sync runtime local fallback files
22
on:
33
schedule:
44
# https://crontab.guru/once-a-week
5-
- cron: 0 0 * * 0
5+
- cron: 0 12 * */1 1
66

77
jobs:
88
sync-local-fallback-files:
@@ -92,5 +92,5 @@ jobs:
9292
github_token: ${{ secrets.GITHUB_TOKEN }}
9393
pr_title: Sync local fallback files
9494
pr_body: ${{ steps.body.outputs.text }}
95-
pr_reviewer: schlessera
95+
pr_reviewer: swissspidy
9696
pr_label: SSR

.github/workflows/sync-spec-test-suite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Sync spec test suite from NodeJS toolbox
22
on:
33
schedule:
44
# https://crontab.guru/every-night-at-midnight
5-
- cron: 0 0 * * *
5+
- cron: 0 12 * */1 1
66

77
jobs:
88
sync-spec-test-suite:
@@ -92,5 +92,5 @@ jobs:
9292
github_token: ${{ secrets.GITHUB_TOKEN }}
9393
pr_title: Sync spec test suite
9494
pr_body: ${{ steps.body.outputs.text }}
95-
pr_reviewer: schlessera
95+
pr_reviewer: swissspidy
9696
pr_label: Testing

src/Dom/Document/Filter/NormalizeHtmlEntities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ protected function hasHtmlEntities($html)
9292
{
9393
// TODO: Discuss other popular entities to look for, especially for languages
9494
// with different punctuation symbols.
95-
return preg_match('/,|.|!|?/', $html);
95+
return 1 === preg_match('/,|.|!|?/', $html);
9696
}
9797
}

src/FakeEnum.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,25 @@ public function __wakeup()
106106
}
107107
}
108108

109+
/**
110+
* This method exists only for the compatibility reason when deserializing a previously serialized version
111+
* that didn't have the key property.
112+
*
113+
* @param array $data Data to unserialize from.
114+
* @psalm-param array $data
115+
*/
116+
public function __unserialize(array $data): void
117+
{
118+
/** @psalm-suppress DocblockTypeContradiction key can be null when deserializing an enum without the key */
119+
if ($this->key === null) {
120+
/**
121+
* @psalm-suppress InaccessibleProperty key is not readonly as marked by psalm
122+
* @psalm-suppress PossiblyFalsePropertyAssignmentValue deserializing a case that was removed
123+
*/
124+
$this->key = static::search($this->value);
125+
}
126+
}
127+
109128
/**
110129
* Create a new enum instance from a value.
111130
*

src/Optimizer/Transformer/AmpRuntimePreloads.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function transform(Document $document, ErrorCollection $errors)
3737
* Check whether the AMP runtime script is needed.
3838
*
3939
* @param Document $document Document to check in.
40-
* @return bool Whether the AMP runtime script is needed.
40+
* @return false Whether the AMP runtime script is needed.
4141
*/
4242
private function isAmpRuntimeScriptNeeded(Document $document)
4343
{

src/Optimizer/Transformer/ReorderHead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ private function containsWord($haystack, $needle)
345345
return false;
346346
}
347347

348-
return preg_match('/(^|\s)' . preg_quote($needle, '/') . '(\s|$)/i', $haystack);
348+
return 1 === preg_match('/(^|\s)' . preg_quote($needle, '/') . '(\s|$)/i', $haystack);
349349
}
350350

351351
/**

tests/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)