Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Theodore Brown <theodorejb@outlook.com>
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 23, 2024
1 parent aa9e3e6 commit 6b00456
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions releases/8.4/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Locale
public string $combinedCode {
get => \sprintf("%s_%s", $this->languageCode, $this->countryCode);
set (string $value) {
[$this->countryCode, $this->languageCode] = explode(' ', $value, 2);
[$this->countryCode, $this->languageCode] = explode('_', $value, 2);
}
}
Expand All @@ -119,8 +119,8 @@ class Locale
}
$brazilianPortuguese = new Locale('pt', 'br');
var_dump($brazilianPortuguese->getCountryCode()); // BR
var_dump($brazilianPortuguese->getCombinedCode()); // pt_BR
var_dump($brazilianPortuguese->countryCode); // BR
var_dump($brazilianPortuguese->combinedCode); // pt_BR
PHP
); ?>
</div>
Expand Down Expand Up @@ -253,11 +253,9 @@ $dom->loadHTML(<<<HTML
HTML, LIBXML_NOERROR);
$xpath = new DOMXPath($dom);
$query = $xpath->query(".//main/article[not(following-sibling::*)]");
foreach ($query as $node) {
$classes = explode(" ", $node->className); // Simplified
var_dump(in_array("featured", $classes)); // bool(true)
}
$node = $xpath->query(".//main/article[not(following-sibling::*)]")[0];
$classes = explode(" ", $node->className); // Simplified
var_dump(in_array("featured", $classes)); // bool(true)
PHP

); ?>
Expand All @@ -276,10 +274,8 @@ $dom = Dom\HTMLDocument::createFromString(<<<HTML
</main>
HTML, LIBXML_NOERROR);
$query = $dom->querySelectorAll('main > article:last-child');
foreach ($query as $node) {
var_dump($node->classList->contains("featured")); // bool(true)
}
$node = $dom->querySelector('main > article:last-child');
var_dump($node->classList->contains("featured")); // bool(true)
PHP
); ?>
</div>
Expand Down

0 comments on commit 6b00456

Please sign in to comment.