Skip to content

Commit

Permalink
Make use of printf
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored Oct 29, 2023
1 parent 0c0118b commit 5609f68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/unipoints
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ EOT
function showInstalledUnicodeVersion(): int
{
if (!enum_exists(Block::class)) {
echo sprintf("The %s enum has not been created yet.\n", Block::class);
printf("The %s enum has not been created yet.\n", Block::class);
return 1;
}
$versionFromBlocks = UnicodeInfo::from(Block::class)->unicodeVersion;
if (!enum_exists(Codepoint::class)) {
echo sprintf("The %s enum has not been created yet.\n", Codepoint::class);
printf("The %s enum has not been created yet.\n", Codepoint::class);
return 1;
}
$versionFromCodepoints = UnicodeInfo::from(Codepoint::class)->unicodeVersion;
if (!enum_exists(Codepoint::class)) {
echo sprintf("The %s enum has not been created yet.\n", Codepoint::class);
printf("The %s enum has not been created yet.\n", Codepoint::class);
return 1;
}
if ($versionFromBlocks !== $versionFromCodepoints) {
echo sprintf("The version extracted from %s (%s) is different from the one extracted from %s (%s).\n", Block::class, $versionFromBlocks, Codepoint::class, $versionFromCodepoints);
printf("The version extracted from %s (%s) is different from the one extracted from %s (%s).\n", Block::class, $versionFromBlocks, Codepoint::class, $versionFromCodepoints);
return 1;
}
echo $versionFromBlocks, "\n";
Expand Down

0 comments on commit 5609f68

Please sign in to comment.