mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -73,20 +73,11 @@ class OverlapsI extends FunctionNode
|
||||
|
||||
protected function makeCase($sqlWalker, $part, string $position): string
|
||||
{
|
||||
switch ($position) {
|
||||
case 'start':
|
||||
$p = '-infinity';
|
||||
|
||||
break;
|
||||
|
||||
case 'end':
|
||||
$p = 'infinity';
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Exception('Unexpected position value.');
|
||||
}
|
||||
$p = match ($position) {
|
||||
'start' => '-infinity',
|
||||
'end' => 'infinity',
|
||||
default => throw new Exception('Unexpected position value.'),
|
||||
};
|
||||
|
||||
if ($part instanceof PathExpression) {
|
||||
return sprintf(
|
||||
|
@@ -22,11 +22,8 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class TrackCreateUpdateSubscriber implements EventSubscriber
|
||||
{
|
||||
private Security $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
public function __construct(private Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function getSubscribedEvents()
|
||||
|
@@ -20,14 +20,8 @@ class Point implements JsonSerializable
|
||||
{
|
||||
public static string $SRID = '4326';
|
||||
|
||||
private ?float $lat;
|
||||
|
||||
private ?float $lon;
|
||||
|
||||
private function __construct(?float $lon, ?float $lat)
|
||||
private function __construct(private ?float $lon, private ?float $lat)
|
||||
{
|
||||
$this->lat = $lat;
|
||||
$this->lon = $lon;
|
||||
}
|
||||
|
||||
public static function fromArrayGeoJson(array $array): self
|
||||
|
@@ -91,28 +91,12 @@ class NativeDateIntervalType extends DateIntervalType
|
||||
if (is_numeric($current)) {
|
||||
$next = next($strings);
|
||||
|
||||
switch ($next) {
|
||||
case 'year':
|
||||
case 'years':
|
||||
$unit = 'Y';
|
||||
|
||||
break;
|
||||
|
||||
case 'mon':
|
||||
case 'mons':
|
||||
$unit = 'M';
|
||||
|
||||
break;
|
||||
|
||||
case 'day':
|
||||
case 'days':
|
||||
$unit = 'D';
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw $this->createConversionException(implode('', $strings));
|
||||
}
|
||||
$unit = match ($next) {
|
||||
'year', 'years' => 'Y',
|
||||
'mon', 'mons' => 'M',
|
||||
'day', 'days' => 'D',
|
||||
default => throw $this->createConversionException(implode('', $strings)),
|
||||
};
|
||||
|
||||
return $current . $unit;
|
||||
}
|
||||
|
@@ -44,10 +44,8 @@ class PointType extends Type
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return ?Point
|
||||
*/
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform)
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform): ?\Chill\MainBundle\Doctrine\Model\Point
|
||||
{
|
||||
if (null === $value) {
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user