From dcc9c911aefdd9fabadbee32e8c881a887739327 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 4 Dec 2023 15:19:20 +0100 Subject: [PATCH] Rework after first review round --- .../Entity/AccessibilityCertification.php | 40 +++----------- .../Entity/AccessibilitySpecification.php | 40 +++----------- Classes/Domain/Import/Entity/Base.php | 7 +-- Classes/Domain/Import/Entity/MediaObject.php | 20 ++----- Classes/Domain/Import/Entity/Minimum.php | 14 ++--- Classes/Domain/Import/Entity/Person.php | 10 +--- Classes/Domain/Import/Entity/Place.php | 34 ++++-------- .../Import/Entity/Properties/Address.php | 30 ++-------- .../Import/Entity/Properties/DayOfWeek.php | 5 +- .../Entity/Properties/ForeignReference.php | 4 +- .../Domain/Import/Entity/Properties/Geo.php | 10 +--- .../Domain/Import/Entity/Properties/Offer.php | 4 +- .../Import/Entity/Properties/OpeningHour.php | 22 ++------ .../Entity/Properties/PriceSpecification.php | 13 +---- .../Domain/Import/Entity/Shared/ManagedBy.php | 4 +- .../Import/Entity/Shared/Organization.php | 2 +- .../Import/Entity/TouristAttraction.php | 35 ++++-------- .../Import/EntityMapper/EntityRegistry.php | 2 +- .../Domain/Import/EntityMapper/JsonDecode.php | 3 +- .../Import/EntityMapper/MappingException.php | 10 +--- Classes/Domain/Import/Import.php | 14 ++--- Classes/Domain/Import/Importer.php | 10 +--- Classes/Domain/Import/Importer/FetchData.php | 10 +--- Classes/Domain/Import/Importer/SaveData.php | 2 +- .../Domain/Import/Model/EntityCollection.php | 2 +- Classes/Domain/Import/Model/GenericEntity.php | 32 +++-------- .../Typo3Converter/GeneralConverter.php | 12 +--- .../Import/Typo3Converter/NameExtractor.php | 5 +- .../Domain/Import/Typo3Converter/Registry.php | 2 +- .../UrlProvider/ContainsPlaceUrlProvider.php | 5 +- .../Domain/Import/UrlProvider/Registry.php | 2 +- .../Import/UrlProvider/StaticUrlProvider.php | 2 +- .../UrlProvider/SyncScopeUrlProvider.php | 5 +- .../Domain/Model/Backend/AbstractEntity.php | 20 ++----- .../Model/Backend/ImportConfiguration.php | 28 +++------- Classes/Domain/Model/Backend/ImportLog.php | 12 +--- .../Backend/ImportLogEntry/MappingError.php | 10 +--- .../Backend/ImportLogEntry/SavingEntity.php | 32 +++-------- Classes/Domain/Model/Backend/Organisation.php | 4 +- Classes/Domain/Model/Backend/Town.php | 2 +- .../Frontend/AccessiblitySpecification.php | 7 +-- Classes/Domain/Model/Frontend/Address.php | 7 +-- Classes/Domain/Model/Frontend/Base.php | 15 +---- Classes/Domain/Model/Frontend/Media.php | 9 +-- .../Model/Frontend/MergedOpeningHour.php | 12 +--- .../Frontend/MergedOpeningHourWeekDay.php | 15 +---- .../Model/Frontend/MergedOpeningHours.php | 7 +-- Classes/Domain/Model/Frontend/Offer.php | 14 ++--- Classes/Domain/Model/Frontend/Offers.php | 14 ++--- Classes/Domain/Model/Frontend/OpeningHour.php | 22 ++------ .../Domain/Model/Frontend/OpeningHours.php | 12 +--- Classes/Domain/Model/Frontend/Place.php | 52 ++++-------------- Classes/Domain/Model/Frontend/Price.php | 40 ++------------ .../Model/Frontend/TouristAttraction.php | 55 ++++--------------- .../DataProcessing/ResolveEntities.php | 5 +- .../FilterBasedOnTypo3Context.php | 8 +-- .../DataMapping/AfterObjectThawedHandler.php | 16 +----- Configuration/Extbase/Persistence/Classes.php | 6 -- .../TCA/tx_thuecat_import_log_entry.php | 2 - .../TCA/tx_thuecat_parking_facility.php | 13 +++-- .../TCA/tx_thuecat_tourist_attraction.php | 11 +++- Tests/Functional/AbstractImportTestCase.php | 10 ++-- 62 files changed, 217 insertions(+), 655 deletions(-) diff --git a/Classes/Domain/Import/Entity/AccessibilityCertification.php b/Classes/Domain/Import/Entity/AccessibilityCertification.php index 986027e..761e7dd 100644 --- a/Classes/Domain/Import/Entity/AccessibilityCertification.php +++ b/Classes/Domain/Import/Entity/AccessibilityCertification.php @@ -27,45 +27,21 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues; class AccessibilityCertification implements MapsToType { - /** - * @var string - */ - protected $accessibilityCertificationStatus = ''; + protected string $accessibilityCertificationStatus = ''; - /** - * @var string - */ - protected $certificationAccessibilityDeaf = ''; + protected string $certificationAccessibilityDeaf = ''; - /** - * @var string - */ - protected $certificationAccessibilityMental = ''; + protected string $certificationAccessibilityMental = ''; - /** - * @var string - */ - protected $certificationAccessibilityPartiallyDeaf = ''; + protected string $certificationAccessibilityPartiallyDeaf = ''; - /** - * @var string - */ - protected $certificationAccessibilityPartiallyVisual = ''; + protected string $certificationAccessibilityPartiallyVisual = ''; - /** - * @var string - */ - protected $certificationAccessibilityVisual = ''; + protected string $certificationAccessibilityVisual = ''; - /** - * @var string - */ - protected $certificationAccessibilityWalking = ''; + protected string $certificationAccessibilityWalking = ''; - /** - * @var string - */ - protected $certificationAccessibilityWheelchair = ''; + protected string $certificationAccessibilityWheelchair = ''; public function getAccessibilityCertificationStatus(): string { diff --git a/Classes/Domain/Import/Entity/AccessibilitySpecification.php b/Classes/Domain/Import/Entity/AccessibilitySpecification.php index 8f788d9..68ca3bd 100644 --- a/Classes/Domain/Import/Entity/AccessibilitySpecification.php +++ b/Classes/Domain/Import/Entity/AccessibilitySpecification.php @@ -27,45 +27,21 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues; class AccessibilitySpecification implements MapsToType { - /** - * @var AccessibilityCertification - */ - protected $accessibilityCertification; + protected AccessibilityCertification $accessibilityCertification; - /** - * @var array - */ - protected $accessibilitySearchCriteria = []; + protected array $accessibilitySearchCriteria = []; - /** - * @var string - */ - protected $shortDescriptionAccessibilityAllGenerations = ''; + protected string $shortDescriptionAccessibilityAllGenerations = ''; - /** - * @var string - */ - protected $shortDescriptionAccessibilityAllergic = ''; + protected string $shortDescriptionAccessibilityAllergic = ''; - /** - * @var string - */ - protected $shortDescriptionAccessibilityDeaf = ''; + protected string $shortDescriptionAccessibilityDeaf = ''; - /** - * @var string - */ - protected $shortDescriptionAccessibilityMental = ''; + protected string $shortDescriptionAccessibilityMental = ''; - /** - * @var string - */ - protected $shortDescriptionAccessibilityVisual = ''; + protected string $shortDescriptionAccessibilityVisual = ''; - /** - * @var string - */ - protected $shortDescriptionAccessibilityWalking = ''; + protected string $shortDescriptionAccessibilityWalking = ''; public function getAccessibilityCertification(): ?AccessibilityCertification { diff --git a/Classes/Domain/Import/Entity/Base.php b/Classes/Domain/Import/Entity/Base.php index cd79747..c3a92ec 100644 --- a/Classes/Domain/Import/Entity/Base.php +++ b/Classes/Domain/Import/Entity/Base.php @@ -30,17 +30,14 @@ class Base extends Minimum { use ManagedBy; - /** - * @var ForeignReference - */ - protected $photo; + protected ForeignReference $photo; /** * Images of this Thing. * * @var ForeignReference[] */ - protected $images = []; + protected array $images = []; public function getPhoto(): ?ForeignReference { diff --git a/Classes/Domain/Import/Entity/MediaObject.php b/Classes/Domain/Import/Entity/MediaObject.php index 175c0e0..7026acf 100644 --- a/Classes/Domain/Import/Entity/MediaObject.php +++ b/Classes/Domain/Import/Entity/MediaObject.php @@ -27,30 +27,18 @@ use WerkraumMedia\ThueCat\Domain\Import\Entity\Properties\ForeignReference; class MediaObject extends Minimum implements MapsToType { - /** - * @var int - */ - protected $copyrightYear = 0; + protected int $copyrightYear = 0; - /** - * @var string - */ - protected $license = ''; + protected string $license = ''; - /** - * @var string - */ - protected $licenseAuthor = ''; + protected string $licenseAuthor = ''; /** * @var string|ForeignReference */ protected $author; - /** - * @var string - */ - protected $type = ''; + protected string $type = ''; public function getCopyrightYear(): int { diff --git a/Classes/Domain/Import/Entity/Minimum.php b/Classes/Domain/Import/Entity/Minimum.php index 525fe50..b8424d9 100644 --- a/Classes/Domain/Import/Entity/Minimum.php +++ b/Classes/Domain/Import/Entity/Minimum.php @@ -29,33 +29,27 @@ abstract class Minimum * URL to the original source at ThüCAT. * Not unique within our system. We have one entity per language, * while ThüCAT has a single entity containing all languages. - * - * @var string */ - protected $id = ''; + protected string $id = ''; /** * Short name of the thing. * Can be translated. - * - * @var string */ - protected $name = ''; + protected string $name = ''; /** * Long text describing the thing. * Can be translated. - * - * @var string */ - protected $description = ''; + protected string $description = ''; /** * URL to official version of this thing outside of ThüCAT. * * @var string[] */ - protected $urls = []; + protected array $urls = []; public function getId(): string { diff --git a/Classes/Domain/Import/Entity/Person.php b/Classes/Domain/Import/Entity/Person.php index d30c2fb..4bb692e 100644 --- a/Classes/Domain/Import/Entity/Person.php +++ b/Classes/Domain/Import/Entity/Person.php @@ -25,15 +25,9 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity; class Person extends Base implements MapsToType { - /** - * @var string - */ - protected $givenName = ''; + protected string $givenName = ''; - /** - * @var string - */ - protected $familyName = ''; + protected string $familyName = ''; public function getGivenName(): string { diff --git a/Classes/Domain/Import/Entity/Place.php b/Classes/Domain/Import/Entity/Place.php index 21d1623..7500e82 100644 --- a/Classes/Domain/Import/Entity/Place.php +++ b/Classes/Domain/Import/Entity/Place.php @@ -39,60 +39,48 @@ class Place extends Base use Organization; use ContainedInPlace; - /** - * @var Address - */ - protected $address; + protected Address $address; - /** - * @var Geo - */ - protected $geo; + protected Geo $geo; /** * @var OpeningHour[] */ - protected $openingHoursSpecifications = []; + protected array $openingHoursSpecifications = []; /** * @var OpeningHour[] */ - protected $specialOpeningHours = []; + protected array $specialOpeningHours = []; /** * @var ForeignReference[] */ - protected $parkingFacilitiesNearBy = []; + protected array $parkingFacilitiesNearBy = []; /** * @var string[] */ - protected $sanitations = []; + protected array $sanitations = []; /** * @var string[] */ - protected $otherServices = []; + protected array $otherServices = []; /** * @var string[] */ - protected $trafficInfrastructures = []; + protected array $trafficInfrastructures = []; /** * @var string[] */ - protected $paymentsAccepted = []; + protected array $paymentsAccepted = []; - /** - * @var string - */ - protected $distanceToPublicTransport = ''; + protected string $distanceToPublicTransport = ''; - /** - * @var ForeignReference - */ - protected $accessibilitySpecification; + protected ForeignReference $accessibilitySpecification; public function getAddress(): ?Address { diff --git a/Classes/Domain/Import/Entity/Properties/Address.php b/Classes/Domain/Import/Entity/Properties/Address.php index 0776e5d..587c4bc 100644 --- a/Classes/Domain/Import/Entity/Properties/Address.php +++ b/Classes/Domain/Import/Entity/Properties/Address.php @@ -25,35 +25,17 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity\Properties; class Address { - /** - * @var string - */ - protected $streetAddress = ''; + protected string $streetAddress = ''; - /** - * @var string - */ - protected $addressLocality = ''; + protected string $addressLocality = ''; - /** - * @var string - */ - protected $postalCode = ''; + protected string $postalCode = ''; - /** - * @var string - */ - protected $telephone = ''; + protected string $telephone = ''; - /** - * @var string - */ - protected $faxNumber = ''; + protected string $faxNumber = ''; - /** - * @var string - */ - protected $email = ''; + protected string $email = ''; public function getStreetAddress(): string { diff --git a/Classes/Domain/Import/Entity/Properties/DayOfWeek.php b/Classes/Domain/Import/Entity/Properties/DayOfWeek.php index 0055df4..8588018 100644 --- a/Classes/Domain/Import/Entity/Properties/DayOfWeek.php +++ b/Classes/Domain/Import/Entity/Properties/DayOfWeek.php @@ -25,10 +25,7 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity\Properties; class DayOfWeek { - /** - * @var string - */ - protected $dayOfWeek = ''; + protected string $dayOfWeek = ''; public function __construct( string $dayOfWeek diff --git a/Classes/Domain/Import/Entity/Properties/ForeignReference.php b/Classes/Domain/Import/Entity/Properties/ForeignReference.php index 5b48af3..e6fa2bc 100644 --- a/Classes/Domain/Import/Entity/Properties/ForeignReference.php +++ b/Classes/Domain/Import/Entity/Properties/ForeignReference.php @@ -33,10 +33,8 @@ class ForeignReference * URL to the original source at ThüCAT. * Not unique within our system. We have one entity per language, * while ThüCAT has a single entity containing all languages. - * - * @var string */ - protected $id = ''; + protected string $id = ''; public function getId(): string { diff --git a/Classes/Domain/Import/Entity/Properties/Geo.php b/Classes/Domain/Import/Entity/Properties/Geo.php index 8ea1967..4cbc587 100644 --- a/Classes/Domain/Import/Entity/Properties/Geo.php +++ b/Classes/Domain/Import/Entity/Properties/Geo.php @@ -25,15 +25,9 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity\Properties; class Geo { - /** - * @var float - */ - protected $longitude = 0.00; + protected float $longitude = 0.00; - /** - * @var float - */ - protected $latitude = 0.00; + protected float $latitude = 0.00; public function getLongitude(): float { diff --git a/Classes/Domain/Import/Entity/Properties/Offer.php b/Classes/Domain/Import/Entity/Properties/Offer.php index fc5d9a1..f079b91 100644 --- a/Classes/Domain/Import/Entity/Properties/Offer.php +++ b/Classes/Domain/Import/Entity/Properties/Offer.php @@ -31,12 +31,12 @@ class Offer extends Minimum /** * @var string[] */ - protected $offerTypes = []; + protected array $offerTypes = []; /** * @var PriceSpecification[] */ - protected $prices = []; + protected array $prices = []; /** * @return string[] diff --git a/Classes/Domain/Import/Entity/Properties/OpeningHour.php b/Classes/Domain/Import/Entity/Properties/OpeningHour.php index 694662f..8b065d4 100644 --- a/Classes/Domain/Import/Entity/Properties/OpeningHour.php +++ b/Classes/Domain/Import/Entity/Properties/OpeningHour.php @@ -27,30 +27,18 @@ use DateTimeImmutable; class OpeningHour { - /** - * @var DateTimeImmutable|null - */ - protected $validFrom; + protected ?DateTimeImmutable $validFrom; - /** - * @var DateTimeImmutable|null - */ - protected $validThrough; + protected ?DateTimeImmutable $validThrough; - /** - * @var DateTimeImmutable - */ - protected $opens; + protected DateTimeImmutable $opens; - /** - * @var DateTimeImmutable - */ - protected $closes; + protected DateTimeImmutable $closes; /** * @var string[] */ - protected $daysOfWeek = []; + protected array $daysOfWeek = []; public function getValidFrom(): ?DateTimeImmutable { diff --git a/Classes/Domain/Import/Entity/Properties/PriceSpecification.php b/Classes/Domain/Import/Entity/Properties/PriceSpecification.php index 5991944..3d6617f 100644 --- a/Classes/Domain/Import/Entity/Properties/PriceSpecification.php +++ b/Classes/Domain/Import/Entity/Properties/PriceSpecification.php @@ -28,26 +28,19 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues; class PriceSpecification extends Minimum { - /** - * @var float - */ - protected $price = 0.00; + protected float $price = 0.00; /** * E.g. 'EUR' * ThueCat specific format. - * - * @var string */ - protected $currency = ''; + protected string $currency = ''; /** * E.g. 'PerPerson' * ThueCat specific property. - * - * @var array */ - protected $calculationRules = []; + protected array $calculationRules = []; public function getPrice(): float { diff --git a/Classes/Domain/Import/Entity/Shared/ManagedBy.php b/Classes/Domain/Import/Entity/Shared/ManagedBy.php index e12de9a..4704cca 100644 --- a/Classes/Domain/Import/Entity/Shared/ManagedBy.php +++ b/Classes/Domain/Import/Entity/Shared/ManagedBy.php @@ -29,10 +29,8 @@ trait ManagedBy { /** * The Thing responsible for the data within this Thing. - * - * @var ForeignReference */ - protected $managedBy; + protected ?ForeignReference $managedBy; public function getManagedBy(): ?ForeignReference { diff --git a/Classes/Domain/Import/Entity/Shared/Organization.php b/Classes/Domain/Import/Entity/Shared/Organization.php index 8bfcbf3..62e2047 100644 --- a/Classes/Domain/Import/Entity/Shared/Organization.php +++ b/Classes/Domain/Import/Entity/Shared/Organization.php @@ -34,7 +34,7 @@ trait Organization /** * @var Offer[] */ - protected $offers = []; + protected array $offers = []; /** * @return Offer[] diff --git a/Classes/Domain/Import/Entity/TouristAttraction.php b/Classes/Domain/Import/Entity/TouristAttraction.php index b8f179c..0e6648d 100644 --- a/Classes/Domain/Import/Entity/TouristAttraction.php +++ b/Classes/Domain/Import/Entity/TouristAttraction.php @@ -27,55 +27,40 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues; class TouristAttraction extends Place implements MapsToType { - /** - * @var string - */ - protected $slogan = ''; + protected string $slogan = ''; - /** - * @var string - */ - protected $startOfConstruction = ''; + protected string $startOfConstruction = ''; /** * @var string[] */ - protected $museumServices = []; + protected array $museumServices = []; /** * @var string[] */ - protected $architecturalStyles = []; + protected array $architecturalStyles = []; /** * @var string[] */ - protected $digitalOffers = []; + protected array $digitalOffers = []; /** * @var string[] */ - protected $photographies = []; + protected array $photographies = []; - /** - * @var string - */ - protected $petsAllowed = ''; + protected string $petsAllowed = ''; - /** - * @var string - */ - protected $isAccessibleForFree = ''; + protected string $isAccessibleForFree = ''; - /** - * @var string - */ - protected $publicAccess = ''; + protected string $publicAccess = ''; /** * @var string[] */ - protected $availableLanguages = []; + protected array $availableLanguages = []; public function getSlogan(): string { diff --git a/Classes/Domain/Import/EntityMapper/EntityRegistry.php b/Classes/Domain/Import/EntityMapper/EntityRegistry.php index 9b05beb..3c54566 100644 --- a/Classes/Domain/Import/EntityMapper/EntityRegistry.php +++ b/Classes/Domain/Import/EntityMapper/EntityRegistry.php @@ -31,7 +31,7 @@ class EntityRegistry /** * @var array[] */ - private $entities = []; + private array $entities = []; /** * @param string[] $supportedTypes diff --git a/Classes/Domain/Import/EntityMapper/JsonDecode.php b/Classes/Domain/Import/EntityMapper/JsonDecode.php index 25ed398..e709926 100644 --- a/Classes/Domain/Import/EntityMapper/JsonDecode.php +++ b/Classes/Domain/Import/EntityMapper/JsonDecode.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace WerkraumMedia\ThueCat\Domain\Import\EntityMapper; use InvalidArgumentException; -use function str_starts_with; use Symfony\Component\Serializer\Encoder\JsonDecode as SymfonyJsonDecode; /** @@ -39,7 +38,7 @@ class JsonDecode extends SymfonyJsonDecode /** * @var array[] */ - private $rulesToKeepTypeInfo = [ + private array $rulesToKeepTypeInfo = [ [ 'type' => 'beginsWith', 'comparisonValue' => 'thuecat:facilityAccessibility', diff --git a/Classes/Domain/Import/EntityMapper/MappingException.php b/Classes/Domain/Import/EntityMapper/MappingException.php index 3c0b885..fc475d4 100644 --- a/Classes/Domain/Import/EntityMapper/MappingException.php +++ b/Classes/Domain/Import/EntityMapper/MappingException.php @@ -28,15 +28,9 @@ use Throwable; class MappingException extends Exception { - /** - * @var array - */ - protected $jsonLD = []; + protected array $jsonLD = []; - /** - * @var string - */ - protected $targetClassName = ''; + protected string $targetClassName = ''; public function __construct( array $jsonLD, diff --git a/Classes/Domain/Import/Import.php b/Classes/Domain/Import/Import.php index e3fb040..5923ce1 100644 --- a/Classes/Domain/Import/Import.php +++ b/Classes/Domain/Import/Import.php @@ -38,22 +38,16 @@ class Import /** * @var ImportLog[] */ - private $importLogStack = []; + private array $importLogStack = []; /** * @var ImportConfiguration[] */ - private $configurationStack = []; + private array $configurationStack = []; - /** - * @var ImportLog - */ - private $currentImportLog; + private ImportLog $currentImportLog; - /** - * @var ImportConfiguration - */ - private $currentConfiguration; + private ImportConfiguration $currentConfiguration; public function start(ImportConfiguration $configuration): void { diff --git a/Classes/Domain/Import/Importer.php b/Classes/Domain/Import/Importer.php index c85d8ec..a1b7ca2 100644 --- a/Classes/Domain/Import/Importer.php +++ b/Classes/Domain/Import/Importer.php @@ -43,15 +43,9 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\ImportLogRepository; class Importer { - /** - * @var Logger - */ - private $logger; + private Logger $logger; - /** - * @var Import - */ - private $import; + private Import $import; public function __construct( private readonly UrlProviderRegistry $urls, diff --git a/Classes/Domain/Import/Importer/FetchData.php b/Classes/Domain/Import/Importer/FetchData.php index a29e62a..5561efc 100644 --- a/Classes/Domain/Import/Importer/FetchData.php +++ b/Classes/Domain/Import/Importer/FetchData.php @@ -32,15 +32,9 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData\InvalidResponseExcept class FetchData { - /** - * @var string - */ - private $databaseUrlPrefix = 'https://cdb.thuecat.org'; + private string $databaseUrlPrefix = 'https://cdb.thuecat.org'; - /** - * @var string - */ - private $urlPrefix = 'https://thuecat.org'; + private string $urlPrefix = 'https://thuecat.org'; public function __construct( private readonly RequestFactoryInterface $requestFactory, diff --git a/Classes/Domain/Import/Importer/SaveData.php b/Classes/Domain/Import/Importer/SaveData.php index 8a3847e..da4ded2 100644 --- a/Classes/Domain/Import/Importer/SaveData.php +++ b/Classes/Domain/Import/Importer/SaveData.php @@ -35,7 +35,7 @@ class SaveData /** * @var mixed[] */ - private $errorLog; + private array $errorLog; public function __construct( private readonly DataHandler $dataHandler, diff --git a/Classes/Domain/Import/Model/EntityCollection.php b/Classes/Domain/Import/Model/EntityCollection.php index 08e75f4..efad880 100644 --- a/Classes/Domain/Import/Model/EntityCollection.php +++ b/Classes/Domain/Import/Model/EntityCollection.php @@ -28,7 +28,7 @@ class EntityCollection /** * @var Entity[] */ - private $entities = []; + private array $entities = []; public function add(Entity $entity): void { diff --git a/Classes/Domain/Import/Model/GenericEntity.php b/Classes/Domain/Import/Model/GenericEntity.php index 3046045..9f75847 100644 --- a/Classes/Domain/Import/Model/GenericEntity.php +++ b/Classes/Domain/Import/Model/GenericEntity.php @@ -25,40 +25,22 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Model; class GenericEntity implements Entity { - /** - * @var int - */ - private $typo3StoragePid; + private int $typo3StoragePid; - /** - * @var string - */ - private $typo3DatabaseTableName; + private string $typo3DatabaseTableName; - /** - * @var int - */ - private $typo3SystemLanguageUid; + private int $typo3SystemLanguageUid; - /** - * @var bool - */ - private $created = false; + private bool $created = false; - /** - * @var int - */ - private $typo3Uid = 0; + private int $typo3Uid = 0; - /** - * @var string - */ - private $remoteId; + private string $remoteId; /** * @var mixed[] */ - private $data; + private array $data; public function __construct( int $typo3StoragePid, diff --git a/Classes/Domain/Import/Typo3Converter/GeneralConverter.php b/Classes/Domain/Import/Typo3Converter/GeneralConverter.php index 3f9e594..fd42b08 100644 --- a/Classes/Domain/Import/Typo3Converter/GeneralConverter.php +++ b/Classes/Domain/Import/Typo3Converter/GeneralConverter.php @@ -53,20 +53,14 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\TownRepository; class GeneralConverter implements Converter { - /** - * @var Logger - */ - private $logger; + private Logger $logger; - /** - * @var ImportConfiguration - */ - private $importConfiguration; + private ImportConfiguration $importConfiguration; /** * @var string[] */ - private $classToTableMapping = [ + private array $classToTableMapping = [ TouristAttraction::class => 'tx_thuecat_tourist_attraction', ParkingFacility::class => 'tx_thuecat_parking_facility', Town::class => 'tx_thuecat_town', diff --git a/Classes/Domain/Import/Typo3Converter/NameExtractor.php b/Classes/Domain/Import/Typo3Converter/NameExtractor.php index f87ae6d..cfac8b4 100644 --- a/Classes/Domain/Import/Typo3Converter/NameExtractor.php +++ b/Classes/Domain/Import/Typo3Converter/NameExtractor.php @@ -28,10 +28,7 @@ use WerkraumMedia\ThueCat\Domain\Import\ResolveForeignReference; class NameExtractor { - /** - * @var ResolveForeignReference - */ - private $resolveForeignReference; + private ResolveForeignReference $resolveForeignReference; public function __construct( ResolveForeignReference $resolveForeignReference diff --git a/Classes/Domain/Import/Typo3Converter/Registry.php b/Classes/Domain/Import/Typo3Converter/Registry.php index 2b038e2..33b147c 100644 --- a/Classes/Domain/Import/Typo3Converter/Registry.php +++ b/Classes/Domain/Import/Typo3Converter/Registry.php @@ -37,7 +37,7 @@ class Registry /** * @var Converter[] */ - private $converters = []; + private array $converters = []; public function registerConverter(Converter $converter): void { diff --git a/Classes/Domain/Import/UrlProvider/ContainsPlaceUrlProvider.php b/Classes/Domain/Import/UrlProvider/ContainsPlaceUrlProvider.php index be91be1..af4016f 100644 --- a/Classes/Domain/Import/UrlProvider/ContainsPlaceUrlProvider.php +++ b/Classes/Domain/Import/UrlProvider/ContainsPlaceUrlProvider.php @@ -29,10 +29,7 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData; class ContainsPlaceUrlProvider implements UrlProvider { - /** - * @var string - */ - private $containsPlaceId = ''; + private string $containsPlaceId = ''; public function __construct( private readonly FetchData $fetchData diff --git a/Classes/Domain/Import/UrlProvider/Registry.php b/Classes/Domain/Import/UrlProvider/Registry.php index 6595f5f..3fb0740 100644 --- a/Classes/Domain/Import/UrlProvider/Registry.php +++ b/Classes/Domain/Import/UrlProvider/Registry.php @@ -33,7 +33,7 @@ class Registry /** * @var UrlProvider[] */ - private $provider = []; + private array $provider = []; public function registerProvider(UrlProvider $provider): void { diff --git a/Classes/Domain/Import/UrlProvider/StaticUrlProvider.php b/Classes/Domain/Import/UrlProvider/StaticUrlProvider.php index 5b3b836..e907c7b 100644 --- a/Classes/Domain/Import/UrlProvider/StaticUrlProvider.php +++ b/Classes/Domain/Import/UrlProvider/StaticUrlProvider.php @@ -30,7 +30,7 @@ class StaticUrlProvider implements UrlProvider /** * @var string[] */ - private $urls = []; + private array $urls = []; public function canProvideForConfiguration( ImportConfiguration $configuration diff --git a/Classes/Domain/Import/UrlProvider/SyncScopeUrlProvider.php b/Classes/Domain/Import/UrlProvider/SyncScopeUrlProvider.php index 90f598a..7b4d827 100644 --- a/Classes/Domain/Import/UrlProvider/SyncScopeUrlProvider.php +++ b/Classes/Domain/Import/UrlProvider/SyncScopeUrlProvider.php @@ -29,10 +29,7 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData; class SyncScopeUrlProvider implements UrlProvider { - /** - * @var string - */ - private $syncScopeId = ''; + private string $syncScopeId = ''; public function __construct( private readonly FetchData $fetchData diff --git a/Classes/Domain/Model/Backend/AbstractEntity.php b/Classes/Domain/Model/Backend/AbstractEntity.php index 005ead4..197a79a 100644 --- a/Classes/Domain/Model/Backend/AbstractEntity.php +++ b/Classes/Domain/Model/Backend/AbstractEntity.php @@ -28,25 +28,13 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity as Typo3AbstractEntity; class AbstractEntity extends Typo3AbstractEntity { - /** - * @var string - */ - protected $remoteId = ''; + protected string $remoteId = ''; - /** - * @var string - */ - protected $title = ''; + protected string $title = ''; - /** - * @var string - */ - protected $description = ''; + protected string $description = ''; - /** - * @var DateTimeImmutable|null - */ - protected $tstamp; + protected ?DateTimeImmutable $tstamp; public function getRemoteId(): string { diff --git a/Classes/Domain/Model/Backend/ImportConfiguration.php b/Classes/Domain/Model/Backend/ImportConfiguration.php index 311d98e..f774cbe 100644 --- a/Classes/Domain/Model/Backend/ImportConfiguration.php +++ b/Classes/Domain/Model/Backend/ImportConfiguration.php @@ -35,40 +35,28 @@ use WerkraumMedia\ThueCat\Domain\Import\ResolveForeignReference; class ImportConfiguration extends AbstractEntity implements ImportConfigurationInterface { - /** - * @var string - */ - protected $title = ''; + protected string $title = ''; - /** - * @var string - */ - protected $type = ''; + protected string $type = ''; - /** - * @var string - */ - protected $configuration = ''; + protected string $configuration = ''; - /** - * @var DateTimeImmutable|null - */ - protected $tstamp; + protected ?DateTimeImmutable $tstamp; /** * @var ObjectStorage */ - protected $logs; + protected ObjectStorage $logs; /** * @var string[]|null */ - protected $urls; + protected ?array $urls; /** * @var string[] */ - protected $allowedTypes = []; + protected array $allowedTypes = []; public function __construct() { @@ -98,7 +86,7 @@ class ImportConfiguration extends AbstractEntity implements ImportConfigurationI public function getLastImported(): ?DateTimeImmutable { $lastImport = null; - $positionOfLastLog = (count($this->logs) - 1); + $positionOfLastLog = count($this->logs) - 1; if ($this->logs->offsetExists($positionOfLastLog)) { $lastImport = $this->logs->offsetGet($positionOfLastLog); } diff --git a/Classes/Domain/Model/Backend/ImportLog.php b/Classes/Domain/Model/Backend/ImportLog.php index e33d65d..6f322fb 100644 --- a/Classes/Domain/Model/Backend/ImportLog.php +++ b/Classes/Domain/Model/Backend/ImportLog.php @@ -33,17 +33,11 @@ class ImportLog extends Typo3AbstractEntity /** * @var ObjectStorage */ - protected $logEntries; + protected ObjectStorage $logEntries; - /** - * @var ImportConfiguration|null - */ - protected $configuration; + protected ?ImportConfiguration $configuration; - /** - * @var DateTimeImmutable|null - */ - protected $crdate; + protected ?DateTimeImmutable $crdate; public function __construct( ?ImportConfiguration $configuration = null diff --git a/Classes/Domain/Model/Backend/ImportLogEntry/MappingError.php b/Classes/Domain/Model/Backend/ImportLogEntry/MappingError.php index 5eb8b2d..6c07f95 100644 --- a/Classes/Domain/Model/Backend/ImportLogEntry/MappingError.php +++ b/Classes/Domain/Model/Backend/ImportLogEntry/MappingError.php @@ -29,15 +29,9 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry; class MappingError extends ImportLogEntry { - /** - * @var string - */ - protected $remoteId = ''; + protected string $remoteId = ''; - /** - * @var string - */ - protected $errors = ''; + protected string $errors = ''; public function __construct( MappingException $exception diff --git a/Classes/Domain/Model/Backend/ImportLogEntry/SavingEntity.php b/Classes/Domain/Model/Backend/ImportLogEntry/SavingEntity.php index fd10a23..7b3130f 100644 --- a/Classes/Domain/Model/Backend/ImportLogEntry/SavingEntity.php +++ b/Classes/Domain/Model/Backend/ImportLogEntry/SavingEntity.php @@ -29,40 +29,22 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry; class SavingEntity extends ImportLogEntry { - /** - * @var string - */ - protected $remoteId = ''; + protected string $remoteId = ''; - /** - * @var bool - */ - protected $insertion = false; + protected bool $insertion = false; - /** - * @var int - */ - protected $recordUid = 0; + protected int $recordUid = 0; - /** - * @var int - */ - protected $recordPid = 0; + protected int $recordPid = 0; - /** - * @var string - */ - protected $tableName = ''; + protected string $tableName = ''; - /** - * @var string - */ - protected $errors = ''; + protected string $errors = ''; /** * @var string[] */ - protected $errorsAsArray = []; + protected array $errorsAsArray = []; public function __construct( Entity $entity, diff --git a/Classes/Domain/Model/Backend/Organisation.php b/Classes/Domain/Model/Backend/Organisation.php index 0064d10..05d359c 100644 --- a/Classes/Domain/Model/Backend/Organisation.php +++ b/Classes/Domain/Model/Backend/Organisation.php @@ -30,12 +30,12 @@ class Organisation extends AbstractEntity /** * @var ObjectStorage */ - protected $managesTowns; + protected ObjectStorage $managesTowns; /** * @var ObjectStorage */ - protected $managesTouristInformation; + protected ObjectStorage $managesTouristInformation; public function getManagesTowns(): ObjectStorage { diff --git a/Classes/Domain/Model/Backend/Town.php b/Classes/Domain/Model/Backend/Town.php index f41723c..4799b8d 100644 --- a/Classes/Domain/Model/Backend/Town.php +++ b/Classes/Domain/Model/Backend/Town.php @@ -30,7 +30,7 @@ class Town extends AbstractEntity /** * @var ObjectStorage */ - protected $touristInformation; + protected ObjectStorage $touristInformation; public function getTouristInformation(): ObjectStorage { diff --git a/Classes/Domain/Model/Frontend/AccessiblitySpecification.php b/Classes/Domain/Model/Frontend/AccessiblitySpecification.php index 8c78802..9025c94 100644 --- a/Classes/Domain/Model/Frontend/AccessiblitySpecification.php +++ b/Classes/Domain/Model/Frontend/AccessiblitySpecification.php @@ -27,15 +27,12 @@ use TYPO3\CMS\Core\Type\TypeInterface; class AccessiblitySpecification implements TypeInterface { - /** - * @var string - */ - private $serialized; + private string $serialized; /** * @var mixed[] */ - private $data; + private array $data; public function __construct(string $serialized) { diff --git a/Classes/Domain/Model/Frontend/Address.php b/Classes/Domain/Model/Frontend/Address.php index b29dbb4..df951cd 100644 --- a/Classes/Domain/Model/Frontend/Address.php +++ b/Classes/Domain/Model/Frontend/Address.php @@ -27,15 +27,12 @@ use TYPO3\CMS\Core\Type\TypeInterface; class Address implements TypeInterface { - /** - * @var string - */ - private $serialized; + private string $serialized; /** * @var mixed[] */ - private $data; + private array $data; public function __construct(string $serialized) { diff --git a/Classes/Domain/Model/Frontend/Base.php b/Classes/Domain/Model/Frontend/Base.php index 80d3f0f..ed4580a 100644 --- a/Classes/Domain/Model/Frontend/Base.php +++ b/Classes/Domain/Model/Frontend/Base.php @@ -27,20 +27,11 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; abstract class Base extends AbstractEntity { - /** - * @var string - */ - protected $title = ''; + protected string $title = ''; - /** - * @var string - */ - protected $description = ''; + protected string $description = ''; - /** - * @var Media|null - */ - protected $media; + protected ?Media $media; public function getTitle(): string { diff --git a/Classes/Domain/Model/Frontend/Media.php b/Classes/Domain/Model/Frontend/Media.php index f535984..bb0f19c 100644 --- a/Classes/Domain/Model/Frontend/Media.php +++ b/Classes/Domain/Model/Frontend/Media.php @@ -28,20 +28,17 @@ use TYPO3\CMS\Core\Type\TypeInterface; class Media implements TypeInterface { - /** - * @var string - */ - private $serialized; + private string $serialized; /** * @var array[] */ - private $data; + private array $data; /** * @var FileReference[] */ - protected $editorialImages = []; + protected array $editorialImages = []; public function __construct(string $serialized) { diff --git a/Classes/Domain/Model/Frontend/MergedOpeningHour.php b/Classes/Domain/Model/Frontend/MergedOpeningHour.php index ca9b1cd..04c5b64 100644 --- a/Classes/Domain/Model/Frontend/MergedOpeningHour.php +++ b/Classes/Domain/Model/Frontend/MergedOpeningHour.php @@ -30,17 +30,11 @@ class MergedOpeningHour /** * @var MergedOpeningHourWeekDay[] */ - private $weekDays = []; + private array $weekDays = []; - /** - * @var DateTimeImmutable|null - */ - private $from; + private ?DateTimeImmutabl $from; - /** - * @var DateTimeImmutable|null - */ - private $through; + private ?DateTimeImmutabl $through; public function __construct( array $weekDays, diff --git a/Classes/Domain/Model/Frontend/MergedOpeningHourWeekDay.php b/Classes/Domain/Model/Frontend/MergedOpeningHourWeekDay.php index ad92c6c..82c69c5 100644 --- a/Classes/Domain/Model/Frontend/MergedOpeningHourWeekDay.php +++ b/Classes/Domain/Model/Frontend/MergedOpeningHourWeekDay.php @@ -27,20 +27,11 @@ use WerkraumMedia\ThueCat\Domain\TimingFormat; class MergedOpeningHourWeekDay { - /** - * @var string - */ - private $opens; + private string $opens; - /** - * @var string - */ - private $closes; + private string $closes; - /** - * @var string - */ - private $dayOfWeek; + private string $dayOfWeek; public function __construct( string $opens, diff --git a/Classes/Domain/Model/Frontend/MergedOpeningHours.php b/Classes/Domain/Model/Frontend/MergedOpeningHours.php index 4fa199f..26cb3a1 100644 --- a/Classes/Domain/Model/Frontend/MergedOpeningHours.php +++ b/Classes/Domain/Model/Frontend/MergedOpeningHours.php @@ -31,12 +31,9 @@ class MergedOpeningHours implements Iterator, Countable /** * @var MergedOpeningHour[] */ - private $openingHours = []; + private array $openingHours = []; - /** - * @var int - */ - private $position = 0; + private int $position = 0; /** * @param MergedOpeningHour[] $openingHours diff --git a/Classes/Domain/Model/Frontend/Offer.php b/Classes/Domain/Model/Frontend/Offer.php index 66b0831..ab0c106 100644 --- a/Classes/Domain/Model/Frontend/Offer.php +++ b/Classes/Domain/Model/Frontend/Offer.php @@ -27,25 +27,19 @@ use TYPO3\CMS\Core\Utility\ArrayUtility; class Offer { - /** - * @var string - */ - private $title; + private string $title; /** * @var string[] */ - private $types; + private array $types; - /** - * @var string - */ - private $description; + private string $description; /** * @var mixed[] */ - private $prices; + private array $prices; /** * @param string[] $types diff --git a/Classes/Domain/Model/Frontend/Offers.php b/Classes/Domain/Model/Frontend/Offers.php index b9c157e..2419d09 100644 --- a/Classes/Domain/Model/Frontend/Offers.php +++ b/Classes/Domain/Model/Frontend/Offers.php @@ -28,24 +28,18 @@ use Iterator; use TYPO3\CMS\Core\Type\TypeInterface; /** - * @implements \Iterator + * @implements Iterator */ class Offers implements TypeInterface, Iterator, Countable { - /** - * @var string - */ - private $serialized = ''; + private string $serialized = ''; /** * @var mixed[] */ - private $array = []; + private array $array = []; - /** - * @var int - */ - private $position = 0; + private int $position = 0; public function __construct(string $serialized) { diff --git a/Classes/Domain/Model/Frontend/OpeningHour.php b/Classes/Domain/Model/Frontend/OpeningHour.php index 31c4f37..034d4cb 100644 --- a/Classes/Domain/Model/Frontend/OpeningHour.php +++ b/Classes/Domain/Model/Frontend/OpeningHour.php @@ -29,30 +29,18 @@ use WerkraumMedia\ThueCat\Domain\TimingFormat; class OpeningHour { - /** - * @var string - */ - private $opens; + private string $opens; - /** - * @var string - */ - private $closes; + private string $closes; /** * @var mixed[] */ - private $daysOfWeek; + private array $daysOfWeek; - /** - * @var DateTimeImmutable|null - */ - private $from; + private ?DateTimeImmutable $from; - /** - * @var DateTimeImmutable|null - */ - private $through; + private ?DateTimeImmutable $through; private function __construct( string $opens, diff --git a/Classes/Domain/Model/Frontend/OpeningHours.php b/Classes/Domain/Model/Frontend/OpeningHours.php index 0bdf285..92d3c0a 100644 --- a/Classes/Domain/Model/Frontend/OpeningHours.php +++ b/Classes/Domain/Model/Frontend/OpeningHours.php @@ -35,20 +35,14 @@ use WerkraumMedia\ThueCat\Service\DateBasedFilter; */ class OpeningHours implements TypeInterface, Iterator, Countable { - /** - * @var string - */ - private $serialized = ''; + private string $serialized = ''; /** * @var mixed[] */ - private $array = []; + private array $array = []; - /** - * @var int - */ - private $position = 0; + private int $position = 0; public function __construct(string $serialized) { diff --git a/Classes/Domain/Model/Frontend/Place.php b/Classes/Domain/Model/Frontend/Place.php index 721678e..f846420 100644 --- a/Classes/Domain/Model/Frontend/Place.php +++ b/Classes/Domain/Model/Frontend/Place.php @@ -28,60 +28,30 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage; abstract class Place extends Base { - /** - * @var Address|null - */ - protected $address; + protected ?Address $address; - /** - * @var string - */ - protected $url = ''; + protected string $url = ''; - /** - * @var OpeningHours|null - */ - protected $openingHours; + protected ?OpeningHours $openingHours; - /** - * @var OpeningHours|null - */ - protected $specialOpeningHours; + protected ?OpeningHours $specialOpeningHours; /** * @var ObjectStorage */ - protected $parkingFacilityNearBy; + protected ObjectStorage $parkingFacilityNearBy; - /** - * @var string - */ - protected $sanitation = ''; + protected string $sanitation = ''; - /** - * @var string - */ - protected $otherService = ''; + protected string $otherService = ''; - /** - * @var string - */ - protected $trafficInfrastructure = ''; + protected string $trafficInfrastructure = ''; - /** - * @var string - */ - protected $paymentAccepted = ''; + protected string $paymentAccepted = ''; - /** - * @var string - */ - protected $distanceToPublicTransport = ''; + protected string $distanceToPublicTransport = ''; - /** - * @var AccessiblitySpecification|null - */ - protected $accessibilitySpecification; + protected ?AccessiblitySpecification $accessibilitySpecification; public function initializeObject(): void { diff --git a/Classes/Domain/Model/Frontend/Price.php b/Classes/Domain/Model/Frontend/Price.php index 795972a..95238ce 100644 --- a/Classes/Domain/Model/Frontend/Price.php +++ b/Classes/Domain/Model/Frontend/Price.php @@ -27,43 +27,13 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; class Price { - /** - * @var string - */ - private $title; - - /** - * @var string - */ - private $description; - - /** - * @var float - */ - private $price; - - /** - * @var string - */ - private $currency; - - /** - * @var string[] - */ - private $rules; - private function __construct( - string $title, - string $description, - float $price, - string $currency, - array $rules + private readonly string $title, + private readonly string $description, + private readonly float $price, + private readonly string $currency, + private readonly array $rules ) { - $this->title = $title; - $this->description = $description; - $this->price = $price; - $this->currency = $currency; - $this->rules = $rules; } /** diff --git a/Classes/Domain/Model/Frontend/TouristAttraction.php b/Classes/Domain/Model/Frontend/TouristAttraction.php index 393ba37..c468692 100644 --- a/Classes/Domain/Model/Frontend/TouristAttraction.php +++ b/Classes/Domain/Model/Frontend/TouristAttraction.php @@ -27,60 +27,27 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; class TouristAttraction extends Place { - /** - * @var string - */ - protected $slogan = ''; + protected string $slogan = ''; - /** - * @var Offers|null - */ - protected $offers; + protected ?Offers $offers; - /** - * @var Town|null - */ - protected $town; + protected ?Town $town; - /** - * @var string - */ - protected $startOfConstruction = ''; + protected string $startOfConstruction = ''; - /** - * @var string - */ - protected $museumService = ''; + protected string $museumService = ''; - /** - * @var string - */ - protected $architecturalStyle = ''; + protected string $architecturalStyle = ''; - /** - * @var string - */ - protected $digitalOffer = ''; + protected string $digitalOffer = ''; - /** - * @var string - */ - protected $photography = ''; + protected string $photography = ''; - /** - * @var string - */ - protected $petsAllowed = ''; + protected string $petsAllowed = ''; - /** - * @var string - */ - protected $isAccessibleForFree = ''; + protected string $isAccessibleForFree = ''; - /** - * @var string - */ - protected $publicAccess = ''; + protected string $publicAccess = ''; public function getSlogan(): string { diff --git a/Classes/Frontend/DataProcessing/ResolveEntities.php b/Classes/Frontend/DataProcessing/ResolveEntities.php index ebd28e1..7677ac8 100644 --- a/Classes/Frontend/DataProcessing/ResolveEntities.php +++ b/Classes/Frontend/DataProcessing/ResolveEntities.php @@ -33,10 +33,7 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; class ResolveEntities implements DataProcessorInterface { - /** - * @var TypoScriptFrontendController - */ - private $tsfe; + private TypoScriptFrontendController $tsfe; public function __construct( private readonly ConnectionPool $connectionPool, diff --git a/Classes/Service/DateBasedFilter/FilterBasedOnTypo3Context.php b/Classes/Service/DateBasedFilter/FilterBasedOnTypo3Context.php index 1b3538c..24b4a2a 100644 --- a/Classes/Service/DateBasedFilter/FilterBasedOnTypo3Context.php +++ b/Classes/Service/DateBasedFilter/FilterBasedOnTypo3Context.php @@ -29,15 +29,9 @@ use WerkraumMedia\ThueCat\Service\DateBasedFilter; class FilterBasedOnTypo3Context implements DateBasedFilter { - /** - * @var Context - */ - private $context; - public function __construct( - Context $context + private readonly Context $context ) { - $this->context = $context; } /** diff --git a/Classes/Typo3/Extbase/DataMapping/AfterObjectThawedHandler.php b/Classes/Typo3/Extbase/DataMapping/AfterObjectThawedHandler.php index e977729..675aa07 100644 --- a/Classes/Typo3/Extbase/DataMapping/AfterObjectThawedHandler.php +++ b/Classes/Typo3/Extbase/DataMapping/AfterObjectThawedHandler.php @@ -36,22 +36,10 @@ use WerkraumMedia\ThueCat\Domain\Model\Frontend\Media; */ class AfterObjectThawedHandler { - /** - * @var FileRepository - */ - private $fileRepository; - - /** - * @var DataMapFactory - */ - private $dataMapFactory; - public function __construct( - FileRepository $fileRepository, - DataMapFactory $dataMapFactory + private readonly FileRepository $fileRepository, + private readonly DataMapFactory $dataMapFactory ) { - $this->fileRepository = $fileRepository; - $this->dataMapFactory = $dataMapFactory; } public function __invoke(AfterObjectThawedEvent $event): void diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php index 049f860..54d44d1 100644 --- a/Configuration/Extbase/Persistence/Classes.php +++ b/Configuration/Extbase/Persistence/Classes.php @@ -50,10 +50,4 @@ return [ TouristAttraction::class => [ 'tableName' => 'tx_thuecat_tourist_attraction', ], - \WerkraumMedia\ThueCat\Domain\Model\Frontend\Town::class => [ - 'tableName' => 'tx_thuecat_town', - ], - WerkraumMedia\ThueCat\Domain\Model\Frontend\ParkingFacility::class => [ - 'tableName' => 'tx_thuecat_parking_facility', - ], ]; diff --git a/Configuration/TCA/tx_thuecat_import_log_entry.php b/Configuration/TCA/tx_thuecat_import_log_entry.php index 3adfe0b..5ce7baa 100644 --- a/Configuration/TCA/tx_thuecat_import_log_entry.php +++ b/Configuration/TCA/tx_thuecat_import_log_entry.php @@ -59,8 +59,6 @@ return (static function (string $extensionKey, string $tableName) { 'renderType' => 'checkboxLabeledToggle', 'items' => [ [ - 'label' => '', - 1 => '', 'labelChecked' => $languagePath . '.insertion.yes', 'labelUnchecked' => $languagePath . '.insertion.no', ], diff --git a/Configuration/TCA/tx_thuecat_parking_facility.php b/Configuration/TCA/tx_thuecat_parking_facility.php index 73c0351..3af1e46 100644 --- a/Configuration/TCA/tx_thuecat_parking_facility.php +++ b/Configuration/TCA/tx_thuecat_parking_facility.php @@ -30,7 +30,9 @@ return (static function (string $extensionKey, string $tableName) { 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => ['type' => 'language'], + 'config' => [ + 'type' => 'language', + ], ], 'l18n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -38,7 +40,12 @@ return (static function (string $extensionKey, string $tableName) { 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', - 'items' => [['label' => '', 'value' => 0]], + 'items' => [ + [ + 'label' => '', + 'value' => 0, + ] + ], 'foreign_table' => $tableName, 'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)', 'default' => 0, @@ -57,8 +64,6 @@ return (static function (string $extensionKey, string $tableName) { 'renderType' => 'checkboxToggle', 'items' => [ [ - 'label' => '', - 1 => '', 'invertStateDisplay' => true, ], ], diff --git a/Configuration/TCA/tx_thuecat_tourist_attraction.php b/Configuration/TCA/tx_thuecat_tourist_attraction.php index 1cae9a1..bdb707a 100644 --- a/Configuration/TCA/tx_thuecat_tourist_attraction.php +++ b/Configuration/TCA/tx_thuecat_tourist_attraction.php @@ -30,7 +30,9 @@ return (static function (string $extensionKey, string $tableName) { 'sys_language_uid' => [ 'exclude' => true, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => ['type' => 'language'], + 'config' => [ + 'type' => 'language', + ], ], 'l18n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -38,7 +40,12 @@ return (static function (string $extensionKey, string $tableName) { 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', - 'items' => [['label' => '', 'value' => 0]], + 'items' => [ + [ + 'label' => '', + 'value' => 0, + ] + ], 'foreign_table' => $tableName, 'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)', 'default' => 0, diff --git a/Tests/Functional/AbstractImportTestCase.php b/Tests/Functional/AbstractImportTestCase.php index 428b87e..a5c0b4a 100644 --- a/Tests/Functional/AbstractImportTestCase.php +++ b/Tests/Functional/AbstractImportTestCase.php @@ -33,10 +33,8 @@ abstract class AbstractImportTestCase extends \TYPO3\TestingFramework\Core\Funct /** * Whether to expect errors to be logged. * Will check for no errors if set to false. - * - * @var bool */ - protected $expectErrors = false; + protected bool $expectErrors = false; protected function setUp(): void { @@ -88,7 +86,11 @@ abstract class AbstractImportTestCase extends \TYPO3\TestingFramework\Core\Funct return; } foreach ($this->getLogFiles() as $file) { - self::assertSame('', file_get_contents($file), 'The TYPO3 log file "' . $file . '" contained content while expecting to be empty.'); + self::assertSame( + '', + file_get_contents($file), + 'The TYPO3 log file "' . $file . '" contained content while expecting to be empty.' + ); } }