mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
eef26f7ae6
commit
639829f5c5
97 changed files with 305 additions and 185 deletions
|
@ -21,6 +21,7 @@
|
|||
namespace App\Helpers;
|
||||
|
||||
use Brick\Math\BigDecimal;
|
||||
use Brick\Math\BigNumber;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
|
||||
|
@ -36,7 +37,7 @@ class BigDecimalType extends Type
|
|||
/**
|
||||
* @param string|null $value
|
||||
*
|
||||
* @return BigDecimal|\Brick\Math\BigNumber|mixed
|
||||
* @return BigDecimal|BigNumber|mixed
|
||||
*/
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform)
|
||||
{
|
||||
|
|
|
@ -23,9 +23,12 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Helpers;
|
||||
|
||||
use DateTime;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
use function ord;
|
||||
|
||||
class LabelResponse extends Response
|
||||
{
|
||||
public function __construct($content = '', int $status = 200, array $headers = [])
|
||||
|
@ -63,7 +66,7 @@ class LabelResponse extends Response
|
|||
*/
|
||||
public function setAutoLastModified(): LabelResponse
|
||||
{
|
||||
$this->setLastModified(new \DateTime());
|
||||
$this->setLastModified(new DateTime());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -95,7 +98,7 @@ class LabelResponse extends Response
|
|||
for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) {
|
||||
$char = mb_substr($filename, $i, 1, $encoding);
|
||||
|
||||
if ('%' === $char || \ord($char) < 32 || \ord($char) > 126) {
|
||||
if ('%' === $char || ord($char) < 32 || ord($char) > 126) {
|
||||
$filenameFallback .= '_';
|
||||
} else {
|
||||
$filenameFallback .= $char;
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace App\Helpers\Trees;
|
|||
use App\Entity\Base\AbstractStructuralDBElement;
|
||||
use ArrayIterator;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use InvalidArgumentException;
|
||||
use RecursiveIterator;
|
||||
|
||||
final class StructuralDBElementIterator extends ArrayIterator implements RecursiveIterator
|
||||
|
@ -73,7 +74,7 @@ final class StructuralDBElementIterator extends ArrayIterator implements Recursi
|
|||
} elseif ($subelements instanceof Collection) {
|
||||
$array = $subelements->toArray();
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Invalid subelements type on $element!');
|
||||
throw new InvalidArgumentException('Invalid subelements type on $element!');
|
||||
}
|
||||
|
||||
return new self($array);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue