Rework after first review round

This commit is contained in:
Daniel Siepmann 2023-12-04 15:19:20 +01:00
parent d39053b498
commit dcc9c911ae
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
62 changed files with 217 additions and 655 deletions

View file

@ -27,45 +27,21 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues;
class AccessibilityCertification implements MapsToType class AccessibilityCertification implements MapsToType
{ {
/** protected string $accessibilityCertificationStatus = '';
* @var string
*/
protected $accessibilityCertificationStatus = '';
/** protected string $certificationAccessibilityDeaf = '';
* @var string
*/
protected $certificationAccessibilityDeaf = '';
/** protected string $certificationAccessibilityMental = '';
* @var string
*/
protected $certificationAccessibilityMental = '';
/** protected string $certificationAccessibilityPartiallyDeaf = '';
* @var string
*/
protected $certificationAccessibilityPartiallyDeaf = '';
/** protected string $certificationAccessibilityPartiallyVisual = '';
* @var string
*/
protected $certificationAccessibilityPartiallyVisual = '';
/** protected string $certificationAccessibilityVisual = '';
* @var string
*/
protected $certificationAccessibilityVisual = '';
/** protected string $certificationAccessibilityWalking = '';
* @var string
*/
protected $certificationAccessibilityWalking = '';
/** protected string $certificationAccessibilityWheelchair = '';
* @var string
*/
protected $certificationAccessibilityWheelchair = '';
public function getAccessibilityCertificationStatus(): string public function getAccessibilityCertificationStatus(): string
{ {

View file

@ -27,45 +27,21 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues;
class AccessibilitySpecification implements MapsToType class AccessibilitySpecification implements MapsToType
{ {
/** protected AccessibilityCertification $accessibilityCertification;
* @var AccessibilityCertification
*/
protected $accessibilityCertification;
/** protected array $accessibilitySearchCriteria = [];
* @var array
*/
protected $accessibilitySearchCriteria = [];
/** protected string $shortDescriptionAccessibilityAllGenerations = '';
* @var string
*/
protected $shortDescriptionAccessibilityAllGenerations = '';
/** protected string $shortDescriptionAccessibilityAllergic = '';
* @var string
*/
protected $shortDescriptionAccessibilityAllergic = '';
/** protected string $shortDescriptionAccessibilityDeaf = '';
* @var string
*/
protected $shortDescriptionAccessibilityDeaf = '';
/** protected string $shortDescriptionAccessibilityMental = '';
* @var string
*/
protected $shortDescriptionAccessibilityMental = '';
/** protected string $shortDescriptionAccessibilityVisual = '';
* @var string
*/
protected $shortDescriptionAccessibilityVisual = '';
/** protected string $shortDescriptionAccessibilityWalking = '';
* @var string
*/
protected $shortDescriptionAccessibilityWalking = '';
public function getAccessibilityCertification(): ?AccessibilityCertification public function getAccessibilityCertification(): ?AccessibilityCertification
{ {

View file

@ -30,17 +30,14 @@ class Base extends Minimum
{ {
use ManagedBy; use ManagedBy;
/** protected ForeignReference $photo;
* @var ForeignReference
*/
protected $photo;
/** /**
* Images of this Thing. * Images of this Thing.
* *
* @var ForeignReference[] * @var ForeignReference[]
*/ */
protected $images = []; protected array $images = [];
public function getPhoto(): ?ForeignReference public function getPhoto(): ?ForeignReference
{ {

View file

@ -27,30 +27,18 @@ use WerkraumMedia\ThueCat\Domain\Import\Entity\Properties\ForeignReference;
class MediaObject extends Minimum implements MapsToType class MediaObject extends Minimum implements MapsToType
{ {
/** protected int $copyrightYear = 0;
* @var int
*/
protected $copyrightYear = 0;
/** protected string $license = '';
* @var string
*/
protected $license = '';
/** protected string $licenseAuthor = '';
* @var string
*/
protected $licenseAuthor = '';
/** /**
* @var string|ForeignReference * @var string|ForeignReference
*/ */
protected $author; protected $author;
/** protected string $type = '';
* @var string
*/
protected $type = '';
public function getCopyrightYear(): int public function getCopyrightYear(): int
{ {

View file

@ -29,33 +29,27 @@ abstract class Minimum
* URL to the original source at ThüCAT. * URL to the original source at ThüCAT.
* Not unique within our system. We have one entity per language, * Not unique within our system. We have one entity per language,
* while ThüCAT has a single entity containing all languages. * while ThüCAT has a single entity containing all languages.
*
* @var string
*/ */
protected $id = ''; protected string $id = '';
/** /**
* Short name of the thing. * Short name of the thing.
* Can be translated. * Can be translated.
*
* @var string
*/ */
protected $name = ''; protected string $name = '';
/** /**
* Long text describing the thing. * Long text describing the thing.
* Can be translated. * Can be translated.
*
* @var string
*/ */
protected $description = ''; protected string $description = '';
/** /**
* URL to official version of this thing outside of ThüCAT. * URL to official version of this thing outside of ThüCAT.
* *
* @var string[] * @var string[]
*/ */
protected $urls = []; protected array $urls = [];
public function getId(): string public function getId(): string
{ {

View file

@ -25,15 +25,9 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity;
class Person extends Base implements MapsToType class Person extends Base implements MapsToType
{ {
/** protected string $givenName = '';
* @var string
*/
protected $givenName = '';
/** protected string $familyName = '';
* @var string
*/
protected $familyName = '';
public function getGivenName(): string public function getGivenName(): string
{ {

View file

@ -39,60 +39,48 @@ class Place extends Base
use Organization; use Organization;
use ContainedInPlace; use ContainedInPlace;
/** protected Address $address;
* @var Address
*/
protected $address;
/** protected Geo $geo;
* @var Geo
*/
protected $geo;
/** /**
* @var OpeningHour[] * @var OpeningHour[]
*/ */
protected $openingHoursSpecifications = []; protected array $openingHoursSpecifications = [];
/** /**
* @var OpeningHour[] * @var OpeningHour[]
*/ */
protected $specialOpeningHours = []; protected array $specialOpeningHours = [];
/** /**
* @var ForeignReference[] * @var ForeignReference[]
*/ */
protected $parkingFacilitiesNearBy = []; protected array $parkingFacilitiesNearBy = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $sanitations = []; protected array $sanitations = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $otherServices = []; protected array $otherServices = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $trafficInfrastructures = []; protected array $trafficInfrastructures = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $paymentsAccepted = []; protected array $paymentsAccepted = [];
/** protected string $distanceToPublicTransport = '';
* @var string
*/
protected $distanceToPublicTransport = '';
/** protected ForeignReference $accessibilitySpecification;
* @var ForeignReference
*/
protected $accessibilitySpecification;
public function getAddress(): ?Address public function getAddress(): ?Address
{ {

View file

@ -25,35 +25,17 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity\Properties;
class Address class Address
{ {
/** protected string $streetAddress = '';
* @var string
*/
protected $streetAddress = '';
/** protected string $addressLocality = '';
* @var string
*/
protected $addressLocality = '';
/** protected string $postalCode = '';
* @var string
*/
protected $postalCode = '';
/** protected string $telephone = '';
* @var string
*/
protected $telephone = '';
/** protected string $faxNumber = '';
* @var string
*/
protected $faxNumber = '';
/** protected string $email = '';
* @var string
*/
protected $email = '';
public function getStreetAddress(): string public function getStreetAddress(): string
{ {

View file

@ -25,10 +25,7 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity\Properties;
class DayOfWeek class DayOfWeek
{ {
/** protected string $dayOfWeek = '';
* @var string
*/
protected $dayOfWeek = '';
public function __construct( public function __construct(
string $dayOfWeek string $dayOfWeek

View file

@ -33,10 +33,8 @@ class ForeignReference
* URL to the original source at ThüCAT. * URL to the original source at ThüCAT.
* Not unique within our system. We have one entity per language, * Not unique within our system. We have one entity per language,
* while ThüCAT has a single entity containing all languages. * while ThüCAT has a single entity containing all languages.
*
* @var string
*/ */
protected $id = ''; protected string $id = '';
public function getId(): string public function getId(): string
{ {

View file

@ -25,15 +25,9 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Entity\Properties;
class Geo class Geo
{ {
/** protected float $longitude = 0.00;
* @var float
*/
protected $longitude = 0.00;
/** protected float $latitude = 0.00;
* @var float
*/
protected $latitude = 0.00;
public function getLongitude(): float public function getLongitude(): float
{ {

View file

@ -31,12 +31,12 @@ class Offer extends Minimum
/** /**
* @var string[] * @var string[]
*/ */
protected $offerTypes = []; protected array $offerTypes = [];
/** /**
* @var PriceSpecification[] * @var PriceSpecification[]
*/ */
protected $prices = []; protected array $prices = [];
/** /**
* @return string[] * @return string[]

View file

@ -27,30 +27,18 @@ use DateTimeImmutable;
class OpeningHour class OpeningHour
{ {
/** protected ?DateTimeImmutable $validFrom;
* @var DateTimeImmutable|null
*/
protected $validFrom;
/** protected ?DateTimeImmutable $validThrough;
* @var DateTimeImmutable|null
*/
protected $validThrough;
/** protected DateTimeImmutable $opens;
* @var DateTimeImmutable
*/
protected $opens;
/** protected DateTimeImmutable $closes;
* @var DateTimeImmutable
*/
protected $closes;
/** /**
* @var string[] * @var string[]
*/ */
protected $daysOfWeek = []; protected array $daysOfWeek = [];
public function getValidFrom(): ?DateTimeImmutable public function getValidFrom(): ?DateTimeImmutable
{ {

View file

@ -28,26 +28,19 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues;
class PriceSpecification extends Minimum class PriceSpecification extends Minimum
{ {
/** protected float $price = 0.00;
* @var float
*/
protected $price = 0.00;
/** /**
* E.g. 'EUR' * E.g. 'EUR'
* ThueCat specific format. * ThueCat specific format.
*
* @var string
*/ */
protected $currency = ''; protected string $currency = '';
/** /**
* E.g. 'PerPerson' * E.g. 'PerPerson'
* ThueCat specific property. * ThueCat specific property.
*
* @var array
*/ */
protected $calculationRules = []; protected array $calculationRules = [];
public function getPrice(): float public function getPrice(): float
{ {

View file

@ -29,10 +29,8 @@ trait ManagedBy
{ {
/** /**
* The Thing responsible for the data within this Thing. * The Thing responsible for the data within this Thing.
*
* @var ForeignReference
*/ */
protected $managedBy; protected ?ForeignReference $managedBy;
public function getManagedBy(): ?ForeignReference public function getManagedBy(): ?ForeignReference
{ {

View file

@ -34,7 +34,7 @@ trait Organization
/** /**
* @var Offer[] * @var Offer[]
*/ */
protected $offers = []; protected array $offers = [];
/** /**
* @return Offer[] * @return Offer[]

View file

@ -27,55 +27,40 @@ use WerkraumMedia\ThueCat\Domain\Import\EntityMapper\PropertyValues;
class TouristAttraction extends Place implements MapsToType class TouristAttraction extends Place implements MapsToType
{ {
/** protected string $slogan = '';
* @var string
*/
protected $slogan = '';
/** protected string $startOfConstruction = '';
* @var string
*/
protected $startOfConstruction = '';
/** /**
* @var string[] * @var string[]
*/ */
protected $museumServices = []; protected array $museumServices = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $architecturalStyles = []; protected array $architecturalStyles = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $digitalOffers = []; protected array $digitalOffers = [];
/** /**
* @var string[] * @var string[]
*/ */
protected $photographies = []; protected array $photographies = [];
/** protected string $petsAllowed = '';
* @var string
*/
protected $petsAllowed = '';
/** protected string $isAccessibleForFree = '';
* @var string
*/
protected $isAccessibleForFree = '';
/** protected string $publicAccess = '';
* @var string
*/
protected $publicAccess = '';
/** /**
* @var string[] * @var string[]
*/ */
protected $availableLanguages = []; protected array $availableLanguages = [];
public function getSlogan(): string public function getSlogan(): string
{ {

View file

@ -31,7 +31,7 @@ class EntityRegistry
/** /**
* @var array[] * @var array[]
*/ */
private $entities = []; private array $entities = [];
/** /**
* @param string[] $supportedTypes * @param string[] $supportedTypes

View file

@ -24,7 +24,6 @@ declare(strict_types=1);
namespace WerkraumMedia\ThueCat\Domain\Import\EntityMapper; namespace WerkraumMedia\ThueCat\Domain\Import\EntityMapper;
use InvalidArgumentException; use InvalidArgumentException;
use function str_starts_with;
use Symfony\Component\Serializer\Encoder\JsonDecode as SymfonyJsonDecode; use Symfony\Component\Serializer\Encoder\JsonDecode as SymfonyJsonDecode;
/** /**
@ -39,7 +38,7 @@ class JsonDecode extends SymfonyJsonDecode
/** /**
* @var array[] * @var array[]
*/ */
private $rulesToKeepTypeInfo = [ private array $rulesToKeepTypeInfo = [
[ [
'type' => 'beginsWith', 'type' => 'beginsWith',
'comparisonValue' => 'thuecat:facilityAccessibility', 'comparisonValue' => 'thuecat:facilityAccessibility',

View file

@ -28,15 +28,9 @@ use Throwable;
class MappingException extends Exception class MappingException extends Exception
{ {
/** protected array $jsonLD = [];
* @var array
*/
protected $jsonLD = [];
/** protected string $targetClassName = '';
* @var string
*/
protected $targetClassName = '';
public function __construct( public function __construct(
array $jsonLD, array $jsonLD,

View file

@ -38,22 +38,16 @@ class Import
/** /**
* @var ImportLog[] * @var ImportLog[]
*/ */
private $importLogStack = []; private array $importLogStack = [];
/** /**
* @var ImportConfiguration[] * @var ImportConfiguration[]
*/ */
private $configurationStack = []; private array $configurationStack = [];
/** private ImportLog $currentImportLog;
* @var ImportLog
*/
private $currentImportLog;
/** private ImportConfiguration $currentConfiguration;
* @var ImportConfiguration
*/
private $currentConfiguration;
public function start(ImportConfiguration $configuration): void public function start(ImportConfiguration $configuration): void
{ {

View file

@ -43,15 +43,9 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\ImportLogRepository;
class Importer class Importer
{ {
/** private Logger $logger;
* @var Logger
*/
private $logger;
/** private Import $import;
* @var Import
*/
private $import;
public function __construct( public function __construct(
private readonly UrlProviderRegistry $urls, private readonly UrlProviderRegistry $urls,

View file

@ -32,15 +32,9 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData\InvalidResponseExcept
class FetchData class FetchData
{ {
/** private string $databaseUrlPrefix = 'https://cdb.thuecat.org';
* @var string
*/
private $databaseUrlPrefix = 'https://cdb.thuecat.org';
/** private string $urlPrefix = 'https://thuecat.org';
* @var string
*/
private $urlPrefix = 'https://thuecat.org';
public function __construct( public function __construct(
private readonly RequestFactoryInterface $requestFactory, private readonly RequestFactoryInterface $requestFactory,

View file

@ -35,7 +35,7 @@ class SaveData
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $errorLog; private array $errorLog;
public function __construct( public function __construct(
private readonly DataHandler $dataHandler, private readonly DataHandler $dataHandler,

View file

@ -28,7 +28,7 @@ class EntityCollection
/** /**
* @var Entity[] * @var Entity[]
*/ */
private $entities = []; private array $entities = [];
public function add(Entity $entity): void public function add(Entity $entity): void
{ {

View file

@ -25,40 +25,22 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Model;
class GenericEntity implements Entity class GenericEntity implements Entity
{ {
/** private int $typo3StoragePid;
* @var int
*/
private $typo3StoragePid;
/** private string $typo3DatabaseTableName;
* @var string
*/
private $typo3DatabaseTableName;
/** private int $typo3SystemLanguageUid;
* @var int
*/
private $typo3SystemLanguageUid;
/** private bool $created = false;
* @var bool
*/
private $created = false;
/** private int $typo3Uid = 0;
* @var int
*/
private $typo3Uid = 0;
/** private string $remoteId;
* @var string
*/
private $remoteId;
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $data; private array $data;
public function __construct( public function __construct(
int $typo3StoragePid, int $typo3StoragePid,

View file

@ -53,20 +53,14 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\TownRepository;
class GeneralConverter implements Converter class GeneralConverter implements Converter
{ {
/** private Logger $logger;
* @var Logger
*/
private $logger;
/** private ImportConfiguration $importConfiguration;
* @var ImportConfiguration
*/
private $importConfiguration;
/** /**
* @var string[] * @var string[]
*/ */
private $classToTableMapping = [ private array $classToTableMapping = [
TouristAttraction::class => 'tx_thuecat_tourist_attraction', TouristAttraction::class => 'tx_thuecat_tourist_attraction',
ParkingFacility::class => 'tx_thuecat_parking_facility', ParkingFacility::class => 'tx_thuecat_parking_facility',
Town::class => 'tx_thuecat_town', Town::class => 'tx_thuecat_town',

View file

@ -28,10 +28,7 @@ use WerkraumMedia\ThueCat\Domain\Import\ResolveForeignReference;
class NameExtractor class NameExtractor
{ {
/** private ResolveForeignReference $resolveForeignReference;
* @var ResolveForeignReference
*/
private $resolveForeignReference;
public function __construct( public function __construct(
ResolveForeignReference $resolveForeignReference ResolveForeignReference $resolveForeignReference

View file

@ -37,7 +37,7 @@ class Registry
/** /**
* @var Converter[] * @var Converter[]
*/ */
private $converters = []; private array $converters = [];
public function registerConverter(Converter $converter): void public function registerConverter(Converter $converter): void
{ {

View file

@ -29,10 +29,7 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData;
class ContainsPlaceUrlProvider implements UrlProvider class ContainsPlaceUrlProvider implements UrlProvider
{ {
/** private string $containsPlaceId = '';
* @var string
*/
private $containsPlaceId = '';
public function __construct( public function __construct(
private readonly FetchData $fetchData private readonly FetchData $fetchData

View file

@ -33,7 +33,7 @@ class Registry
/** /**
* @var UrlProvider[] * @var UrlProvider[]
*/ */
private $provider = []; private array $provider = [];
public function registerProvider(UrlProvider $provider): void public function registerProvider(UrlProvider $provider): void
{ {

View file

@ -30,7 +30,7 @@ class StaticUrlProvider implements UrlProvider
/** /**
* @var string[] * @var string[]
*/ */
private $urls = []; private array $urls = [];
public function canProvideForConfiguration( public function canProvideForConfiguration(
ImportConfiguration $configuration ImportConfiguration $configuration

View file

@ -29,10 +29,7 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData;
class SyncScopeUrlProvider implements UrlProvider class SyncScopeUrlProvider implements UrlProvider
{ {
/** private string $syncScopeId = '';
* @var string
*/
private $syncScopeId = '';
public function __construct( public function __construct(
private readonly FetchData $fetchData private readonly FetchData $fetchData

View file

@ -28,25 +28,13 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity as Typo3AbstractEntity;
class AbstractEntity extends Typo3AbstractEntity class AbstractEntity extends Typo3AbstractEntity
{ {
/** protected string $remoteId = '';
* @var string
*/
protected $remoteId = '';
/** protected string $title = '';
* @var string
*/
protected $title = '';
/** protected string $description = '';
* @var string
*/
protected $description = '';
/** protected ?DateTimeImmutable $tstamp;
* @var DateTimeImmutable|null
*/
protected $tstamp;
public function getRemoteId(): string public function getRemoteId(): string
{ {

View file

@ -35,40 +35,28 @@ use WerkraumMedia\ThueCat\Domain\Import\ResolveForeignReference;
class ImportConfiguration extends AbstractEntity implements ImportConfigurationInterface class ImportConfiguration extends AbstractEntity implements ImportConfigurationInterface
{ {
/** protected string $title = '';
* @var string
*/
protected $title = '';
/** protected string $type = '';
* @var string
*/
protected $type = '';
/** protected string $configuration = '';
* @var string
*/
protected $configuration = '';
/** protected ?DateTimeImmutable $tstamp;
* @var DateTimeImmutable|null
*/
protected $tstamp;
/** /**
* @var ObjectStorage<ImportLog> * @var ObjectStorage<ImportLog>
*/ */
protected $logs; protected ObjectStorage $logs;
/** /**
* @var string[]|null * @var string[]|null
*/ */
protected $urls; protected ?array $urls;
/** /**
* @var string[] * @var string[]
*/ */
protected $allowedTypes = []; protected array $allowedTypes = [];
public function __construct() public function __construct()
{ {
@ -98,7 +86,7 @@ class ImportConfiguration extends AbstractEntity implements ImportConfigurationI
public function getLastImported(): ?DateTimeImmutable public function getLastImported(): ?DateTimeImmutable
{ {
$lastImport = null; $lastImport = null;
$positionOfLastLog = (count($this->logs) - 1); $positionOfLastLog = count($this->logs) - 1;
if ($this->logs->offsetExists($positionOfLastLog)) { if ($this->logs->offsetExists($positionOfLastLog)) {
$lastImport = $this->logs->offsetGet($positionOfLastLog); $lastImport = $this->logs->offsetGet($positionOfLastLog);
} }

View file

@ -33,17 +33,11 @@ class ImportLog extends Typo3AbstractEntity
/** /**
* @var ObjectStorage<ImportLogEntry> * @var ObjectStorage<ImportLogEntry>
*/ */
protected $logEntries; protected ObjectStorage $logEntries;
/** protected ?ImportConfiguration $configuration;
* @var ImportConfiguration|null
*/
protected $configuration;
/** protected ?DateTimeImmutable $crdate;
* @var DateTimeImmutable|null
*/
protected $crdate;
public function __construct( public function __construct(
?ImportConfiguration $configuration = null ?ImportConfiguration $configuration = null

View file

@ -29,15 +29,9 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry;
class MappingError extends ImportLogEntry class MappingError extends ImportLogEntry
{ {
/** protected string $remoteId = '';
* @var string
*/
protected $remoteId = '';
/** protected string $errors = '';
* @var string
*/
protected $errors = '';
public function __construct( public function __construct(
MappingException $exception MappingException $exception

View file

@ -29,40 +29,22 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry;
class SavingEntity extends ImportLogEntry class SavingEntity extends ImportLogEntry
{ {
/** protected string $remoteId = '';
* @var string
*/
protected $remoteId = '';
/** protected bool $insertion = false;
* @var bool
*/
protected $insertion = false;
/** protected int $recordUid = 0;
* @var int
*/
protected $recordUid = 0;
/** protected int $recordPid = 0;
* @var int
*/
protected $recordPid = 0;
/** protected string $tableName = '';
* @var string
*/
protected $tableName = '';
/** protected string $errors = '';
* @var string
*/
protected $errors = '';
/** /**
* @var string[] * @var string[]
*/ */
protected $errorsAsArray = []; protected array $errorsAsArray = [];
public function __construct( public function __construct(
Entity $entity, Entity $entity,

View file

@ -30,12 +30,12 @@ class Organisation extends AbstractEntity
/** /**
* @var ObjectStorage<Town> * @var ObjectStorage<Town>
*/ */
protected $managesTowns; protected ObjectStorage $managesTowns;
/** /**
* @var ObjectStorage<TouristInformation> * @var ObjectStorage<TouristInformation>
*/ */
protected $managesTouristInformation; protected ObjectStorage $managesTouristInformation;
public function getManagesTowns(): ObjectStorage public function getManagesTowns(): ObjectStorage
{ {

View file

@ -30,7 +30,7 @@ class Town extends AbstractEntity
/** /**
* @var ObjectStorage<TouristInformation> * @var ObjectStorage<TouristInformation>
*/ */
protected $touristInformation; protected ObjectStorage $touristInformation;
public function getTouristInformation(): ObjectStorage public function getTouristInformation(): ObjectStorage
{ {

View file

@ -27,15 +27,12 @@ use TYPO3\CMS\Core\Type\TypeInterface;
class AccessiblitySpecification implements TypeInterface class AccessiblitySpecification implements TypeInterface
{ {
/** private string $serialized;
* @var string
*/
private $serialized;
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $data; private array $data;
public function __construct(string $serialized) public function __construct(string $serialized)
{ {

View file

@ -27,15 +27,12 @@ use TYPO3\CMS\Core\Type\TypeInterface;
class Address implements TypeInterface class Address implements TypeInterface
{ {
/** private string $serialized;
* @var string
*/
private $serialized;
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $data; private array $data;
public function __construct(string $serialized) public function __construct(string $serialized)
{ {

View file

@ -27,20 +27,11 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
abstract class Base extends AbstractEntity abstract class Base extends AbstractEntity
{ {
/** protected string $title = '';
* @var string
*/
protected $title = '';
/** protected string $description = '';
* @var string
*/
protected $description = '';
/** protected ?Media $media;
* @var Media|null
*/
protected $media;
public function getTitle(): string public function getTitle(): string
{ {

View file

@ -28,20 +28,17 @@ use TYPO3\CMS\Core\Type\TypeInterface;
class Media implements TypeInterface class Media implements TypeInterface
{ {
/** private string $serialized;
* @var string
*/
private $serialized;
/** /**
* @var array[] * @var array[]
*/ */
private $data; private array $data;
/** /**
* @var FileReference[] * @var FileReference[]
*/ */
protected $editorialImages = []; protected array $editorialImages = [];
public function __construct(string $serialized) public function __construct(string $serialized)
{ {

View file

@ -30,17 +30,11 @@ class MergedOpeningHour
/** /**
* @var MergedOpeningHourWeekDay[] * @var MergedOpeningHourWeekDay[]
*/ */
private $weekDays = []; private array $weekDays = [];
/** private ?DateTimeImmutabl $from;
* @var DateTimeImmutable|null
*/
private $from;
/** private ?DateTimeImmutabl $through;
* @var DateTimeImmutable|null
*/
private $through;
public function __construct( public function __construct(
array $weekDays, array $weekDays,

View file

@ -27,20 +27,11 @@ use WerkraumMedia\ThueCat\Domain\TimingFormat;
class MergedOpeningHourWeekDay class MergedOpeningHourWeekDay
{ {
/** private string $opens;
* @var string
*/
private $opens;
/** private string $closes;
* @var string
*/
private $closes;
/** private string $dayOfWeek;
* @var string
*/
private $dayOfWeek;
public function __construct( public function __construct(
string $opens, string $opens,

View file

@ -31,12 +31,9 @@ class MergedOpeningHours implements Iterator, Countable
/** /**
* @var MergedOpeningHour[] * @var MergedOpeningHour[]
*/ */
private $openingHours = []; private array $openingHours = [];
/** private int $position = 0;
* @var int
*/
private $position = 0;
/** /**
* @param MergedOpeningHour[] $openingHours * @param MergedOpeningHour[] $openingHours

View file

@ -27,25 +27,19 @@ use TYPO3\CMS\Core\Utility\ArrayUtility;
class Offer class Offer
{ {
/** private string $title;
* @var string
*/
private $title;
/** /**
* @var string[] * @var string[]
*/ */
private $types; private array $types;
/** private string $description;
* @var string
*/
private $description;
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $prices; private array $prices;
/** /**
* @param string[] $types * @param string[] $types

View file

@ -28,24 +28,18 @@ use Iterator;
use TYPO3\CMS\Core\Type\TypeInterface; use TYPO3\CMS\Core\Type\TypeInterface;
/** /**
* @implements \Iterator<int, Offer> * @implements Iterator<int, Offer>
*/ */
class Offers implements TypeInterface, Iterator, Countable class Offers implements TypeInterface, Iterator, Countable
{ {
/** private string $serialized = '';
* @var string
*/
private $serialized = '';
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $array = []; private array $array = [];
/** private int $position = 0;
* @var int
*/
private $position = 0;
public function __construct(string $serialized) public function __construct(string $serialized)
{ {

View file

@ -29,30 +29,18 @@ use WerkraumMedia\ThueCat\Domain\TimingFormat;
class OpeningHour class OpeningHour
{ {
/** private string $opens;
* @var string
*/
private $opens;
/** private string $closes;
* @var string
*/
private $closes;
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $daysOfWeek; private array $daysOfWeek;
/** private ?DateTimeImmutable $from;
* @var DateTimeImmutable|null
*/
private $from;
/** private ?DateTimeImmutable $through;
* @var DateTimeImmutable|null
*/
private $through;
private function __construct( private function __construct(
string $opens, string $opens,

View file

@ -35,20 +35,14 @@ use WerkraumMedia\ThueCat\Service\DateBasedFilter;
*/ */
class OpeningHours implements TypeInterface, Iterator, Countable class OpeningHours implements TypeInterface, Iterator, Countable
{ {
/** private string $serialized = '';
* @var string
*/
private $serialized = '';
/** /**
* @var mixed[] * @var mixed[]
*/ */
private $array = []; private array $array = [];
/** private int $position = 0;
* @var int
*/
private $position = 0;
public function __construct(string $serialized) public function __construct(string $serialized)
{ {

View file

@ -28,60 +28,30 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
abstract class Place extends Base abstract class Place extends Base
{ {
/** protected ?Address $address;
* @var Address|null
*/
protected $address;
/** protected string $url = '';
* @var string
*/
protected $url = '';
/** protected ?OpeningHours $openingHours;
* @var OpeningHours|null
*/
protected $openingHours;
/** protected ?OpeningHours $specialOpeningHours;
* @var OpeningHours|null
*/
protected $specialOpeningHours;
/** /**
* @var ObjectStorage<ParkingFacility> * @var ObjectStorage<ParkingFacility>
*/ */
protected $parkingFacilityNearBy; protected ObjectStorage $parkingFacilityNearBy;
/** protected string $sanitation = '';
* @var string
*/
protected $sanitation = '';
/** protected string $otherService = '';
* @var string
*/
protected $otherService = '';
/** protected string $trafficInfrastructure = '';
* @var string
*/
protected $trafficInfrastructure = '';
/** protected string $paymentAccepted = '';
* @var string
*/
protected $paymentAccepted = '';
/** protected string $distanceToPublicTransport = '';
* @var string
*/
protected $distanceToPublicTransport = '';
/** protected ?AccessiblitySpecification $accessibilitySpecification;
* @var AccessiblitySpecification|null
*/
protected $accessibilitySpecification;
public function initializeObject(): void public function initializeObject(): void
{ {

View file

@ -27,43 +27,13 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
class Price 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( private function __construct(
string $title, private readonly string $title,
string $description, private readonly string $description,
float $price, private readonly float $price,
string $currency, private readonly string $currency,
array $rules private readonly array $rules
) { ) {
$this->title = $title;
$this->description = $description;
$this->price = $price;
$this->currency = $currency;
$this->rules = $rules;
} }
/** /**

View file

@ -27,60 +27,27 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
class TouristAttraction extends Place class TouristAttraction extends Place
{ {
/** protected string $slogan = '';
* @var string
*/
protected $slogan = '';
/** protected ?Offers $offers;
* @var Offers|null
*/
protected $offers;
/** protected ?Town $town;
* @var Town|null
*/
protected $town;
/** protected string $startOfConstruction = '';
* @var string
*/
protected $startOfConstruction = '';
/** protected string $museumService = '';
* @var string
*/
protected $museumService = '';
/** protected string $architecturalStyle = '';
* @var string
*/
protected $architecturalStyle = '';
/** protected string $digitalOffer = '';
* @var string
*/
protected $digitalOffer = '';
/** protected string $photography = '';
* @var string
*/
protected $photography = '';
/** protected string $petsAllowed = '';
* @var string
*/
protected $petsAllowed = '';
/** protected string $isAccessibleForFree = '';
* @var string
*/
protected $isAccessibleForFree = '';
/** protected string $publicAccess = '';
* @var string
*/
protected $publicAccess = '';
public function getSlogan(): string public function getSlogan(): string
{ {

View file

@ -33,10 +33,7 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
class ResolveEntities implements DataProcessorInterface class ResolveEntities implements DataProcessorInterface
{ {
/** private TypoScriptFrontendController $tsfe;
* @var TypoScriptFrontendController
*/
private $tsfe;
public function __construct( public function __construct(
private readonly ConnectionPool $connectionPool, private readonly ConnectionPool $connectionPool,

View file

@ -29,15 +29,9 @@ use WerkraumMedia\ThueCat\Service\DateBasedFilter;
class FilterBasedOnTypo3Context implements DateBasedFilter class FilterBasedOnTypo3Context implements DateBasedFilter
{ {
/**
* @var Context
*/
private $context;
public function __construct( public function __construct(
Context $context private readonly Context $context
) { ) {
$this->context = $context;
} }
/** /**

View file

@ -36,22 +36,10 @@ use WerkraumMedia\ThueCat\Domain\Model\Frontend\Media;
*/ */
class AfterObjectThawedHandler class AfterObjectThawedHandler
{ {
/**
* @var FileRepository
*/
private $fileRepository;
/**
* @var DataMapFactory
*/
private $dataMapFactory;
public function __construct( public function __construct(
FileRepository $fileRepository, private readonly FileRepository $fileRepository,
DataMapFactory $dataMapFactory private readonly DataMapFactory $dataMapFactory
) { ) {
$this->fileRepository = $fileRepository;
$this->dataMapFactory = $dataMapFactory;
} }
public function __invoke(AfterObjectThawedEvent $event): void public function __invoke(AfterObjectThawedEvent $event): void

View file

@ -50,10 +50,4 @@ return [
TouristAttraction::class => [ TouristAttraction::class => [
'tableName' => 'tx_thuecat_tourist_attraction', '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',
],
]; ];

View file

@ -59,8 +59,6 @@ return (static function (string $extensionKey, string $tableName) {
'renderType' => 'checkboxLabeledToggle', 'renderType' => 'checkboxLabeledToggle',
'items' => [ 'items' => [
[ [
'label' => '',
1 => '',
'labelChecked' => $languagePath . '.insertion.yes', 'labelChecked' => $languagePath . '.insertion.yes',
'labelUnchecked' => $languagePath . '.insertion.no', 'labelUnchecked' => $languagePath . '.insertion.no',
], ],

View file

@ -30,7 +30,9 @@ return (static function (string $extensionKey, string $tableName) {
'sys_language_uid' => [ 'sys_language_uid' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => ['type' => 'language'], 'config' => [
'type' => 'language',
],
], ],
'l18n_parent' => [ 'l18n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
@ -38,7 +40,12 @@ return (static function (string $extensionKey, string $tableName) {
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [['label' => '', 'value' => 0]], 'items' => [
[
'label' => '',
'value' => 0,
]
],
'foreign_table' => $tableName, 'foreign_table' => $tableName,
'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)', 'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)',
'default' => 0, 'default' => 0,
@ -57,8 +64,6 @@ return (static function (string $extensionKey, string $tableName) {
'renderType' => 'checkboxToggle', 'renderType' => 'checkboxToggle',
'items' => [ 'items' => [
[ [
'label' => '',
1 => '',
'invertStateDisplay' => true, 'invertStateDisplay' => true,
], ],
], ],

View file

@ -30,7 +30,9 @@ return (static function (string $extensionKey, string $tableName) {
'sys_language_uid' => [ 'sys_language_uid' => [
'exclude' => true, 'exclude' => true,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => ['type' => 'language'], 'config' => [
'type' => 'language',
],
], ],
'l18n_parent' => [ 'l18n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0', 'displayCond' => 'FIELD:sys_language_uid:>:0',
@ -38,7 +40,12 @@ return (static function (string $extensionKey, string $tableName) {
'config' => [ 'config' => [
'type' => 'select', 'type' => 'select',
'renderType' => 'selectSingle', 'renderType' => 'selectSingle',
'items' => [['label' => '', 'value' => 0]], 'items' => [
[
'label' => '',
'value' => 0,
]
],
'foreign_table' => $tableName, 'foreign_table' => $tableName,
'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)', 'foreign_table_where' => 'AND ' . $tableName . '.pid=###CURRENT_PID### AND ' . $tableName . '.sys_language_uid IN (-1,0)',
'default' => 0, 'default' => 0,

View file

@ -33,10 +33,8 @@ abstract class AbstractImportTestCase extends \TYPO3\TestingFramework\Core\Funct
/** /**
* Whether to expect errors to be logged. * Whether to expect errors to be logged.
* Will check for no errors if set to false. * Will check for no errors if set to false.
*
* @var bool
*/ */
protected $expectErrors = false; protected bool $expectErrors = false;
protected function setUp(): void protected function setUp(): void
{ {
@ -88,7 +86,11 @@ abstract class AbstractImportTestCase extends \TYPO3\TestingFramework\Core\Funct
return; return;
} }
foreach ($this->getLogFiles() as $file) { 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.'
);
} }
} }