Minor fixes for some calls

This commit is contained in:
Clemens Schwaighofer
2024-11-18 14:52:36 +09:00
parent cb3d5e1f27
commit af0924eb25
4 changed files with 3 additions and 9 deletions

View File

@@ -10,7 +10,6 @@
"phpstan/phpstan": "^1.12",
"phan/phan": "^5.4",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^9",
"phpstan/phpstan-deprecation-rules": "^1.2",
"yamadashy/phpstan-friendly-formatter": "^1.1"

View File

@@ -54,7 +54,7 @@ function display(string $color, string $text, string $text_add): string
["{COLOR}", "{TEXT}", "{CSS}"],
[
$color,
$text . ($text_add ? '<br>' . $text_add : ''),
$text . (!empty($text_add) ? '<br>' . $text_add : ''),
$css
],
$template

View File

@@ -23,7 +23,6 @@ $log = new CoreLibs\Logging\Logging([
'log_file_id' => $LOG_FILE_ID,
'log_per_date' => true,
]);
$_math = new CoreLibs\Convert\Math();
$math_class = 'CoreLibs\Convert\Math';
// define a list of from to color sets for conversion test
@@ -35,13 +34,9 @@ print "<body>";
print '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
print "FCEIL: " . $_math->fceil(5.1234567890, 5) . "<br>";
print "FLOORP: " . $_math->floorp(5123456, -3) . "<br>";
print "FLOORP: " . $_math->floorp(5123456, -10) . "<br>";
print "INITNUMERIC: " . $_math->initNumeric('123') . "<br>";
print "S-FCEIL: " . $math_class::fceil(5.1234567890, 5) . "<br>";
print "S-FLOORP: " . $math_class::floorp(5123456, -3) . "<br>";
print "S-FLOORP: " . $math_class::floorp(5123456, -10) . "<br>";
print "S-INITNUMERIC: " . $math_class::initNumeric(123) . "<br>";
print "S-INITNUMERIC: " . $math_class::initNumeric(123.456) . "<br>";
print "S-INITNUMERIC: " . $math_class::initNumeric('123') . "<br>";

View File

@@ -264,7 +264,7 @@ class CieXyz
private static function linRgbToXyzD65(RGB $rgb): XYZ
{
// if not linear, convert to linear
if (!$rgb->get('linear')) {
if (!(bool)$rgb->get('linear')) {
$rgb = (new RGB($rgb->returnAsArray()))->toLinear();
}
return new XYZ(self::convertArray(Math::multiplyMatrices(