apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -11,12 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Model;
use Exception;
use JsonSerializable;
use function json_encode;
class Point implements JsonSerializable
class Point implements \JsonSerializable
{
public static string $SRID = '4326';
@@ -28,7 +23,7 @@ class Point implements JsonSerializable
return self::fromLonLat($array['coordinates'][0], $array['coordinates'][1]);
}
throw new Exception('Unable to build a point from input data.');
throw new \Exception('Unable to build a point from input data.');
}
public static function fromGeoJson(string $geojson): self
@@ -88,7 +83,7 @@ class Point implements JsonSerializable
{
$array = $this->toArrayGeoJson();
return json_encode($array, JSON_THROW_ON_ERROR);
return \json_encode($array, JSON_THROW_ON_ERROR);
}
public function toWKT(): string

View File

@@ -11,12 +11,10 @@ declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Model;
use Exception;
/**
* Description of PointException.
*/
class PointException extends Exception
class PointException extends \Exception
{
public static function badCoordinates($lon, $lat): self
{

View File

@@ -12,11 +12,10 @@ declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Model;
use Chill\MainBundle\Entity\User;
use DateTimeInterface;
interface TrackCreationInterface
{
public function setCreatedAt(DateTimeInterface $datetime): self;
public function setCreatedAt(\DateTimeInterface $datetime): self;
public function setCreatedBy(User $user): self;
}

View File

@@ -13,8 +13,6 @@ namespace Chill\MainBundle\Doctrine\Model;
use Chill\MainBundle\Entity\User;
use DateTime;
use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
@@ -22,18 +20,21 @@ trait TrackCreationTrait
{
/**
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": NULL})
*
* @Serializer\Groups({"read"})
*/
private ?DateTimeImmutable $createdAt = null;
private ?\DateTimeImmutable $createdAt = null;
/**
* @ORM\ManyToOne(targetEntity=User::class)
*
* @ORM\JoinColumn(nullable=true)
*
* @Serializer\Groups({"read"})
*/
private ?User $createdBy = null;
public function getCreatedAt(): ?DateTimeInterface
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
@@ -43,9 +44,9 @@ trait TrackCreationTrait
return $this->createdBy;
}
public function setCreatedAt(DateTimeInterface $datetime): self
public function setCreatedAt(\DateTimeInterface $datetime): self
{
$this->createdAt = $datetime instanceof DateTime ? DateTimeImmutable::createFromMutable($datetime) : $datetime;
$this->createdAt = $datetime instanceof \DateTime ? \DateTimeImmutable::createFromMutable($datetime) : $datetime;
return $this;
}

View File

@@ -12,11 +12,10 @@ declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Model;
use Chill\MainBundle\Entity\User;
use DateTimeInterface;
interface TrackUpdateInterface
{
public function setUpdatedAt(DateTimeInterface $datetime): self;
public function setUpdatedAt(\DateTimeInterface $datetime): self;
public function setUpdatedBy(User $user): self;
}

View File

@@ -13,8 +13,6 @@ namespace Chill\MainBundle\Doctrine\Model;
use Chill\MainBundle\Entity\User;
use DateTime;
use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
@@ -22,18 +20,21 @@ trait TrackUpdateTrait
{
/**
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": NULL})
*
* @Serializer\Groups({"read"})
*/
private ?DateTimeImmutable $updatedAt = null;
private ?\DateTimeImmutable $updatedAt = null;
/**
* @ORM\ManyToOne(targetEntity=User::class)
*
* @ORM\JoinColumn(nullable=true)
*
* @Serializer\Groups({"read"})
*/
private ?User $updatedBy = null;
public function getUpdatedAt(): ?DateTimeInterface
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
@@ -43,9 +44,9 @@ trait TrackUpdateTrait
return $this->updatedBy;
}
public function setUpdatedAt(DateTimeInterface $datetime): self
public function setUpdatedAt(\DateTimeInterface $datetime): self
{
$this->updatedAt = $datetime instanceof DateTime ? DateTimeImmutable::createFromMutable($datetime) : $datetime;
$this->updatedAt = $datetime instanceof \DateTime ? \DateTimeImmutable::createFromMutable($datetime) : $datetime;
return $this;
}