mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Fixed some deprecations.
This commit is contained in:
parent
4fa8eef1bf
commit
5fd608f42a
59 changed files with 202 additions and 165 deletions
|
@ -28,7 +28,7 @@ class BigDecimalType extends Type
|
|||
{
|
||||
public const BIG_DECIMAL = 'big_decimal';
|
||||
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
|
||||
{
|
||||
return $platform->getDecimalTypeDeclarationSQL($fieldDeclaration);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class BigDecimalType extends Type
|
|||
/**
|
||||
* @param BigDecimal|null $value
|
||||
*/
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform)
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
|
||||
{
|
||||
if (null === $value) {
|
||||
return null;
|
||||
|
@ -59,12 +59,12 @@ class BigDecimalType extends Type
|
|||
return (string) $value;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return self::BIG_DECIMAL;
|
||||
}
|
||||
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform)
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class LabelResponse extends Response
|
|||
parent::__construct($content, $status, $headers);
|
||||
}
|
||||
|
||||
public function setContent($content)
|
||||
public function setContent($content): self
|
||||
{
|
||||
parent::setContent($content);
|
||||
|
||||
|
@ -43,7 +43,7 @@ class LabelResponse extends Response
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function prepare(Request $request)
|
||||
public function prepare(Request $request): self
|
||||
{
|
||||
parent::prepare($request);
|
||||
|
||||
|
@ -81,13 +81,13 @@ class LabelResponse extends Response
|
|||
/**
|
||||
* Sets the Content-Disposition header with the given filename.
|
||||
*
|
||||
* @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
|
||||
* @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file
|
||||
* @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
|
||||
* @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
|
||||
* @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file
|
||||
* @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setContentDisposition($disposition, $filename, $filenameFallback = ''): self
|
||||
public function setContentDisposition(string $disposition, string $filename, string $filenameFallback = ''): self
|
||||
{
|
||||
if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || false !== strpos($filename, '%'))) {
|
||||
$encoding = mb_detect_encoding($filename, null, true) ?: '8bit';
|
||||
|
|
|
@ -94,7 +94,7 @@ final class TreeViewNodeState implements JsonSerializable
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function jsonSerialize()
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
$ret = [];
|
||||
if (null !== $this->selected) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class UTCDateTimeType extends DateTimeType
|
|||
{
|
||||
private static $utc_timezone;
|
||||
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform)
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
|
||||
{
|
||||
if (!self::$utc_timezone) {
|
||||
self::$utc_timezone = new DateTimeZone('UTC');
|
||||
|
@ -69,7 +69,7 @@ class UTCDateTimeType extends DateTimeType
|
|||
return parent::convertToDatabaseValue($value, $platform);
|
||||
}
|
||||
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform)
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform): ?DateTime
|
||||
{
|
||||
if (!self::$utc_timezone) {
|
||||
self::$utc_timezone = new DateTimeZone('UTC');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue