diff --git a/rector.php b/rector.php index 19eae536..a73ac62e 100644 --- a/rector.php +++ b/rector.php @@ -13,6 +13,7 @@ $rectorConfig->sets([ DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES, SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES, + SymfonySetList::SYMFONY_62, SensiolabsSetList::FRAMEWORK_EXTRA_61, LevelSetList::UP_TO_PHP_81, SetList::CODE_QUALITY, diff --git a/src/Entity/City.php b/src/Entity/City.php index b554d518..d7b89f10 100644 --- a/src/Entity/City.php +++ b/src/Entity/City.php @@ -38,7 +38,7 @@ class City private $metro_stations; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $title; + private ?string $title = null; public function __construct() { diff --git a/src/Entity/Currency.php b/src/Entity/Currency.php index be2d1278..a53ba523 100644 --- a/src/Entity/Currency.php +++ b/src/Entity/Currency.php @@ -15,16 +15,16 @@ class Currency use EntityIdTrait; #[ORM\Column(type: Types::STRING, length: 32)] - private ?string $currency_title; + private ?string $currency_title = null; #[ORM\Column(type: Types::STRING, length: 3)] - private ?string $code; + private ?string $code = null; #[ORM\Column(type: Types::STRING, length: 12, nullable: true)] - private ?string $symbol_left; + private ?string $symbol_left = null; #[ORM\Column(type: Types::STRING, length: 12, nullable: true)] - private ?string $symbol_right; + private ?string $symbol_right = null; public function getCurrencyTitle(): ?string { diff --git a/src/Entity/Feature.php b/src/Entity/Feature.php index ed19b9f3..bced324e 100644 --- a/src/Entity/Feature.php +++ b/src/Entity/Feature.php @@ -17,13 +17,13 @@ class Feature use EntityIdTrait; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $name; + private ?string $name = null; #[ORM\ManyToMany(targetEntity: Property::class, mappedBy: 'features')] private $properties; #[ORM\Column(type: Types::TEXT, nullable: true)] - private ?string $icon; + private ?string $icon = null; public function __construct() { diff --git a/src/Entity/Menu.php b/src/Entity/Menu.php index 7b4eadba..5c58e805 100644 --- a/src/Entity/Menu.php +++ b/src/Entity/Menu.php @@ -19,22 +19,22 @@ class Menu use EntityIdTrait; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $title; + private ?string $title = null; #[ORM\Column(type: Types::STRING, length: 2)] private string $locale; #[ORM\Column(type: Types::SMALLINT, nullable: true)] - private ?int $sort_order; + private ?int $sort_order = null; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $url; + private ?string $url = null; #[ORM\Column(type: Types::BOOLEAN, nullable: true)] - private ?bool $nofollow; + private ?bool $nofollow = null; #[ORM\Column(type: Types::BOOLEAN, nullable: true)] - private ?bool $new_tab; + private ?bool $new_tab = null; public function getTitle(): ?string { diff --git a/src/Entity/Page.php b/src/Entity/Page.php index 7226a23c..b8a114ed 100644 --- a/src/Entity/Page.php +++ b/src/Entity/Page.php @@ -20,29 +20,29 @@ class Page use EntityIdTrait; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $title; + private ?string $title = null; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $description; + private ?string $description = null; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $slug; + private ?string $slug = null; #[ORM\Column(type: Types::STRING, length: 2, options: ['default' => 'en'])] private string $locale; #[ORM\Column(type: Types::TEXT, nullable: true)] - private ?string $content; + private ?string $content = null; #[ORM\Column(type: Types::BOOLEAN)] - private ?bool $show_in_menu; + private ?bool $show_in_menu = null; #[ORM\Column(type: Types::BOOLEAN)] - private ?bool $add_contact_form; + private ?bool $add_contact_form = null; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] #[Assert\Email] - private ?string $contact_email_address; + private ?string $contact_email_address = null; public function getTitle(): ?string { diff --git a/src/Entity/Photo.php b/src/Entity/Photo.php index 32f1c778..6f5522d5 100644 --- a/src/Entity/Photo.php +++ b/src/Entity/Photo.php @@ -24,7 +24,7 @@ class Photo private $photo; #[ORM\Column(type: Types::INTEGER, nullable: true)] - private ?int $sort_order; + private ?int $sort_order = null; public function getProperty(): ?Property { diff --git a/src/Entity/Profile.php b/src/Entity/Profile.php index f28ef3b2..5d2bb66b 100644 --- a/src/Entity/Profile.php +++ b/src/Entity/Profile.php @@ -15,10 +15,10 @@ class Profile use EntityIdTrait; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $full_name; + private ?string $full_name = null; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $phone; + private ?string $phone = null; #[ORM\OneToOne(inversedBy: 'profile', targetEntity: User::class, cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] diff --git a/src/Entity/PropertyDescription.php b/src/Entity/PropertyDescription.php index a6532d7a..be545017 100644 --- a/src/Entity/PropertyDescription.php +++ b/src/Entity/PropertyDescription.php @@ -17,10 +17,10 @@ class PropertyDescription use EntityMetaTrait; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $title; + private ?string $title = null; #[ORM\Column(type: Types::TEXT, nullable: true)] - private ?string $content; + private ?string $content = null; #[ORM\OneToOne(inversedBy: 'propertyDescription', targetEntity: Property::class, cascade: ['persist', 'remove'])] #[ORM\JoinColumn(nullable: false)] diff --git a/src/Entity/Settings.php b/src/Entity/Settings.php index 36cb5d99..16346ba6 100644 --- a/src/Entity/Settings.php +++ b/src/Entity/Settings.php @@ -17,10 +17,10 @@ class Settings use EntityIdTrait; #[ORM\Column(type: Types::STRING, length: 191, unique: true)] - private ?string $setting_name; + private ?string $setting_name = null; #[ORM\Column(type: Types::TEXT, nullable: true)] - private ?string $setting_value; + private ?string $setting_value = null; public function getSettingName(): ?string { diff --git a/src/Entity/Traits/EntityIdTrait.php b/src/Entity/Traits/EntityIdTrait.php index 98456fbb..f7f371c2 100644 --- a/src/Entity/Traits/EntityIdTrait.php +++ b/src/Entity/Traits/EntityIdTrait.php @@ -12,7 +12,7 @@ trait EntityIdTrait #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: Types::INTEGER)] - private ?int $id; + private ?int $id = null; public function getId(): ?int { diff --git a/src/Entity/Traits/EntityLocationTrait.php b/src/Entity/Traits/EntityLocationTrait.php index ee5b7870..33854e89 100644 --- a/src/Entity/Traits/EntityLocationTrait.php +++ b/src/Entity/Traits/EntityLocationTrait.php @@ -14,24 +14,24 @@ trait EntityLocationTrait { #[ORM\ManyToOne(targetEntity: District::class, inversedBy: 'properties')] #[ORM\JoinColumn(nullable: true)] - private ?District $district; + private ?District $district = null; #[ORM\ManyToOne(targetEntity: Neighborhood::class, inversedBy: 'properties')] #[ORM\JoinColumn(nullable: true)] - private ?Neighborhood $neighborhood; + private ?Neighborhood $neighborhood = null; #[ORM\ManyToOne(targetEntity: Metro::class, inversedBy: 'properties')] #[ORM\JoinColumn(nullable: true)] - private ?Metro $metro_station; + private ?Metro $metro_station = null; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $address; + private ?string $address = null; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $latitude; + private ?string $latitude = null; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $longitude; + private ?string $longitude = null; public function getDistrict(): ?District { diff --git a/src/Entity/Traits/EntityMetaTrait.php b/src/Entity/Traits/EntityMetaTrait.php index a65a47ef..3389442d 100644 --- a/src/Entity/Traits/EntityMetaTrait.php +++ b/src/Entity/Traits/EntityMetaTrait.php @@ -10,10 +10,10 @@ trait EntityMetaTrait { #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $meta_title; + private ?string $meta_title = null; #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] - private ?string $meta_description; + private ?string $meta_description = null; public function getMetaTitle(): ?string { diff --git a/src/Entity/Traits/EntityNameTrait.php b/src/Entity/Traits/EntityNameTrait.php index b2e85e6c..604c8a40 100644 --- a/src/Entity/Traits/EntityNameTrait.php +++ b/src/Entity/Traits/EntityNameTrait.php @@ -10,10 +10,10 @@ trait EntityNameTrait { #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $name; + private ?string $name = null; #[ORM\Column(type: Types::STRING, length: 255)] - private ?string $slug; + private ?string $slug = null; public function getName(): ?string { diff --git a/src/Entity/Traits/EntityTimestampableTrait.php b/src/Entity/Traits/EntityTimestampableTrait.php index f7cb03b8..fd260f66 100644 --- a/src/Entity/Traits/EntityTimestampableTrait.php +++ b/src/Entity/Traits/EntityTimestampableTrait.php @@ -10,10 +10,10 @@ trait EntityTimestampableTrait { #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])] - private ?\DateTimeInterface $createdAt; + private ?\DateTimeInterface $createdAt = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])] - private ?\DateTimeInterface $updatedAt; + private ?\DateTimeInterface $updatedAt = null; public function getCreatedAt(): ?\DateTimeInterface { diff --git a/src/Entity/User.php b/src/Entity/User.php index 46b32836..b56db98a 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -40,17 +40,11 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, TwoFact #[Assert\NotBlank] #[Assert\Length(min: 2, max: 50)] private $username; - /** - * @var string - */ #[ORM\Column(type: Types::STRING, unique: true)] #[Assert\Email] - private $email; - /** - * @var string - */ + private ?string $email = null; #[ORM\Column(type: Types::STRING)] - private $password; + private ?string $password = null; #[ORM\Column(type: Types::JSON)] private array $roles = []; @@ -65,7 +59,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, TwoFact private $password_requested_at; #[ORM\OneToOne(mappedBy: 'user', targetEntity: Profile::class, cascade: ['persist', 'remove'])] - private ?Profile $profile; + private ?Profile $profile = null; #[ORM\Column(type: Types::DATETIMETZ_MUTABLE, nullable: true)] private $emailVerifiedAt; diff --git a/tests/Functional/Controller/DefaultControllerTest.php b/tests/Functional/Controller/DefaultControllerTest.php index 75623693..29366fbf 100644 --- a/tests/Functional/Controller/DefaultControllerTest.php +++ b/tests/Functional/Controller/DefaultControllerTest.php @@ -40,7 +40,7 @@ public function testSecureUrls(string $url): void */ public function testMenuItems(string $url): void { - $client = static::createClient(); + $client = DefaultControllerTest::createClient(); $crawler = $client->request('GET', '/'); $link = $crawler->filter(sprintf('a[href="%s"]', $url))->link(); $urlFound = $link->getUri();