diff --git a/Classes/Command/AbstractCommand.php b/Classes/Command/AbstractCommand.php index 770fa35..1da4433 100644 --- a/Classes/Command/AbstractCommand.php +++ b/Classes/Command/AbstractCommand.php @@ -4,7 +4,8 @@ namespace IchHabRecht\Filefill\Command; -use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ArrayParameterType; +use Doctrine\DBAL\ParameterType; use Symfony\Component\Console\Command\Command; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -20,20 +21,20 @@ protected function getEnabledStorages(): array $rows = $queryBuilder->select('uid', 'name') ->from('sys_file_storage') ->where( - $expressionBuilder->orX( + $expressionBuilder->or( $expressionBuilder->eq( 'tx_filefill_enable', - $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter(1, ParameterType::INTEGER) ), $expressionBuilder->in( 'uid', - $queryBuilder->createNamedParameter($configuredStorages, Connection::PARAM_INT_ARRAY) + $queryBuilder->createNamedParameter($configuredStorages, ArrayParameterType::INTEGER) ) ) ) ->orderBy('uid') - ->execute() - ->fetchAll(); + ->executeQuery() + ->fetchAllAssociative(); return array_combine(array_map('intval', array_column($rows, 'uid')), $rows); } diff --git a/Classes/Command/DeleteCommand.php b/Classes/Command/DeleteCommand.php index 614ee68..ad9d7da 100644 --- a/Classes/Command/DeleteCommand.php +++ b/Classes/Command/DeleteCommand.php @@ -13,15 +13,9 @@ class DeleteCommand extends AbstractCommand { - /** - * @var FileRepository - */ - protected $fileRepository; + protected FileRepository $fileRepository; - /** - * @var LanguageService - */ - protected $languageService; + protected LanguageService $languageService; public function __construct(string $name = null, FileRepository $fileRepository = null, $languageService = null) { diff --git a/Classes/Command/ResetCommand.php b/Classes/Command/ResetCommand.php index 62349c2..d54ef9a 100644 --- a/Classes/Command/ResetCommand.php +++ b/Classes/Command/ResetCommand.php @@ -4,7 +4,9 @@ namespace IchHabRecht\Filefill\Command; +use Doctrine\DBAL\ArrayParameterType; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ParameterType; use IchHabRecht\Filefill\Repository\FileRepository; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -14,15 +16,9 @@ class ResetCommand extends AbstractCommand { - /** - * @var \TYPO3\CMS\Core\Database\Connection - */ - protected $connection; + protected Connection $connection; - /** - * @var FileRepository - */ - protected $fileRepository; + protected FileRepository $fileRepository; public function __construct(string $name = null, Connection $connection = null, FileRepository $fileRepository = null) { @@ -76,28 +72,28 @@ protected function execute(InputInterface $input, OutputInterface $output): int ->where( $expressionBuilder->in( 'f.storage', - $queryBuilder->createNamedParameter(array_keys($enabledStorages), Connection::PARAM_INT_ARRAY) + $queryBuilder->createNamedParameter(array_keys($enabledStorages), ArrayParameterType::INTEGER) ), $expressionBuilder->eq( 'f.missing', - $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter(1, ParameterType::INTEGER) ) ) ->groupBy('f.storage') ->orderBy('f.storage') - ->execute(); + ->executeQuery(); - while ($row = $statement->fetch()) { + while ($row = $statement->fetchAssociative()) { $updateQueryBuilder = $this->connection->createQueryBuilder(); $updateQueryBuilder->update('sys_file') ->where( $updateQueryBuilder->expr()->eq( 'storage', - $updateQueryBuilder->createNamedParameter($row['storage'], \PDO::PARAM_INT) + $updateQueryBuilder->createNamedParameter($row['storage'], ParameterType::INTEGER) ) ) - ->set('missing', 0, true, \PDO::PARAM_INT) - ->execute(); + ->set('missing', 0, true, ParameterType::INTEGER) + ->executeStatement(); $output->writeln(sprintf( 'Reset %d file(s) in storage "%s" (uid: %d)', $row['count'], diff --git a/Classes/Form/Element/ShowDeleteFiles.php b/Classes/Form/Element/ShowDeleteFiles.php index a44eedf..ffee4d5 100644 --- a/Classes/Form/Element/ShowDeleteFiles.php +++ b/Classes/Form/Element/ShowDeleteFiles.php @@ -19,48 +19,36 @@ use IchHabRecht\Filefill\Repository\FileRepository; use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; -use TYPO3\CMS\Backend\Form\NodeFactory; -use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Imaging\IconSize; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; class ShowDeleteFiles extends AbstractFormElement { - /** - * @var FileRepository|null - */ - protected $fileRepository; - - /** - * @var LanguageService - */ - protected $languageService; - /** * Container objects give $nodeFactory down to other containers. * - * @param NodeFactory $nodeFactory - * @param array $data - * @param FileRepository|null $fileRepository - * @param LanguageService|null $languageService + * @param FileRepository $fileRepository + * @param LanguageService $languageService */ - public function __construct(NodeFactory $nodeFactory, array $data, FileRepository $fileRepository = null, $languageService = null) - { - parent::__construct($nodeFactory, $data); - $this->fileRepository = $fileRepository ?: GeneralUtility::makeInstance(FileRepository::class); - $this->languageService = $languageService ?: $GLOBALS['LANG']; + public function __construct( + protected readonly FileRepository $fileRepository, + protected readonly LanguageService $languageService + ) { } /** * @return array */ - public function render() + public function render(): array { $result = $this->initializeResultArray(); $rows = $this->fileRepository->countByIdentifier($this->data['vanillaUid']); + // TODO https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-97330-FormEngineElementClassesMustCreateLabelOrLegend.html + $html = []; $html[] = '
'; @@ -75,7 +63,7 @@ public function render() $html[] = '
'; $html[] = '
'; $html[] = ''; - $html[] = $iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL); + $html[] = $iconFactory->getIcon('actions-edit-delete', IconSize::SMALL); $html[] = ' ' . sprintf( $this->languageService->sL('LLL:EXT:filefill/Resources/Private/Language/locallang_db.xlf:sys_file_storage.filefill.delete_files'), $row['count'], diff --git a/Classes/Form/Element/ShowMissingFiles.php b/Classes/Form/Element/ShowMissingFiles.php index 724600c..ee53b48 100644 --- a/Classes/Form/Element/ShowMissingFiles.php +++ b/Classes/Form/Element/ShowMissingFiles.php @@ -17,40 +17,30 @@ * LICENSE file that was distributed with this source code. */ -use Doctrine\DBAL\FetchMode; +use Doctrine\DBAL\ParameterType; use TYPO3\CMS\Backend\Form\Element\AbstractFormElement; -use TYPO3\CMS\Backend\Form\NodeFactory; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Imaging\IconSize; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; class ShowMissingFiles extends AbstractFormElement { - /** - * @var LanguageService - */ - protected $languageService; - /** * Container objects give $nodeFactory down to other containers. * - * @param NodeFactory $nodeFactory - * @param array $data * @param LanguageService|null $languageService * @throws \InvalidArgumentException */ - public function __construct(NodeFactory $nodeFactory, array $data, $languageService = null) + public function __construct(protected readonly LanguageService $languageService) { - parent::__construct($nodeFactory, $data); - $this->languageService = $languageService ?: $GLOBALS['LANG']; } /** * @return array */ - public function render() + public function render(): array { $result = $this->initializeResultArray(); @@ -61,15 +51,17 @@ public function render() ->where( $expressionBuilder->eq( 'storage', - $queryBuilder->createNamedParameter($this->data['vanillaUid'], \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($this->data['vanillaUid'], ParameterType::INTEGER) ), $expressionBuilder->eq( 'missing', - $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter(1, ParameterType::INTEGER) ) ) - ->execute() - ->fetch(FetchMode::NUMERIC)[0] ?? 0; + ->executeQuery() + ->fetchNumeric()[0] ?? 0; + + // TODO https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-97330-FormEngineElementClassesMustCreateLabelOrLegend.html $html = []; $html[] = '
'; @@ -89,7 +81,7 @@ public function render() $html[] = '
'; $html[] = '
'; $html[] = ''; - $html[] = $iconFactory->getIcon('actions-database-reload', Icon::SIZE_SMALL); + $html[] = $iconFactory->getIcon('actions-database-reload', IconSize::SMALL); $html[] = ' ' . $this->languageService->sL('LLL:EXT:filefill/Resources/Private/Language/locallang_db.xlf:sys_file_storage.filefill.reset'); $html[] = ''; } diff --git a/Classes/Hooks/ResetMissingFiles.php b/Classes/Hooks/ResetMissingFiles.php index 551f28a..59d1529 100644 --- a/Classes/Hooks/ResetMissingFiles.php +++ b/Classes/Hooks/ResetMissingFiles.php @@ -17,6 +17,7 @@ * LICENSE file that was distributed with this source code. */ +use Doctrine\DBAL\ParameterType; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -42,10 +43,10 @@ public function processDatamap_afterDatabaseOperations($status, $table, $id) ->where( $expressionBuilder->eq( 'storage', - $queryBuilder->createNamedParameter((int)$id, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter((int)$id, ParameterType::INTEGER) ) ) ->set('missing', 0) - ->execute(); + ->executeStatement(); } } diff --git a/Classes/Imaging/GifBuilder.php b/Classes/Imaging/GifBuilder.php index 0bebe84..fa33329 100644 --- a/Classes/Imaging/GifBuilder.php +++ b/Classes/Imaging/GifBuilder.php @@ -7,9 +7,9 @@ class GifBuilder extends \TYPO3\CMS\Frontend\Imaging\GifBuilder { - public function fileName($pre) + public function fileName(): string { - $fileName = parent::fileName($pre); + $fileName = parent::fileName(); $temporaryPath = Environment::getVarPath() . '/transient/'; if (!is_dir($temporaryPath)) { GeneralUtility::mkdir_deep($temporaryPath); diff --git a/Classes/Repository/DomainResourceRepository.php b/Classes/Repository/DomainResourceRepository.php index fe9777a..52c850a 100644 --- a/Classes/Repository/DomainResourceRepository.php +++ b/Classes/Repository/DomainResourceRepository.php @@ -26,7 +26,7 @@ class DomainResourceRepository /** * @return DomainResource[] */ - public function findAll() + public function findAll(): array { $domainResources = []; diff --git a/Classes/Repository/FileRepository.php b/Classes/Repository/FileRepository.php index 0f6b9b8..25dd2ad 100644 --- a/Classes/Repository/FileRepository.php +++ b/Classes/Repository/FileRepository.php @@ -18,6 +18,7 @@ */ use Doctrine\DBAL\Connection; +use Doctrine\DBAL\ParameterType; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Resource\FileInterface; use TYPO3\CMS\Core\Resource\ProcessedFileRepository; @@ -26,20 +27,11 @@ class FileRepository { - /** - * @var Connection - */ - protected $connection; + protected Connection $connection; - /** - * @var ProcessedFileRepository - */ - protected $processedFileRepository; + protected ProcessedFileRepository $processedFileRepository; - /** - * @var ResourceFactory - */ - protected $resourceFactory; + protected ResourceFactory $resourceFactory; public function __construct( Connection $connection = null, @@ -60,7 +52,7 @@ public function countByIdentifier($storage = null): array ->where( $expressionBuilder->neq( 'tx_filefill_identifier', - $queryBuilder->createNamedParameter('', \PDO::PARAM_STR) + $queryBuilder->createNamedParameter('') ) ) ->groupBy('tx_filefill_identifier'); @@ -69,13 +61,13 @@ public function countByIdentifier($storage = null): array $queryBuilder->andWhere( $expressionBuilder->eq( 'storage', - $queryBuilder->createNamedParameter($storage, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($storage, ParameterType::INTEGER) ) ); } - return $queryBuilder->execute() - ->fetchAll(); + return $queryBuilder->executeQuery() + ->fetchAllAssociative(); } public function findByIdentifier(string $identifier, $storage = null): array @@ -87,7 +79,7 @@ public function findByIdentifier(string $identifier, $storage = null): array ->where( $expressionBuilder->eq( 'tx_filefill_identifier', - $queryBuilder->createNamedParameter($identifier, \PDO::PARAM_STR) + $queryBuilder->createNamedParameter($identifier) ) ) ->groupBy('tx_filefill_identifier', 'identifier', 'storage'); @@ -96,13 +88,13 @@ public function findByIdentifier(string $identifier, $storage = null): array $queryBuilder->andWhere( $expressionBuilder->eq( 'storage', - $queryBuilder->createNamedParameter($storage, \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($storage, ParameterType::INTEGER) ) ); } - return $queryBuilder->execute() - ->fetchAll(); + return $queryBuilder->executeQuery() + ->fetchAllAssociative(); } public function updateIdentifier(FileInterface $file, string $identifier) @@ -112,11 +104,11 @@ public function updateIdentifier(FileInterface $file, string $identifier) ->where( $queryBuilder->expr()->eq( 'uid', - $queryBuilder->createNamedParameter($file->getUid(), \PDO::PARAM_INT) + $queryBuilder->createNamedParameter($file->getUid(), ParameterType::INTEGER) ) ) ->set('tx_filefill_identifier', $identifier) - ->execute(); + ->executeStatement(); } public function deleteByIdentifier(string $identifier, $storage = null): int diff --git a/Classes/Resource/Driver/FileFillDriver.php b/Classes/Resource/Driver/FileFillDriver.php index 1358046..b4d6e61 100644 --- a/Classes/Resource/Driver/FileFillDriver.php +++ b/Classes/Resource/Driver/FileFillDriver.php @@ -24,15 +24,9 @@ class FileFillDriver extends LocalDriver { - /** - * @var DriverInterface - */ - protected $originalDriverObject; + protected DriverInterface $originalDriverObject; - /** - * @var RemoteResourceCollection - */ - protected $remoteResourceCollection; + protected RemoteResourceCollection $remoteResourceCollection; public function __construct(array $configuration, DriverInterface $originalDriverObject, RemoteResourceCollection $remoteResourceCollection) { @@ -46,7 +40,7 @@ public function __construct(array $configuration, DriverInterface $originalDrive * @param string $fileIdentifier * @return bool */ - public function fileExists($fileIdentifier) + public function fileExists(string $fileIdentifier): bool { $this->ensureFileExists($fileIdentifier); @@ -59,7 +53,7 @@ public function fileExists($fileIdentifier) * @param string $folderIdentifier * @return bool */ - public function folderExists($folderIdentifier) + public function folderExists(string $folderIdentifier): bool { if (parent::folderExists($folderIdentifier)) { return true; @@ -78,7 +72,7 @@ public function folderExists($folderIdentifier) * @param string $identifier * @return string */ - public function getPublicUrl($identifier) + public function getPublicUrl(string $identifier): ?string { $this->ensureFileExists($identifier); @@ -89,7 +83,7 @@ public function getPublicUrl($identifier) * @param string $fileIdentifier * @return string */ - public function getFileContents($fileIdentifier) + public function getFileContents(string $fileIdentifier): string { $this->ensureFileExists($fileIdentifier); @@ -101,7 +95,7 @@ public function getFileContents($fileIdentifier) * @param bool $writable * @return string */ - public function getFileForLocalProcessing($fileIdentifier, $writable = true) + public function getFileForLocalProcessing(string $fileIdentifier, bool $writable = true): string { $this->ensureFileExists($fileIdentifier); @@ -113,7 +107,7 @@ public function getFileForLocalProcessing($fileIdentifier, $writable = true) * @param array $propertiesToExtract * @return array */ - public function getFileInfoByIdentifier($fileIdentifier, array $propertiesToExtract = []) + public function getFileInfoByIdentifier(string $fileIdentifier, array $propertiesToExtract = []): array { $this->ensureFileExists($fileIdentifier); @@ -124,7 +118,7 @@ public function getFileInfoByIdentifier($fileIdentifier, array $propertiesToExtr * @param string $identifier * @return array */ - public function getPermissions($identifier) + public function getPermissions(string $identifier): array { $this->ensureFileExists($identifier); @@ -133,9 +127,8 @@ public function getPermissions($identifier) /** * @param string $identifier - * @return void */ - public function dumpFileContents($identifier) + public function dumpFileContents(string $identifier): void { $this->ensureFileExists($identifier); @@ -145,7 +138,7 @@ public function dumpFileContents($identifier) /** * @return bool */ - public function isCaseSensitiveFileSystem() + public function isCaseSensitiveFileSystem(): bool { return true; } @@ -154,7 +147,7 @@ public function isCaseSensitiveFileSystem() * @param string $fileIdentifier * @return bool */ - protected function ensureFileExists($fileIdentifier) + protected function ensureFileExists(string $fileIdentifier): bool { $absoluteFilePath = $this->getAbsolutePath($fileIdentifier, false); if (empty($absoluteFilePath) || file_exists($absoluteFilePath)) { @@ -189,7 +182,7 @@ protected function ensureFileExists($fileIdentifier) * @param bool $callOriginalDriver * @return string */ - protected function getAbsolutePath($fileIdentifier, $callOriginalDriver = true) + protected function getAbsolutePath(string $fileIdentifier, bool $callOriginalDriver = true): string { $relativeFilePath = ltrim($this->canonicalizeAndCheckFileIdentifier($fileIdentifier, $callOriginalDriver), '/'); @@ -203,7 +196,7 @@ protected function getAbsolutePath($fileIdentifier, $callOriginalDriver = true) * @param bool $callOriginalDriver * @return string */ - protected function canonicalizeAndCheckFileIdentifier($fileIdentifier, $callOriginalDriver = true) + protected function canonicalizeAndCheckFileIdentifier(string $fileIdentifier, bool $callOriginalDriver = true): string { return $callOriginalDriver ? $this->originalDriverObject->canonicalizeAndCheckFileIdentifier($fileIdentifier) diff --git a/Classes/Resource/Handler/DomainResource.php b/Classes/Resource/Handler/DomainResource.php index e1e56c8..d0071e6 100644 --- a/Classes/Resource/Handler/DomainResource.php +++ b/Classes/Resource/Handler/DomainResource.php @@ -27,19 +27,13 @@ class DomainResource implements RemoteResourceInterface { - /** - * @var RequestFactory - */ - protected $requestFactory; + protected RequestFactory $requestFactory; - /** - * @var string - */ - protected $url; + protected string $url; /** * @param string $configuration - * @param RequestFactory $requestFactory + * @param ?RequestFactory $requestFactory */ public function __construct($configuration, RequestFactory $requestFactory = null) { diff --git a/Classes/Resource/Handler/ImageBuilderResource.php b/Classes/Resource/Handler/ImageBuilderResource.php index 10f47e5..1c6fe9e 100644 --- a/Classes/Resource/Handler/ImageBuilderResource.php +++ b/Classes/Resource/Handler/ImageBuilderResource.php @@ -102,7 +102,7 @@ public function getFile($fileIdentifier, $filePath, FileInterface $fileObject = ]; $gifBuilder = GeneralUtility::makeInstance(GifBuilder::class); $gifBuilder->start($fileArray, []); - $theImage = $gifBuilder->gifBuild(); + $theImage = $gifBuilder->gifBuild()->getFullPath(); if (file_exists($theImage)) { $content = file_get_contents($theImage); unlink($theImage); diff --git a/Classes/Resource/Handler/PlaceholderResource.php b/Classes/Resource/Handler/PlaceholderResource.php index c0b3ffa..ad3ca42 100644 --- a/Classes/Resource/Handler/PlaceholderResource.php +++ b/Classes/Resource/Handler/PlaceholderResource.php @@ -25,20 +25,14 @@ class PlaceholderResource implements RemoteResourceInterface { - /** - * @var array - */ - protected $allowedFileExtensions = [ + protected array $allowedFileExtensions = [ 'gif', 'jpeg', 'jpg', 'png', ]; - /** - * @var RequestFactory - */ - protected $requestFactory; + protected RequestFactory $requestFactory; /** * @var string diff --git a/Classes/Resource/Handler/StaticFileResource.php b/Classes/Resource/Handler/StaticFileResource.php index 8492545..99c25a1 100644 --- a/Classes/Resource/Handler/StaticFileResource.php +++ b/Classes/Resource/Handler/StaticFileResource.php @@ -20,16 +20,14 @@ use IchHabRecht\Filefill\Resource\RemoteResourceInterface; use TYPO3\CMS\Core\Resource\FileInterface; use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser; +use TYPO3\CMS\Core\TypoScript\TypoScriptStringFactory; use TYPO3\CMS\Core\Utility\GeneralUtility; class StaticFileResource implements RemoteResourceInterface { - /** - * @var array - */ - protected $configuration; + protected array $configuration; - protected $tsReplaceConfiguration = [ + protected array $tsReplaceConfiguration = [ [ '*', '/', @@ -42,11 +40,16 @@ class StaticFileResource implements RemoteResourceInterface public function __construct($configuration) { - if (!is_array($configuration)) { + if (empty($configuration)) { + // Null, empty string, empty array, etc + $configuration = []; + } elseif (is_string($configuration)) { $configuration = str_replace($this->tsReplaceConfiguration[0], $this->tsReplaceConfiguration[1], $configuration); - $parser = GeneralUtility::makeInstance(TypoScriptParser::class); - $parser->parse($configuration); - $configuration = $parser->setup; + $parser = GeneralUtility::makeInstance(TypoScriptStringFactory::class); + // TODO Untested!!! + $configuration = $parser + ->parseFromStringWithIncludes('Filefill-StaticFileResource', $configuration) + ->toArray(); } $this->configuration = $this->prepareConfiguration($configuration); diff --git a/Classes/Resource/Handler/SysDomainResource.php b/Classes/Resource/Handler/SysDomainResource.php index 03ff82c..275f73a 100644 --- a/Classes/Resource/Handler/SysDomainResource.php +++ b/Classes/Resource/Handler/SysDomainResource.php @@ -27,12 +27,12 @@ class SysDomainResource implements RemoteResourceInterface /** * @var DomainResource[] */ - protected $domainResources; + protected array $domainResources; /** * @var DomainResource[] */ - protected static $fileIdentifierCache = []; + protected static array $fileIdentifierCache = []; /** * @param string $configuration diff --git a/Classes/Resource/RemoteResourceCollection.php b/Classes/Resource/RemoteResourceCollection.php index 0712a9e..fad7bf8 100644 --- a/Classes/Resource/RemoteResourceCollection.php +++ b/Classes/Resource/RemoteResourceCollection.php @@ -17,6 +17,7 @@ * LICENSE file that was distributed with this source code. */ +use Doctrine\DBAL\ParameterType; use IchHabRecht\Filefill\Exception\MissingInterfaceException; use IchHabRecht\Filefill\Exception\UnknownResourceException; use IchHabRecht\Filefill\Repository\FileRepository; @@ -181,15 +182,15 @@ protected function getFileObjectFromStorage(ResourceStorage $storage, string $fi ->where( $expressionBuilder->eq( 'storage', - $queryBuilder->createNamedParameter((int)$storage->getUid(), \PDO::PARAM_INT) + $queryBuilder->createNamedParameter((int)$storage->getUid(), ParameterType::INTEGER) ), $expressionBuilder->eq( 'identifier', - $queryBuilder->createNamedParameter($fileIdentifier, \PDO::PARAM_STR) + $queryBuilder->createNamedParameter($fileIdentifier) ) ) - ->execute() - ->fetch(\PDO::FETCH_ASSOC); + ->executeQuery() + ->fetchAssociative(); if (empty($databaseRow)) { return null; } diff --git a/composer.json b/composer.json index 06e59c0..7778041 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ } ], "require": { - "php": "^7.4 || ^8.0", - "typo3/cms-core": "^10.4.11 || ^11.5 || ^12.4" + "php": "^8.2", + "typo3/cms-core": "^13.1" }, "require-dev": { "phpunit/phpunit": "^9.6", @@ -49,7 +49,7 @@ }, "extra": { "branch-alias": { - "dev-main": "4.x-dev" + "dev-main": "5.0.x-dev" }, "typo3/cms": { "extension-key": "filefill", diff --git a/ext_emconf.php b/ext_emconf.php index 96ee85d..6dbb2ff 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -10,7 +10,7 @@ * writing. "version" and "dependencies" must not be touched! ***************************************************************/ -$EM_CONF[$_EXTKEY] = array ( +$EM_CONF[$_EXTKEY] = [ 'title' => 'File Fill', 'description' => 'Find and fetch missing local files from different remotes', 'category' => 'misc', @@ -21,20 +21,19 @@ 'uploadfolder' => 0, 'createDirs' => '', 'clearCacheOnLoad' => 0, - 'version' => '4.3.2', + 'version' => '5.0.0', 'constraints' => - array ( + [ 'depends' => - array ( - 'typo3' => '10.4.11-12.4.99', - ), + [ + 'typo3' => '13.1.0-13.4.99', + ], 'conflicts' => - array ( - ), + [ + ], 'suggests' => - array ( - ), - ), + [ + ], + ], '_md5_values_when_last_written' => 'a:50:{s:9:"ChangeLog";s:4:"c0b1";s:7:"LICENSE";s:4:"b234";s:9:"README.md";s:4:"b603";s:13:"composer.json";s:4:"0078";s:13:"composer.lock";s:4:"1f04";s:12:"ext_icon.png";s:4:"970b";s:17:"ext_localconf.php";s:4:"943b";s:14:"ext_tables.sql";s:4:"5d8e";s:16:"phpunit.xml.dist";s:4:"316a";s:24:"sonar-project.properties";s:4:"ea9f";s:35:"Classes/Command/AbstractCommand.php";s:4:"80f5";s:33:"Classes/Command/DeleteCommand.php";s:4:"941a";s:32:"Classes/Command/ResetCommand.php";s:4:"df26";s:58:"Classes/EventListener/FileProcessingEventEventListener.php";s:4:"b00c";s:68:"Classes/EventListener/ResourceStorageInitializationEventListener.php";s:4:"ae8a";s:47:"Classes/Exception/MissingInterfaceException.php";s:4:"a325";s:46:"Classes/Exception/UnknownResourceException.php";s:4:"b4ac";s:40:"Classes/Form/Element/ShowDeleteFiles.php";s:4:"4b59";s:41:"Classes/Form/Element/ShowMissingFiles.php";s:4:"9b38";s:29:"Classes/Hooks/DeleteFiles.php";s:4:"2fbd";s:35:"Classes/Hooks/FlexFormToolsHook.php";s:4:"33f9";s:35:"Classes/Hooks/ResetMissingFiles.php";s:4:"b3af";s:30:"Classes/Imaging/GifBuilder.php";s:4:"2eb6";s:47:"Classes/Repository/DomainResourceRepository.php";s:4:"068b";s:37:"Classes/Repository/FileRepository.php";s:4:"b76a";s:45:"Classes/Resource/RemoteResourceCollection.php";s:4:"26e9";s:52:"Classes/Resource/RemoteResourceCollectionFactory.php";s:4:"d112";s:44:"Classes/Resource/RemoteResourceInterface.php";s:4:"82ca";s:42:"Classes/Resource/Driver/FileFillDriver.php";s:4:"fe02";s:43:"Classes/Resource/Handler/DomainResource.php";s:4:"0c8d";s:49:"Classes/Resource/Handler/ImageBuilderResource.php";s:4:"4898";s:48:"Classes/Resource/Handler/PlaceholderResource.php";s:4:"90fc";s:47:"Classes/Resource/Handler/StaticFileResource.php";s:4:"782f";s:46:"Classes/Resource/Handler/SysDomainResource.php";s:4:"2d30";s:26:"Configuration/Commands.php";s:4:"4ad1";s:27:"Configuration/Services.yaml";s:4:"392d";s:37:"Configuration/FlexForms/Resources.xml";s:4:"6a88";s:48:"Configuration/TCA/Overrides/sys_file_storage.php";s:4:"4d79";s:27:"Resources/Private/.htaccess";s:4:"8594";s:43:"Resources/Private/Language/locallang_db.xlf";s:4:"d515";s:36:"Resources/Public/Icons/Extension.svg";s:4:"0ad6";s:47:"Tests/Functional/AbstractFunctionalTestCase.php";s:4:"03c1";s:33:"Tests/Functional/FilefillTest.php";s:4:"ba60";s:46:"Tests/Functional/Command/DeleteCommandTest.php";s:4:"11e7";s:45:"Tests/Functional/Command/ResetCommandTest.php";s:4:"5ba6";s:47:"Tests/Functional/Fixtures/Database/be_users.csv";s:4:"92a7";s:47:"Tests/Functional/Fixtures/Database/sys_file.csv";s:4:"e7c7";s:56:"Tests/Functional/Fixtures/Database/sys_file_metadata.csv";s:4:"8657";s:55:"Tests/Functional/Fixtures/Database/sys_file_storage.csv";s:4:"91d0";s:54:"Tests/Unit/Resource/Handler/StaticFileResourceTest.php";s:4:"b29e";}', -); - +];