升级thinkphp6.0.9
This commit is contained in:
1 parent
4fc07f7a6f
commit
9da53ff763
1370 files changed
+97986
-94249
No files matched your search
+13
-13
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user