mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-07 19:49:30 +00:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
|
@ -27,7 +27,7 @@ use Doctrine\DBAL\Types\Type;
|
|||
|
||||
class BigDecimalType extends Type
|
||||
{
|
||||
public const BIG_DECIMAL = 'big_decimal';
|
||||
final public const BIG_DECIMAL = 'big_decimal';
|
||||
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
|
||||
{
|
||||
|
|
@ -53,7 +53,7 @@ class BigDecimalType extends Type
|
|||
*/
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
|
||||
{
|
||||
if (null === $value) {
|
||||
if (!$value instanceof \Brick\Math\BigDecimal) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class UTCDateTimeType extends DateTimeType
|
|||
*/
|
||||
public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
|
||||
{
|
||||
if (!self::$utc_timezone) {
|
||||
if (!self::$utc_timezone instanceof \DateTimeZone) {
|
||||
self::$utc_timezone = new DateTimeZone('UTC');
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ class UTCDateTimeType extends DateTimeType
|
|||
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform): ?DateTime
|
||||
{
|
||||
if (!self::$utc_timezone) {
|
||||
if (!self::$utc_timezone instanceof \DateTimeZone) {
|
||||
self::$utc_timezone = new DateTimeZone('UTC');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue