Skip to content

Commit

Permalink
fix more phpcs and psalm problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Boldewyn committed Feb 22, 2024
1 parent 088b03d commit 7706b84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions codepoints.net/lib/CachingMoLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ public function loadFile(string $file) : Translations {
if (! is_file($file_php)) {
$loader = new MoLoader();
$translations = $loader->loadFile($file);
// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
if (! @file_put_contents($file_php,
'<?php return unserialize(\'' . str_replace("'", "\\'", serialize($translations)) . '\');'."\n")) {
if (file_put_contents($file_php,
'<?php return unserialize(\'' . str_replace("'", "\\'", serialize($translations)) . '\');'."\n") === false) {
Analog::log('cannot create file '.$file_php);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion codepoints.net/lib/Controller/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __invoke($match, Array $env) : string {
'</svg>', join('', array_map(function(Array $image) : string { return $image['image']; }, $images)));
/* let the web server take over by storing already created images in
* their place in the docroot */
@file_put_contents(
file_put_contents(
dirname(dirname(__DIR__)).'/image/'.$canonical.'.svg',
$svg);
return $svg;
Expand Down
6 changes: 3 additions & 3 deletions codepoints.net/views/codepoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @var ?\Codepoints\Unicode\Block $block
* @var \Codepoints\Unicode\PropertyInfo $info
* @var ?Array{ name: ?string } $csur
* @var list<list<Codepoint>> $confusables
* @var ?list<list<Codepoint>> $confusables
* @var \Codepoints\Unicode\PropertyInfo $info
* @var Array $aliases
* @var string $title
Expand All @@ -18,7 +18,7 @@
* @var string $lang
* @var ?Array $wikipedia
* @var Array $othersites
* @var Array $relatives
* @var ?Array $relatives
* @var \Codepoints\Database $db
*/

Expand Down Expand Up @@ -123,7 +123,7 @@
<?php include 'partials/codepoint-representations.php' ?>
</section>

<?php if ($relatives!== NULL && $confusables !== NULL && count($relatives) + count($confusables)):?>
<?php if ($relatives!== null && $confusables !== null && count($relatives) + count($confusables)):?>
<section class="cpdesc cpdesc--relatives">
<h2><?=_q('Related Characters')?></h2>
<?php if (count($relatives)):?>
Expand Down

0 comments on commit 7706b84

Please sign in to comment.