mirror of
https://github.com/werkraum-media/thuecat.git
synced 2024-09-28 19:26:11 +02:00
Make compatible with PHP 7.3
As some projects still might run on PHP 7.3 and supported TYPO3 version still supports 7.3.
This commit is contained in:
parent
3bcddd94bb
commit
c91f665d98
38 changed files with 485 additions and 107 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
@ -16,6 +16,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version:
|
php-version:
|
||||||
|
- 7.3
|
||||||
- 7.4
|
- 7.4
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -176,6 +177,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version:
|
php-version:
|
||||||
|
- 7.3
|
||||||
- 7.4
|
- 7.4
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
@ -33,10 +33,25 @@ use WerkraumMedia\ThueCat\View\Backend\Menu;
|
||||||
|
|
||||||
class ImportController extends AbstractController
|
class ImportController extends AbstractController
|
||||||
{
|
{
|
||||||
private Importer $importer;
|
/**
|
||||||
private ImportLogRepository $repository;
|
* @var Importer
|
||||||
private TranslationService $translation;
|
*/
|
||||||
private Menu $menu;
|
private $importer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ImportLogRepository
|
||||||
|
*/
|
||||||
|
private $repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TranslationService
|
||||||
|
*/
|
||||||
|
private $translation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Menu
|
||||||
|
*/
|
||||||
|
private $menu;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Importer $importer,
|
Importer $importer,
|
||||||
|
|
|
@ -29,9 +29,20 @@ use WerkraumMedia\ThueCat\View\Backend\Menu;
|
||||||
|
|
||||||
class OverviewController extends AbstractController
|
class OverviewController extends AbstractController
|
||||||
{
|
{
|
||||||
private OrganisationRepository $organisationRepository;
|
/**
|
||||||
private ImportConfigurationRepository $importConfigurationRepository;
|
* @var OrganisationRepository
|
||||||
private Menu $menu;
|
*/
|
||||||
|
private $organisationRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ImportConfigurationRepository
|
||||||
|
*/
|
||||||
|
private $importConfigurationRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Menu
|
||||||
|
*/
|
||||||
|
private $menu;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
OrganisationRepository $organisationRepository,
|
OrganisationRepository $organisationRepository,
|
||||||
|
|
|
@ -32,8 +32,15 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportConfiguration;
|
||||||
|
|
||||||
class Organisation implements Converter
|
class Organisation implements Converter
|
||||||
{
|
{
|
||||||
private Parser $parser;
|
/**
|
||||||
private LanguageHandling $language;
|
* @var Parser
|
||||||
|
*/
|
||||||
|
private $parser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var LanguageHandling
|
||||||
|
*/
|
||||||
|
private $language;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Parser $parser,
|
Parser $parser,
|
||||||
|
|
|
@ -28,7 +28,10 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Converter;
|
||||||
*/
|
*/
|
||||||
class Registry
|
class Registry
|
||||||
{
|
{
|
||||||
private array $converters = [];
|
/**
|
||||||
|
* @var Converter[]
|
||||||
|
*/
|
||||||
|
private $converters = [];
|
||||||
|
|
||||||
public function registerConverter(Converter $converter): void
|
public function registerConverter(Converter $converter): void
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,11 +35,30 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\TownRepository;
|
||||||
|
|
||||||
class TouristAttraction implements Converter
|
class TouristAttraction implements Converter
|
||||||
{
|
{
|
||||||
private Parser $parser;
|
/**
|
||||||
private Offers $parserForOffers;
|
* @var Parser
|
||||||
private LanguageHandling $language;
|
*/
|
||||||
private OrganisationRepository $organisationRepository;
|
private $parser;
|
||||||
private TownRepository $townRepository;
|
|
||||||
|
/**
|
||||||
|
* @var Offers
|
||||||
|
*/
|
||||||
|
private $parserForOffers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var LanguageHandling
|
||||||
|
*/
|
||||||
|
private $language;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var OrganisationRepository
|
||||||
|
*/
|
||||||
|
private $organisationRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TownRepository
|
||||||
|
*/
|
||||||
|
private $townRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Parser $parser,
|
Parser $parser,
|
||||||
|
|
|
@ -34,10 +34,25 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\TownRepository;
|
||||||
|
|
||||||
class TouristInformation implements Converter
|
class TouristInformation implements Converter
|
||||||
{
|
{
|
||||||
private Parser $parser;
|
/**
|
||||||
private LanguageHandling $language;
|
* @var Parser
|
||||||
private OrganisationRepository $organisationRepository;
|
*/
|
||||||
private TownRepository $townRepository;
|
private $parser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var LanguageHandling
|
||||||
|
*/
|
||||||
|
private $language;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var OrganisationRepository
|
||||||
|
*/
|
||||||
|
private $organisationRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TownRepository
|
||||||
|
*/
|
||||||
|
private $townRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Parser $parser,
|
Parser $parser,
|
||||||
|
|
|
@ -33,9 +33,20 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\OrganisationRepository;
|
||||||
|
|
||||||
class Town implements Converter
|
class Town implements Converter
|
||||||
{
|
{
|
||||||
private Parser $parser;
|
/**
|
||||||
private LanguageHandling $language;
|
* @var Parser
|
||||||
private OrganisationRepository $organisationRepository;
|
*/
|
||||||
|
private $parser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var LanguageHandling
|
||||||
|
*/
|
||||||
|
private $language;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var OrganisationRepository
|
||||||
|
*/
|
||||||
|
private $organisationRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Parser $parser,
|
Parser $parser,
|
||||||
|
|
|
@ -36,13 +36,40 @@ use WerkraumMedia\ThueCat\Domain\Repository\Backend\ImportLogRepository;
|
||||||
|
|
||||||
class Importer
|
class Importer
|
||||||
{
|
{
|
||||||
private UrlProviderRegistry $urls;
|
/**
|
||||||
private ConverterRegistry $converter;
|
* @var UrlProviderRegistry
|
||||||
private FetchData $fetchData;
|
*/
|
||||||
private SaveData $saveData;
|
private $urls;
|
||||||
private ImportLog $importLog;
|
|
||||||
private ImportLogRepository $importLogRepository;
|
/**
|
||||||
private ImportConfiguration $configuration;
|
* @var ConverterRegistry
|
||||||
|
*/
|
||||||
|
private $converter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var FetchData
|
||||||
|
*/
|
||||||
|
private $fetchData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var SaveData
|
||||||
|
*/
|
||||||
|
private $saveData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ImportLog
|
||||||
|
*/
|
||||||
|
private $importLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ImportLogRepository
|
||||||
|
*/
|
||||||
|
private $importLogRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ImportConfiguration
|
||||||
|
*/
|
||||||
|
private $configuration;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
UrlProviderRegistry $urls,
|
UrlProviderRegistry $urls,
|
||||||
|
|
|
@ -29,9 +29,20 @@ use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface as CacheFrontendInterface;
|
||||||
|
|
||||||
class FetchData
|
class FetchData
|
||||||
{
|
{
|
||||||
private RequestFactoryInterface $requestFactory;
|
/**
|
||||||
private ClientInterface $httpClient;
|
* @var RequestFactoryInterface
|
||||||
private CacheFrontendInterface $cache;
|
*/
|
||||||
|
private $requestFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ClientInterface
|
||||||
|
*/
|
||||||
|
private $httpClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var CacheFrontendInterface
|
||||||
|
*/
|
||||||
|
private $cache;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
RequestFactoryInterface $requestFactory,
|
RequestFactoryInterface $requestFactory,
|
||||||
|
|
|
@ -26,7 +26,10 @@ use TYPO3\CMS\Core\Site\SiteFinder;
|
||||||
|
|
||||||
class LanguageHandling
|
class LanguageHandling
|
||||||
{
|
{
|
||||||
private SiteFinder $siteFinder;
|
/**
|
||||||
|
* @var SiteFinder
|
||||||
|
*/
|
||||||
|
private $siteFinder;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
SiteFinder $siteFinder
|
SiteFinder $siteFinder
|
||||||
|
|
|
@ -32,9 +32,20 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLogEntry;
|
||||||
|
|
||||||
class SaveData
|
class SaveData
|
||||||
{
|
{
|
||||||
private DataHandler $dataHandler;
|
/**
|
||||||
private ConnectionPool $connectionPool;
|
* @var DataHandler
|
||||||
private array $errorLog;
|
*/
|
||||||
|
private $dataHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var ConnectionPool
|
||||||
|
*/
|
||||||
|
private $connectionPool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $errorLog;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
DataHandler $dataHandler,
|
DataHandler $dataHandler,
|
||||||
|
|
|
@ -31,10 +31,25 @@ use WerkraumMedia\ThueCat\Domain\Import\JsonLD\Parser\OpeningHours;
|
||||||
|
|
||||||
class Parser
|
class Parser
|
||||||
{
|
{
|
||||||
private GenericFields $genericFields;
|
/**
|
||||||
private OpeningHours $openingHours;
|
* @var GenericFields
|
||||||
private Address $address;
|
*/
|
||||||
private Media $media;
|
private $genericFields;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var OpeningHours
|
||||||
|
*/
|
||||||
|
private $openingHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Address
|
||||||
|
*/
|
||||||
|
private $address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Media
|
||||||
|
*/
|
||||||
|
private $media;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
GenericFields $genericFields,
|
GenericFields $genericFields,
|
||||||
|
|
|
@ -72,8 +72,8 @@ class Address
|
||||||
private function getGeo(array $geo): array
|
private function getGeo(array $geo): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'latitude' => floatval($geo['schema:latitude']['@value'] ?? 0.00),
|
'latitude' => floatval($geo['schema:latitude']['@value'] ?? 0.0),
|
||||||
'longitude' => floatval($geo['schema:longitude']['@value'] ?? 0.00),
|
'longitude' => floatval($geo['schema:longitude']['@value'] ?? 0.0),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,10 @@ use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
|
||||||
|
|
||||||
class GenericFields
|
class GenericFields
|
||||||
{
|
{
|
||||||
private LanguageValues $languageValues;
|
/**
|
||||||
|
* @var LanguageValues
|
||||||
|
*/
|
||||||
|
private $languageValues;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
LanguageValues $languageValues
|
LanguageValues $languageValues
|
||||||
|
|
|
@ -25,7 +25,10 @@ use WerkraumMedia\ThueCat\Domain\Import\Importer\FetchData;
|
||||||
|
|
||||||
class Media
|
class Media
|
||||||
{
|
{
|
||||||
private FetchData $fetchData;
|
/**
|
||||||
|
* @var FetchData
|
||||||
|
*/
|
||||||
|
private $fetchData;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
FetchData $fetchData
|
FetchData $fetchData
|
||||||
|
|
|
@ -25,7 +25,10 @@ use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
|
||||||
|
|
||||||
class Offers
|
class Offers
|
||||||
{
|
{
|
||||||
private GenericFields $genericFields;
|
/**
|
||||||
|
* @var GenericFields
|
||||||
|
*/
|
||||||
|
private $genericFields;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
GenericFields $genericFields
|
GenericFields $genericFields
|
||||||
|
|
|
@ -28,7 +28,7 @@ class EntityCollection
|
||||||
/**
|
/**
|
||||||
* @var Entity[]
|
* @var Entity[]
|
||||||
*/
|
*/
|
||||||
private array $entities = [];
|
private $entities = [];
|
||||||
|
|
||||||
public function add(Entity $entity): void
|
public function add(Entity $entity): void
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,13 +25,40 @@ namespace WerkraumMedia\ThueCat\Domain\Import\Model;
|
||||||
|
|
||||||
class GenericEntity implements Entity
|
class GenericEntity implements Entity
|
||||||
{
|
{
|
||||||
private int $typo3StoragePid;
|
/**
|
||||||
private string $typo3DatabaseTableName;
|
* @var int
|
||||||
private int $typo3SystemLanguageUid;
|
*/
|
||||||
private bool $created = false;
|
private $typo3StoragePid;
|
||||||
private int $typo3Uid = 0;
|
|
||||||
private string $remoteId;
|
/**
|
||||||
private array $data;
|
* @var string
|
||||||
|
*/
|
||||||
|
private $typo3DatabaseTableName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private $typo3SystemLanguageUid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $created = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private $typo3Uid = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $remoteId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $data;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
int $typo3StoragePid,
|
int $typo3StoragePid,
|
||||||
|
|
|
@ -30,7 +30,10 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportConfiguration;
|
||||||
*/
|
*/
|
||||||
class Registry
|
class Registry
|
||||||
{
|
{
|
||||||
private array $provider = [];
|
/**
|
||||||
|
* @var UrlProvider[]
|
||||||
|
*/
|
||||||
|
private $provider = [];
|
||||||
|
|
||||||
public function registerProvider(UrlProvider $provider): void
|
public function registerProvider(UrlProvider $provider): void
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,10 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportConfiguration;
|
||||||
|
|
||||||
class StaticUrlProvider implements UrlProvider
|
class StaticUrlProvider implements UrlProvider
|
||||||
{
|
{
|
||||||
private array $urls = [];
|
/**
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
private $urls = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ImportConfiguration $configuration
|
ImportConfiguration $configuration
|
||||||
|
@ -46,7 +49,7 @@ class StaticUrlProvider implements UrlProvider
|
||||||
|
|
||||||
public function createWithConfiguration(
|
public function createWithConfiguration(
|
||||||
ImportConfiguration $configuration
|
ImportConfiguration $configuration
|
||||||
): StaticUrlProvider {
|
): UrlProvider {
|
||||||
return GeneralUtility::makeInstance(self::class, $configuration);
|
return GeneralUtility::makeInstance(self::class, $configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,25 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity as Typo3AbstractEntity;
|
||||||
|
|
||||||
class AbstractEntity extends Typo3AbstractEntity
|
class AbstractEntity extends Typo3AbstractEntity
|
||||||
{
|
{
|
||||||
protected string $remoteId = '';
|
/**
|
||||||
protected string $title = '';
|
* @var string
|
||||||
protected string $description = '';
|
*/
|
||||||
protected ?\DateTimeImmutable $tstamp = null;
|
protected $remoteId = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $title = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTimeImmutable|null
|
||||||
|
*/
|
||||||
|
protected $tstamp = null;
|
||||||
|
|
||||||
public function getRemoteId(): string
|
public function getRemoteId(): string
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,10 +29,25 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
|
|
||||||
class ImportConfiguration extends AbstractEntity
|
class ImportConfiguration extends AbstractEntity
|
||||||
{
|
{
|
||||||
protected string $title = '';
|
/**
|
||||||
protected string $type = '';
|
* @var string
|
||||||
protected string $configuration = '';
|
*/
|
||||||
protected ?\DateTimeImmutable $tstamp = null;
|
protected $title = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $type = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $configuration = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTimeImmutable|null
|
||||||
|
*/
|
||||||
|
protected $tstamp = null;
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,10 @@ class ImportLogEntry extends Typo3AbstractEntity
|
||||||
*/
|
*/
|
||||||
protected $errors = '';
|
protected $errors = '';
|
||||||
|
|
||||||
protected array $errorsAsArray = [];
|
/**
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $errorsAsArray = [];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Entity $entity,
|
Entity $entity,
|
||||||
|
|
|
@ -27,8 +27,15 @@ use TYPO3\CMS\Core\Type\TypeInterface;
|
||||||
|
|
||||||
class Address implements TypeInterface
|
class Address implements TypeInterface
|
||||||
{
|
{
|
||||||
private string $serialized;
|
/**
|
||||||
private array $data;
|
* @var string
|
||||||
|
*/
|
||||||
|
private $serialized;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $data;
|
||||||
|
|
||||||
public function __construct(string $serialized)
|
public function __construct(string $serialized)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,8 +27,15 @@ use TYPO3\CMS\Core\Type\TypeInterface;
|
||||||
|
|
||||||
class Media implements TypeInterface
|
class Media implements TypeInterface
|
||||||
{
|
{
|
||||||
private string $serialized;
|
/**
|
||||||
private array $data;
|
* @var string
|
||||||
|
*/
|
||||||
|
private $serialized;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $data;
|
||||||
|
|
||||||
public function __construct(string $serialized)
|
public function __construct(string $serialized)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,20 @@ namespace WerkraumMedia\ThueCat\Domain\Model\Frontend;
|
||||||
|
|
||||||
class Offer
|
class Offer
|
||||||
{
|
{
|
||||||
private string $title;
|
/**
|
||||||
private string $description;
|
* @var string
|
||||||
private array $prices;
|
*/
|
||||||
|
private $title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $prices;
|
||||||
|
|
||||||
private function __construct(
|
private function __construct(
|
||||||
string $title,
|
string $title,
|
||||||
|
@ -39,7 +50,10 @@ class Offer
|
||||||
$this->prices = $prices;
|
$this->prices = $prices;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createFromArray(array $rawData): self
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public static function createFromArray(array $rawData)
|
||||||
{
|
{
|
||||||
$prices = [];
|
$prices = [];
|
||||||
foreach ($rawData['prices'] as $price) {
|
foreach ($rawData['prices'] as $price) {
|
||||||
|
|
|
@ -30,9 +30,20 @@ use TYPO3\CMS\Core\Type\TypeInterface;
|
||||||
*/
|
*/
|
||||||
class Offers implements TypeInterface, \Iterator
|
class Offers implements TypeInterface, \Iterator
|
||||||
{
|
{
|
||||||
private string $serialized = '';
|
/**
|
||||||
private array $array = [];
|
* @var string
|
||||||
private int $position = 0;
|
*/
|
||||||
|
private $serialized = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $array = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private $position = 0;
|
||||||
|
|
||||||
public function __construct(string $serialized)
|
public function __construct(string $serialized)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,11 +25,30 @@ namespace WerkraumMedia\ThueCat\Domain\Model\Frontend;
|
||||||
|
|
||||||
class OpeningHour
|
class OpeningHour
|
||||||
{
|
{
|
||||||
private string $opens;
|
/**
|
||||||
private string $closes;
|
* @var string
|
||||||
private array $daysOfWeek;
|
*/
|
||||||
private ?\DateTimeImmutable $from;
|
private $opens;
|
||||||
private ?\DateTimeImmutable $through;
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $closes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $daysOfWeek;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTimeImmutable|null
|
||||||
|
*/
|
||||||
|
private $from;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \DateTimeImmutable|null
|
||||||
|
*/
|
||||||
|
private $through;
|
||||||
|
|
||||||
private function __construct(
|
private function __construct(
|
||||||
string $opens,
|
string $opens,
|
||||||
|
@ -45,7 +64,10 @@ class OpeningHour
|
||||||
$this->through = $through;
|
$this->through = $through;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createFromArray(array $rawData): self
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public static function createFromArray(array $rawData)
|
||||||
{
|
{
|
||||||
$from = null;
|
$from = null;
|
||||||
if (isset($rawData['from'])) {
|
if (isset($rawData['from'])) {
|
||||||
|
|
|
@ -30,9 +30,20 @@ use TYPO3\CMS\Core\Type\TypeInterface;
|
||||||
*/
|
*/
|
||||||
class OpeningHours implements TypeInterface, \Iterator
|
class OpeningHours implements TypeInterface, \Iterator
|
||||||
{
|
{
|
||||||
private string $serialized = '';
|
/**
|
||||||
private array $array = [];
|
* @var string
|
||||||
private int $position = 0;
|
*/
|
||||||
|
private $serialized = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
private $array = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private $position = 0;
|
||||||
|
|
||||||
public function __construct(string $serialized)
|
public function __construct(string $serialized)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,11 +25,30 @@ namespace WerkraumMedia\ThueCat\Domain\Model\Frontend;
|
||||||
|
|
||||||
class Price
|
class Price
|
||||||
{
|
{
|
||||||
private string $title;
|
/**
|
||||||
private string $description;
|
* @var string
|
||||||
private float $price;
|
*/
|
||||||
private string $currency;
|
private $title;
|
||||||
private string $rule;
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float
|
||||||
|
*/
|
||||||
|
private $price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $currency;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $rule;
|
||||||
|
|
||||||
private function __construct(
|
private function __construct(
|
||||||
string $title,
|
string $title,
|
||||||
|
@ -45,7 +64,10 @@ class Price
|
||||||
$this->rule = $rule;
|
$this->rule = $rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function createFromArray(array $rawData): self
|
/**
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public static function createFromArray(array $rawData)
|
||||||
{
|
{
|
||||||
return new self(
|
return new self(
|
||||||
$rawData['title'],
|
$rawData['title'],
|
||||||
|
|
|
@ -27,13 +27,40 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
|
|
||||||
class TouristAttraction extends AbstractEntity
|
class TouristAttraction extends AbstractEntity
|
||||||
{
|
{
|
||||||
protected string $title = '';
|
/**
|
||||||
protected string $description = '';
|
* @var string
|
||||||
protected ?OpeningHours $openingHours = null;
|
*/
|
||||||
protected ?Offers $offers = null;
|
protected $title = '';
|
||||||
protected ?Address $address = null;
|
|
||||||
protected ?Town $town = null;
|
/**
|
||||||
protected ?Media $media = null;
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var OpeningHours|null
|
||||||
|
*/
|
||||||
|
protected $openingHours = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Offers|null
|
||||||
|
*/
|
||||||
|
protected $offers = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Address|null
|
||||||
|
*/
|
||||||
|
protected $address = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Town|null
|
||||||
|
*/
|
||||||
|
protected $town = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Media|null
|
||||||
|
*/
|
||||||
|
protected $media = null;
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,8 +27,15 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||||
|
|
||||||
class Town extends AbstractEntity
|
class Town extends AbstractEntity
|
||||||
{
|
{
|
||||||
protected string $title = '';
|
/**
|
||||||
protected string $description = '';
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $title = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = '';
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,10 @@ use WerkraumMedia\ThueCat\Domain\Model\Backend\ImportLog;
|
||||||
|
|
||||||
class ImportLogRepository extends Repository
|
class ImportLogRepository extends Repository
|
||||||
{
|
{
|
||||||
private DataHandler $dataHandler;
|
/**
|
||||||
|
* @var DataHandler
|
||||||
|
*/
|
||||||
|
private $dataHandler;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ObjectManagerInterface $objectManager,
|
ObjectManagerInterface $objectManager,
|
||||||
|
|
|
@ -33,9 +33,20 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
|
||||||
|
|
||||||
class ResolveEntities implements DataProcessorInterface
|
class ResolveEntities implements DataProcessorInterface
|
||||||
{
|
{
|
||||||
private ConnectionPool $connectionPool;
|
/**
|
||||||
private DataMapper $dataMapper;
|
* @var ConnectionPool
|
||||||
private TypoScriptFrontendController $tsfe;
|
*/
|
||||||
|
private $connectionPool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var DataMapper
|
||||||
|
*/
|
||||||
|
private $dataMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TypoScriptFrontendController
|
||||||
|
*/
|
||||||
|
private $tsfe;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ConnectionPool $connectionPool,
|
ConnectionPool $connectionPool,
|
||||||
|
|
|
@ -32,7 +32,10 @@ use WerkraumMedia\ThueCat\Typo3Wrapper\TranslationService;
|
||||||
|
|
||||||
class Menu
|
class Menu
|
||||||
{
|
{
|
||||||
private TranslationService $translation;
|
/**
|
||||||
|
* @var TranslationService
|
||||||
|
*/
|
||||||
|
private $translation;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslationService $translation
|
TranslationService $translation
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4",
|
"php": "^7.3",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"psr/http-client": "^1.0",
|
"psr/http-client": "^1.0",
|
||||||
"psr/http-factory": "^1.0",
|
"psr/http-factory": "^1.0",
|
||||||
|
|
8
ecs.php
8
ecs.php
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||||
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
|
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
|
||||||
use PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer;
|
use PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer;
|
||||||
use PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer;
|
use PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer;
|
||||||
|
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
|
||||||
use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer;
|
use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer;
|
||||||
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
|
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
|
||||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
|
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
|
||||||
|
@ -50,4 +51,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
$services->set(PhpUnitTestAnnotationFixer::class)->call('configure', [[
|
$services->set(PhpUnitTestAnnotationFixer::class)->call('configure', [[
|
||||||
'style' => 'annotation',
|
'style' => 'annotation',
|
||||||
]]);
|
]]);
|
||||||
|
$services->set(ClassAttributesSeparationFixer::class)->call('configure', [[
|
||||||
|
'elements' => [
|
||||||
|
'const' => ClassAttributesSeparationFixer::SPACING_ONE,
|
||||||
|
'method' => ClassAttributesSeparationFixer::SPACING_ONE,
|
||||||
|
'property' => ClassAttributesSeparationFixer::SPACING_ONE,
|
||||||
|
],
|
||||||
|
]]);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue