升级thinkphp6.0.9

This commit is contained in:
瓜哥 committed 2021-07-25 21:00:40 +08:00
1 parent 4fc07f7a6f
commit 9da53ff763
1370 files changed
+97986 -94249

No files matched your search

+13 -13
View File
@@ -186,7 +186,7 @@ class Complex
// Set parsed values in our properties
$this->realPart = (float) $realPart;
$this->imaginaryPart = (float) $imaginaryPart;
$this->suffix = strtolower($suffix);
$this->suffix = strtolower($suffix ?? '');
}
/**
@@ -194,7 +194,7 @@ class Complex
*
* @return Float
*/
public function getReal()
public function getReal(): float
{
return $this->realPart;
}
@@ -204,7 +204,7 @@ class Complex
*
* @return Float
*/
public function getImaginary()
public function getImaginary(): float
{
return $this->imaginaryPart;
}
@@ -214,7 +214,7 @@ class Complex
*
* @return String
*/
public function getSuffix()
public function getSuffix(): string
{
return $this->suffix;
}
@@ -224,7 +224,7 @@ class Complex
*
* @return Bool
*/
public function isReal()
public function isReal(): bool
{
return $this->imaginaryPart == 0.0;
}
@@ -234,12 +234,12 @@ class Complex
*
* @return Bool
*/
public function isComplex()
public function isComplex(): bool
{
return !$this->isReal();
}
public function format()
public function format(): string
{
$str = "";
if ($this->imaginaryPart != 0.0) {
@@ -262,7 +262,7 @@ class Complex
return $str;
}
public function __toString()
public function __toString(): string
{
return $this->format();
}
@@ -274,7 +274,7 @@ class Complex
* @return Complex
* @throws Exception If the argument isn't a Complex number or cannot be converted to one
*/
public static function validateComplexArgument($complex)
public static function validateComplexArgument($complex): Complex
{
if (is_scalar($complex) || is_array($complex)) {
$complex = new Complex($complex);
@@ -290,7 +290,7 @@ class Complex
*
* @return Complex
*/
public function reverse()
public function reverse(): Complex
{
return new Complex(
$this->imaginaryPart,
@@ -299,7 +299,7 @@ class Complex
);
}
public function invertImaginary()
public function invertImaginary(): Complex
{
return new Complex(
$this->realPart,
@@ -308,7 +308,7 @@ class Complex
);
}
public function invertReal()
public function invertReal(): Complex
{
return new Complex(
$this->realPart * -1,
@@ -385,6 +385,6 @@ class Complex
$functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
return $functionName($this, ...$arguments);
}
throw new Exception('Function or Operation does not exist');
throw new Exception('Complex Function or Operation does not exist');
}
}
+5 -3
View File
@@ -23,7 +23,9 @@ namespace Complex;
* @see rho
*
*/
function abs($complex)
{
return rho($complex);
if (!function_exists(__NAMESPACE__ . '\\abs')) {
function abs($complex): float
{
return rho($complex);
}
}
+19 -17
View File
@@ -16,23 +16,25 @@ namespace Complex;
* @return Complex The inverse cosine of the complex argument.
* @throws Exception If argument isn't a valid real or complex number.
*/
function acos($complex)
{
$complex = Complex::validateComplexArgument($complex);
if (!function_exists(__NAMESPACE__ . '\\acos')) {
function acos($complex): Complex
{
$complex = Complex::validateComplexArgument($complex);
$square = clone $complex;
$square = multiply($square, $complex);
$invsqrt = new Complex(1.0);
$invsqrt = subtract($invsqrt, $square);
$invsqrt = sqrt($invsqrt);
$adjust = new Complex(
$complex->getReal() - $invsqrt->getImaginary(),
$complex->getImaginary() + $invsqrt->getReal()
);
$log = ln($adjust);
$square = clone $complex;
$square = multiply($square, $complex);
$invsqrt = new Complex(1.0);
$invsqrt = subtract($invsqrt, $square);
$invsqrt = sqrt($invsqrt);
$adjust = new Complex(
$complex->getReal() - $invsqrt->getImaginary(),
$complex->getImaginary() + $invsqrt->getReal()
);
$log = ln($adjust);
return new Complex(
$log->getImaginary(),
-1 * $log->getReal()
);
return new Complex(
$log->getImaginary(),
-1 * $log->getReal()
);
}
}
Loaded 3 of 1370 files, more files were not shown because too many files have changed in this diff. Show more