From 4143fd9a5ddb964f494c5ea08a55587f842dcc1e Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Wed, 13 Sep 2023 16:48:18 +0200 Subject: [PATCH 1/4] Consistently use namespace declaration and avoid namespaces in code --- Classes/Command/BaseCommand.php | 6 +++--- Classes/Common/Helper.php | 11 ++++++----- Classes/Common/IiifManifest.php | 2 +- Classes/Common/IiifUrlReader.php | 2 +- Classes/Common/Indexer.php | 14 ++++++++------ Classes/Common/KitodoFlashMessageRenderer.php | 3 ++- Classes/Common/Solr/Solr.php | 11 +++++++---- Classes/Controller/AbstractController.php | 5 +++-- Classes/Controller/BasketController.php | 6 ++++-- Classes/Controller/CollectionController.php | 5 +++-- Classes/Controller/FeedsController.php | 3 ++- Classes/Controller/NavigationController.php | 5 +++-- Classes/Controller/OaiPmhController.php | 2 +- Classes/Controller/ToolboxController.php | 3 ++- Classes/Domain/Model/ActionLog.php | 4 +++- Classes/Domain/Model/Basket.php | 5 +++-- Classes/Domain/Model/Collection.php | 4 +++- Classes/Domain/Model/Document.php | 11 ++++++----- Classes/Domain/Model/Format.php | 4 +++- Classes/Domain/Model/Library.php | 4 +++- Classes/Domain/Model/Mail.php | 4 +++- Classes/Domain/Model/Metadata.php | 11 ++++++----- Classes/Domain/Model/MetadataFormat.php | 10 ++++++---- Classes/Domain/Model/PageSelectForm.php | 4 +++- Classes/Domain/Model/Printer.php | 4 +++- Classes/Domain/Model/SolrCore.php | 4 +++- Classes/Domain/Model/Structure.php | 8 +++++--- Classes/Domain/Model/Token.php | 4 +++- .../Domain/Repository/ActionLogRepository.php | 4 +++- Classes/Domain/Repository/BasketRepository.php | 4 +++- .../Domain/Repository/CollectionRepository.php | 8 +++++--- .../Domain/Repository/DocumentRepository.php | 17 ++++++++++------- Classes/Domain/Repository/FormatRepository.php | 4 +++- Classes/Domain/Repository/LibraryRepository.php | 4 +++- Classes/Domain/Repository/MailRepository.php | 3 ++- .../Repository/MetadataFormatRepository.php | 4 +++- .../Domain/Repository/MetadataRepository.php | 8 ++++---- Classes/Domain/Repository/PrinterRepository.php | 4 +++- .../Domain/Repository/SolrCoreRepository.php | 4 +++- .../Domain/Repository/StructureRepository.php | 4 +++- Classes/Domain/Repository/TokenRepository.php | 5 ++--- .../DocumentTypeFunctionProvider.php | 7 +++---- .../ExpressionLanguage/DocumentTypeProvider.php | 1 - Classes/Format/AudioVideoMD.php | 4 +++- Classes/Format/Mods.php | 3 ++- Classes/Format/TeiHeader.php | 4 +++- Classes/Hooks/ConfigurationForm.php | 11 +++-------- .../EditInProductionWarning.php | 3 ++- .../Form/FieldInformation/SolrCoreStatus.php | 5 +++-- Classes/Hooks/ItemsProcFunc.php | 7 ++++--- Classes/Updates/MigrateSettings.php | 1 - 51 files changed, 169 insertions(+), 109 deletions(-) diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index 56497519d..02f5cd3d2 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -29,7 +29,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; -use TYPO3\CMS\Extbase\Object\ObjectManager; +use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; /** @@ -68,7 +68,7 @@ class BaseCommand extends Command protected $storagePid; /** - * @var \Kitodo\Dlf\Domain\Model\Library + * @var Library */ protected $owner; @@ -110,7 +110,7 @@ public function __construct(CollectionRepository $collectionRepository, protected function initializeRepositories($storagePid) { if (MathUtility::canBeInterpretedAsInteger($storagePid)) { - $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); + $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $frameworkConfiguration['persistence']['storagePid'] = MathUtility::forceIntegerInRange((int) $storagePid, 0); $this->configurationManager->setConfiguration($frameworkConfiguration); diff --git a/Classes/Common/Helper.php b/Classes/Common/Helper.php index 371980800..7c3659be2 100644 --- a/Classes/Common/Helper.php +++ b/Classes/Common/Helper.php @@ -18,16 +18,18 @@ use TYPO3\CMS\Core\Log\LogManager; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageService; +use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; +use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Core\Domain\Repository\PageRepository; - /** * Helper class for the 'dlf' extension * @@ -84,14 +86,13 @@ class Helper * @param bool $session: Should the message be saved in the user's session? * @param string $queue: The queue's unique identifier * - * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue The queue the message was added to + * @return FlashMessageQueue The queue the message was added to */ public static function addMessage($message, $title, $severity, $session = false, $queue = 'kitodo.default.flashMessages') { $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue); - $flashMessage = GeneralUtility::makeInstance( - \TYPO3\CMS\Core\Messaging\FlashMessage::class, + $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $message, $title, $severity, @@ -650,7 +651,7 @@ public static function renderFlashMessages($queue = 'kitodo.default.flashMessage $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue); $flashMessages = $flashMessageQueue->getAllMessagesAndFlush(); - $content = GeneralUtility::makeInstance(\Kitodo\Dlf\Common\KitodoFlashMessageRenderer::class) + $content = GeneralUtility::makeInstance(KitodoFlashMessageRenderer::class) ->render($flashMessages); return $content; } diff --git a/Classes/Common/IiifManifest.php b/Classes/Common/IiifManifest.php index c31cd439d..e7726c85e 100644 --- a/Classes/Common/IiifManifest.php +++ b/Classes/Common/IiifManifest.php @@ -99,7 +99,7 @@ final class IiifManifest extends AbstractDocument protected $originalMetadataArray = []; /** - * Holds the mime types of linked resources in the manifest (extreacted during parsing) for later use. + * Holds the mime types of linked resources in the manifest (extracted during parsing) for later use. * @var array * @access protected */ diff --git a/Classes/Common/IiifUrlReader.php b/Classes/Common/IiifUrlReader.php index 3ca97a260..cbdd28ef5 100644 --- a/Classes/Common/IiifUrlReader.php +++ b/Classes/Common/IiifUrlReader.php @@ -38,7 +38,7 @@ class IiifUrlReader implements UrlReaderInterface /** * * {@inheritDoc} - * @see \Ubl\Iiif\Tools\UrlReaderInterface::getContent() + * @see UrlReaderInterface::getContent() */ public function getContent($url) { diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 0fccb452f..fd2ae7a38 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -15,6 +15,8 @@ use Kitodo\Dlf\Common\Solr\Solr; use Kitodo\Dlf\Domain\Repository\DocumentRepository; use Kitodo\Dlf\Domain\Model\Document; +use Solarium\Core\Query\DocumentInterface; +use Solarium\QueryType\Update\Query\Query; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Messaging\FlashMessage; @@ -87,7 +89,7 @@ class Indexer * * @access public * - * @param \Kitodo\Dlf\Domain\Model\Document $document: The document to add + * @param Document $document: The document to add * * @return bool true on success or false on failure */ @@ -296,7 +298,7 @@ protected static function loadIndexConf($pid) * * @access protected * - * @param \Kitodo\Dlf\Domain\Model\Document $document: The METS document + * @param Document $document: The METS document * @param array $logicalUnit: Array of the logical unit to process * * @return bool true on success or false on failure @@ -425,7 +427,7 @@ protected static function processLogical(Document $document, array $logicalUnit) * * @access protected * - * @param \Kitodo\Dlf\Domain\Model\Document $document: The METS document + * @param Document $document: The METS document * @param int $page: The page number * @param array $physicalUnit: Array of the physical unit to process * @@ -541,12 +543,12 @@ protected static function solrConnect($core, $pid = 0) * * @access private * - * @param \Solarium\QueryType\Update\Query\Query $updateQuery solarium query - * @param \Kitodo\Dlf\Domain\Model\Document $document: The METS document + * @param Query $updateQuery solarium query + * @param Document $document: The METS document * @param array $unit: Array of the logical or physical unit to process * @param string $fullText: Text containing full text for indexing * - * @return \Solarium\Core\Query\DocumentInterface + * @return DocumentInterface */ private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') { $solrDoc = $updateQuery->createDocument(); diff --git a/Classes/Common/KitodoFlashMessageRenderer.php b/Classes/Common/KitodoFlashMessageRenderer.php index 46ddc27ac..ea4d69ce3 100644 --- a/Classes/Common/KitodoFlashMessageRenderer.php +++ b/Classes/Common/KitodoFlashMessageRenderer.php @@ -13,6 +13,7 @@ namespace Kitodo\Dlf\Common; use TYPO3\CMS\Core\Messaging\FlashMessage; +use TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface; /** * A class representing a bootstrap flash messages. @@ -21,7 +22,7 @@ * The created output contains all classes which are required for * the TYPO3 backend. Any kind of message contains also a nice icon. */ -class KitodoFlashMessageRenderer implements \TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface +class KitodoFlashMessageRenderer implements FlashMessageRendererInterface { /** * @var string The message severity class names diff --git a/Classes/Common/Solr/Solr.php b/Classes/Common/Solr/Solr.php index 7c4b64486..99a6924e7 100644 --- a/Classes/Common/Solr/Solr.php +++ b/Classes/Common/Solr/Solr.php @@ -15,6 +15,9 @@ use Kitodo\Dlf\Common\Helper; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; +use Solarium\Client; +use Solarium\Core\Client\Adapter\Http; +use Solarium\QueryType\Server\CoreAdmin\Result\StatusResult; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -298,7 +301,7 @@ public static function getFields() * * @param mixed $core: Name or UID of the core to load or null to get core admin endpoint * - * @return \Kitodo\Dlf\Common\Solr\Solr Instance of this class + * @return Solr Instance of this class */ public static function getInstance($core = null) { @@ -601,7 +604,7 @@ protected function __construct($core) // Get Solr connection parameters from configuration. $this->loadSolrConnectionInfo(); // Configure connection adapter. - $adapter = GeneralUtility::makeInstance(\Solarium\Core\Client\Adapter\Http::class); + $adapter = GeneralUtility::makeInstance(Http::class); // Todo: When updating to TYPO3 >=10.x and Solarium >=6.x // the timeout must be set with the adapter instead of the // endpoint (see below). @@ -627,7 +630,7 @@ protected function __construct($core) ] ]; // Instantiate Solarium\Client class. - $this->service = GeneralUtility::makeInstance(\Solarium\Client::class, $config); + $this->service = GeneralUtility::makeInstance(Client::class, $config); $this->service->setAdapter($adapter); // Todo: When updating to TYPO3 >=10.x and Solarium >=6.x // $adapter and $eventDispatcher are mandatory arguments @@ -647,7 +650,7 @@ protected function __construct($core) if ($core !== null) { $result = $response->getStatusResult(); if ( - $result instanceof \Solarium\QueryType\Server\CoreAdmin\Result\StatusResult + $result instanceof StatusResult && $result->getUptime() > 0 ) { // Set core name. diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 4ab2100b7..2a69ed7e8 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Pagination\PaginatorInterface; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; /** * Abstract controller class for most of the plugin controller. @@ -32,7 +33,7 @@ * @subpackage dlf * @access public */ -abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController implements LoggerAwareInterface +abstract class AbstractController extends ActionController implements LoggerAwareInterface { use LoggerAwareTrait; @@ -52,7 +53,7 @@ public function injectDocumentRepository(DocumentRepository $documentRepository) /** * This holds the current document * - * @var \Kitodo\Dlf\Domain\Model\Document + * @var Document * @access protected */ protected $document; diff --git a/Classes/Controller/BasketController.php b/Classes/Controller/BasketController.php index b4155ca29..b009df004 100644 --- a/Classes/Controller/BasketController.php +++ b/Classes/Controller/BasketController.php @@ -19,7 +19,9 @@ use Kitodo\Dlf\Domain\Repository\MailRepository; use Kitodo\Dlf\Domain\Repository\BasketRepository; use Kitodo\Dlf\Domain\Repository\PrinterRepository; +use TYPO3\CMS\Core\Mail\MailMessage; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Core\Utility\MailUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Core\Context\Context; @@ -544,9 +546,9 @@ protected function sendMail() $mailBody = $hookObj->customizeMailBody($mailText, $pdfUrl); } } - $from = \TYPO3\CMS\Core\Utility\MailUtility::getSystemFrom(); + $from = MailUtility::getSystemFrom(); // send mail - $mail = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Mail\MailMessage::class); + $mail = GeneralUtility::makeInstance(MailMessage::class); // Prepare and send the message $mail // subject diff --git a/Classes/Controller/CollectionController.php b/Classes/Controller/CollectionController.php index 3fa41d016..d4e103fa7 100644 --- a/Classes/Controller/CollectionController.php +++ b/Classes/Controller/CollectionController.php @@ -12,6 +12,7 @@ namespace Kitodo\Dlf\Controller; use Kitodo\Dlf\Common\Solr\Solr; +use Kitodo\Dlf\Domain\Model\Collection; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use Kitodo\Dlf\Domain\Repository\CollectionRepository; @@ -144,11 +145,11 @@ public function listAction() * * @access protected * - * @param \Kitodo\Dlf\Domain\Model\Collection $collection: The collection object + * @param Collection $collection: The collection object * * @return void */ - public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection) + public function showAction(Collection $collection) { $searchParams = $this->getParametersSafely('searchParameter'); diff --git a/Classes/Controller/FeedsController.php b/Classes/Controller/FeedsController.php index 684f842d2..fae8ab06c 100644 --- a/Classes/Controller/FeedsController.php +++ b/Classes/Controller/FeedsController.php @@ -12,6 +12,7 @@ namespace Kitodo\Dlf\Controller; use Kitodo\Dlf\Common\AbstractDocument; +use Kitodo\Dlf\Domain\Model\Library; use Kitodo\Dlf\Domain\Repository\LibraryRepository; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -62,7 +63,7 @@ public function mainAction() $requestData = $this->request->getArguments(); // get library information - /** @var \Kitodo\Dlf\Domain\Model\Library|null $library */ + /** @var Library|null $library */ $library = $this->libraryRepository->findByUid($this->settings['library']); $feedMeta = []; diff --git a/Classes/Controller/NavigationController.php b/Classes/Controller/NavigationController.php index 719380500..fa9eef6ca 100644 --- a/Classes/Controller/NavigationController.php +++ b/Classes/Controller/NavigationController.php @@ -11,6 +11,7 @@ namespace Kitodo\Dlf\Controller; +use Kitodo\Dlf\Domain\Model\PageSelectForm; use TYPO3\CMS\Core\Utility\MathUtility; /** @@ -25,10 +26,10 @@ class NavigationController extends AbstractController { /** * Method to get the page select values and use them with chash - * @param \Kitodo\Dlf\Domain\Model\PageSelectForm|NULL $pageSelectForm + * @param PageSelectForm|NULL $pageSelectForm * @return void */ - public function pageSelectAction(\Kitodo\Dlf\Domain\Model\PageSelectForm $pageSelectForm = NULL) { + public function pageSelectAction(PageSelectForm $pageSelectForm = NULL) { if ($pageSelectForm) { $uri = $this->uriBuilder->reset() ->setArguments( diff --git a/Classes/Controller/OaiPmhController.php b/Classes/Controller/OaiPmhController.php index 224ecbbdb..0164684ae 100644 --- a/Classes/Controller/OaiPmhController.php +++ b/Classes/Controller/OaiPmhController.php @@ -449,7 +449,7 @@ protected function verbListIdentifiers() $this->error = 'idDoesNotExist'; return; } - // create new and empty documentlist + // create new and empty document list $resultSet = []; if (is_array($documentSet)) { $resultSet['elements'] = $documentSet; diff --git a/Classes/Controller/ToolboxController.php b/Classes/Controller/ToolboxController.php index 8adf323c3..ae4334c55 100644 --- a/Classes/Controller/ToolboxController.php +++ b/Classes/Controller/ToolboxController.php @@ -11,6 +11,7 @@ namespace Kitodo\Dlf\Controller; +use Kitodo\Dlf\Common\AbstractDocument; use Kitodo\Dlf\Common\Helper; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -29,7 +30,7 @@ class ToolboxController extends AbstractController /** * This holds the current document * - * @var \Kitodo\Dlf\Common\AbstractDocument + * @var AbstractDocument * @access private */ private $doc; diff --git a/Classes/Domain/Model/ActionLog.php b/Classes/Domain/Model/ActionLog.php index bb107670c..325874c12 100644 --- a/Classes/Domain/Model/ActionLog.php +++ b/Classes/Domain/Model/ActionLog.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * (Basket Plugin) Action log for mails and printouts. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class ActionLog extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class ActionLog extends AbstractEntity { /** * @var int diff --git a/Classes/Domain/Model/Basket.php b/Classes/Domain/Model/Basket.php index 3c9728682..1f79073ff 100644 --- a/Classes/Domain/Model/Basket.php +++ b/Classes/Domain/Model/Basket.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * (Basket Plugin) A basket that is bound to a frontend session. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class Basket extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Basket extends AbstractEntity { /** * @var string|null @@ -41,7 +43,6 @@ class Basket extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity */ protected $sessionId; - /** * @return string|null */ diff --git a/Classes/Domain/Model/Collection.php b/Classes/Domain/Model/Collection.php index 36f26f3a2..0b3c5b0ce 100644 --- a/Classes/Domain/Model/Collection.php +++ b/Classes/Domain/Model/Collection.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * Domain model of the 'Collection'. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class Collection extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Collection extends AbstractEntity { /** * @var int diff --git a/Classes/Domain/Model/Document.php b/Classes/Domain/Model/Document.php index 72a38208e..19f941b26 100644 --- a/Classes/Domain/Model/Document.php +++ b/Classes/Domain/Model/Document.php @@ -14,6 +14,7 @@ use Kitodo\Dlf\Common\AbstractDocument; use TYPO3\CMS\Extbase\Annotation as Extbase; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -24,7 +25,7 @@ * @subpackage dlf * @access public */ -class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Document extends AbstractEntity { /** * @var \DateTime @@ -431,7 +432,7 @@ public function setThumbnail(string $thumbnail): void /** * @return \Kitodo\Dlf\Domain\Model\Structure */ - public function getStructure(): Structure + public function getStructure(): \Kitodo\Dlf\Domain\Model\Structure { return $this->structure; } @@ -439,7 +440,7 @@ public function getStructure(): Structure /** * @param \Kitodo\Dlf\Domain\Model\Structure $structure */ - public function setStructure(Structure $structure): void + public function setStructure(\Kitodo\Dlf\Domain\Model\Structure $structure): void { $this->structure = $structure; } @@ -596,7 +597,7 @@ public function setCollections(?ObjectStorage $collections): void * * @param \Kitodo\Dlf\Domain\Model\Collection $collection */ - public function addCollection(Collection $collection): void + public function addCollection(\Kitodo\Dlf\Domain\Model\Collection $collection): void { $this->collections->attach($collection); } @@ -658,7 +659,7 @@ public function getOwner(): ?Library /** * @param \Kitodo\Dlf\Domain\Model\Library $owner */ - public function setOwner(Library $owner): void + public function setOwner(\Kitodo\Dlf\Domain\Model\Library $owner): void { $this->owner = $owner; } diff --git a/Classes/Domain/Model/Format.php b/Classes/Domain/Model/Format.php index 92844505d..3b8884a97 100644 --- a/Classes/Domain/Model/Format.php +++ b/Classes/Domain/Model/Format.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * Configured data formats and namespaces like MODS, ALTO, IIIF etc. * They are referenced by ``tx_dlf_metadataformat.encoded``. @@ -25,7 +27,7 @@ * @subpackage dlf * @access public */ -class Format extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Format extends AbstractEntity { /** * Name of the type that is used to reference it. diff --git a/Classes/Domain/Model/Library.php b/Classes/Domain/Model/Library.php index 668917a41..6ee1bee4d 100644 --- a/Classes/Domain/Model/Library.php +++ b/Classes/Domain/Model/Library.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * A library institution with the following use cases: * @@ -26,7 +28,7 @@ * @subpackage dlf * @access public */ -class Library extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Library extends AbstractEntity { /** * @var string diff --git a/Classes/Domain/Model/Mail.php b/Classes/Domain/Model/Mail.php index 740e8ba66..685389803 100644 --- a/Classes/Domain/Model/Mail.php +++ b/Classes/Domain/Model/Mail.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * (Basket Plugin) Recipient mail addresses for sending documents. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class Mail extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Mail extends AbstractEntity { /** * @var string diff --git a/Classes/Domain/Model/Metadata.php b/Classes/Domain/Model/Metadata.php index ba03376a6..4dd8322e3 100644 --- a/Classes/Domain/Model/Metadata.php +++ b/Classes/Domain/Model/Metadata.php @@ -13,6 +13,7 @@ namespace Kitodo\Dlf\Domain\Model; use TYPO3\CMS\Extbase\Annotation as Extbase; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; /** @@ -22,7 +23,7 @@ * @subpackage dlf * @access public */ -class Metadata extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Metadata extends AbstractEntity { /** * @var \Kitodo\Dlf\Domain\Model\Metadata @@ -47,7 +48,7 @@ class Metadata extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity protected $indexName; /** - * The formats that encode this metadatum (local IRRE field to ``tx_dlf_metadataformat``). + * The formats that encode this metadata (local IRRE field to ``tx_dlf_metadataformat``). * * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> * @Extbase\ORM\Lazy @@ -125,7 +126,7 @@ protected function initStorageObjects() } /** - * @return \Kitodo\Dlf\Domain\Model\Metadata + * @return Metadata */ public function getL18nParent(): Metadata { @@ -211,7 +212,7 @@ public function setFormat(ObjectStorage $format): void * * @return void */ - public function addFormat(MetadataFormat $format) + public function addFormat(\Kitodo\Dlf\Domain\Model\MetadataFormat $format) { $this->format->attach($format); } @@ -223,7 +224,7 @@ public function addFormat(MetadataFormat $format) * * @return void */ - public function removeFormat(MetadataFormat $formatToRemove) + public function removeFormat(\Kitodo\Dlf\Domain\Model\MetadataFormat $formatToRemove) { $this->format->detach($formatToRemove); } diff --git a/Classes/Domain/Model/MetadataFormat.php b/Classes/Domain/Model/MetadataFormat.php index e280289a9..c3c678ef6 100644 --- a/Classes/Domain/Model/MetadataFormat.php +++ b/Classes/Domain/Model/MetadataFormat.php @@ -12,8 +12,10 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** - * This specifies a way how a metadatum (``tx_dlf_metadata``) may be encoded in a specific data format (``tx_dlf_format``). + * This specifies a way how a metadata (``tx_dlf_metadata``) may be encoded in a specific data format (``tx_dlf_format``). * * For instance, the title of a document may be obtained from either the MODS * title field, or from the TEIHDR caption. This is modeled as two ``tx_dlf_metadaformat`` @@ -25,7 +27,7 @@ * @subpackage dlf * @access public */ -class MetadataFormat extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class MetadataFormat extends AbstractEntity { /** * UID of the ``tx_dlf_metadata`` that is encoded by this metadata entry. @@ -42,14 +44,14 @@ class MetadataFormat extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity protected $encoded; /** - * XPath/JSONPath expression to extract the metadatum (relative to the data format root). + * XPath/JSONPath expression to extract the metadata (relative to the data format root). * * @var string */ protected $xpath; /** - * XPath/JSONPath expression to extract sorting variant (suffixed ``_sorting``) of the metadatum. + * XPath/JSONPath expression to extract sorting variant (suffixed ``_sorting``) of the metadata. * * @var string */ diff --git a/Classes/Domain/Model/PageSelectForm.php b/Classes/Domain/Model/PageSelectForm.php index cfbe16ad5..ba29b917a 100644 --- a/Classes/Domain/Model/PageSelectForm.php +++ b/Classes/Domain/Model/PageSelectForm.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * (Basket Plugin) A basket that is bound to a frontend session. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class PageSelectForm extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class PageSelectForm extends AbstractEntity { /** * @var integer diff --git a/Classes/Domain/Model/Printer.php b/Classes/Domain/Model/Printer.php index 1c277e85b..c0b2e855f 100644 --- a/Classes/Domain/Model/Printer.php +++ b/Classes/Domain/Model/Printer.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * (Basket Plugin) External printers for sending documents. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class Printer extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Printer extends AbstractEntity { /** * @var string diff --git a/Classes/Domain/Model/SolrCore.php b/Classes/Domain/Model/SolrCore.php index 006980aba..84f94cf27 100644 --- a/Classes/Domain/Model/SolrCore.php +++ b/Classes/Domain/Model/SolrCore.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * Cores on the application-wide Solr instance that are available for indexing. * They may be used, for example, as a parameter to the CLI indexing commands, and are referenced by ``tx_dlf_document.solrcore``. @@ -21,7 +23,7 @@ * @subpackage dlf * @access public */ -class SolrCore extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class SolrCore extends AbstractEntity { /** * @var int diff --git a/Classes/Domain/Model/Structure.php b/Classes/Domain/Model/Structure.php index cc5b0499a..46d241078 100644 --- a/Classes/Domain/Model/Structure.php +++ b/Classes/Domain/Model/Structure.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * Domain model of 'Structure'. * @@ -19,10 +21,10 @@ * @subpackage dlf * @access public */ -class Structure extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Structure extends AbstractEntity { /** - * @var \Kitodo\Dlf\Domain\Model\Structure + * @var Structure */ protected $l18nParent; @@ -57,7 +59,7 @@ class Structure extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity protected $status; /** - * @return \Kitodo\Dlf\Domain\Model\Structure + * @return Structure */ public function getL18nParent(): Structure { diff --git a/Classes/Domain/Model/Token.php b/Classes/Domain/Model/Token.php index f8091a91d..95d8ed4e9 100644 --- a/Classes/Domain/Model/Token.php +++ b/Classes/Domain/Model/Token.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Domain\Model; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; + /** * Resumption tokens for OAI-PMH interface. * @@ -19,7 +21,7 @@ * @subpackage dlf * @access public */ -class Token extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class Token extends AbstractEntity { /** * The resumption token string. diff --git a/Classes/Domain/Repository/ActionLogRepository.php b/Classes/Domain/Repository/ActionLogRepository.php index b420e1acc..e83557a01 100644 --- a/Classes/Domain/Repository/ActionLogRepository.php +++ b/Classes/Domain/Repository/ActionLogRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class ActionLogRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class ActionLogRepository extends Repository { } diff --git a/Classes/Domain/Repository/BasketRepository.php b/Classes/Domain/Repository/BasketRepository.php index c0a41ce12..da28f4737 100644 --- a/Classes/Domain/Repository/BasketRepository.php +++ b/Classes/Domain/Repository/BasketRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class BasketRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class BasketRepository extends Repository { } diff --git a/Classes/Domain/Repository/CollectionRepository.php b/Classes/Domain/Repository/CollectionRepository.php index 260defcd6..16cbedec9 100644 --- a/Classes/Domain/Repository/CollectionRepository.php +++ b/Classes/Domain/Repository/CollectionRepository.php @@ -15,9 +15,11 @@ use Kitodo\Dlf\Common\Helper; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Persistence\Repository; use TYPO3\CMS\Extbase\Persistence\QueryInterface; +use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; -class CollectionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +class CollectionRepository extends Repository { /** * Set the default ordering. This is applied to findAll(), too. @@ -33,7 +35,7 @@ class CollectionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository * * @param string $uids separated by comma * - * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface + * @return QueryResultInterface */ public function findAllByUids($uids) { @@ -64,7 +66,7 @@ public function getCollectionForMetadata($pages) * * @param array $settings * - * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface + * @return array|QueryResultInterface */ public function findCollectionsBySettings($settings = []) { diff --git a/Classes/Domain/Repository/DocumentRepository.php b/Classes/Domain/Repository/DocumentRepository.php index ed7b588e6..e47f53072 100644 --- a/Classes/Domain/Repository/DocumentRepository.php +++ b/Classes/Domain/Repository/DocumentRepository.php @@ -12,19 +12,22 @@ namespace Kitodo\Dlf\Domain\Repository; +use Doctrine\DBAL\ForwardCompatibility\Result; use Kitodo\Dlf\Common\AbstractDocument; use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Solr\SolrSearch; use Kitodo\Dlf\Domain\Model\Collection; use Kitodo\Dlf\Domain\Model\Document; +use Kitodo\Dlf\Domain\Model\Structure; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; -use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Persistence\Generic\QueryResult; +use TYPO3\CMS\Extbase\Persistence\Repository; +use TYPO3\CMS\Extbase\Persistence\QueryInterface; -class DocumentRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +class DocumentRepository extends Repository { /** * The controller settings passed to the repository for some special actions. @@ -106,8 +109,8 @@ public function findOldestDocument() /** * @param int $partOf - * @param \Kitodo\Dlf\Domain\Model\Structure $structure - * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface + * @param Structure $structure + * @return array|QueryResultInterface */ public function getChildrenOfYearAnchor($partOf, $structure) { @@ -143,7 +146,7 @@ public function findOneByIdAndSettings($uid, $settings = []) * * @param array $settings * - * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface + * @return array|QueryResultInterface */ public function findDocumentsBySettings($settings = []) { @@ -174,7 +177,7 @@ public function findDocumentsBySettings($settings = []) * @param array $collections * @param int $limit * - * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface + * @return array|QueryResultInterface */ public function findAllByCollectionsLimited($collections, $limit = 50) { @@ -347,7 +350,7 @@ public function getStatisticsForSelectedCollection($settings) * @param int $pid * @param array $settings * - * @return \Doctrine\DBAL\ForwardCompatibility\Result + * @return Result */ public function getTableOfContentsFromDb($uid, $pid, $settings) { diff --git a/Classes/Domain/Repository/FormatRepository.php b/Classes/Domain/Repository/FormatRepository.php index dfec62397..4ec3948dc 100644 --- a/Classes/Domain/Repository/FormatRepository.php +++ b/Classes/Domain/Repository/FormatRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class FormatRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class FormatRepository extends Repository { } diff --git a/Classes/Domain/Repository/LibraryRepository.php b/Classes/Domain/Repository/LibraryRepository.php index 2fdd5576f..dba73b830 100644 --- a/Classes/Domain/Repository/LibraryRepository.php +++ b/Classes/Domain/Repository/LibraryRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class LibraryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class LibraryRepository extends Repository { } diff --git a/Classes/Domain/Repository/MailRepository.php b/Classes/Domain/Repository/MailRepository.php index fa0876621..412ab06e7 100644 --- a/Classes/Domain/Repository/MailRepository.php +++ b/Classes/Domain/Repository/MailRepository.php @@ -14,8 +14,9 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; +use TYPO3\CMS\Extbase\Persistence\Repository; -class MailRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +class MailRepository extends Repository { public function findAllWithPid($pid) diff --git a/Classes/Domain/Repository/MetadataFormatRepository.php b/Classes/Domain/Repository/MetadataFormatRepository.php index c258c734c..ba597a125 100644 --- a/Classes/Domain/Repository/MetadataFormatRepository.php +++ b/Classes/Domain/Repository/MetadataFormatRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class MetadataFormatRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class MetadataFormatRepository extends Repository { } \ No newline at end of file diff --git a/Classes/Domain/Repository/MetadataRepository.php b/Classes/Domain/Repository/MetadataRepository.php index 3be96f894..d8c4b79f4 100644 --- a/Classes/Domain/Repository/MetadataRepository.php +++ b/Classes/Domain/Repository/MetadataRepository.php @@ -12,18 +12,18 @@ namespace Kitodo\Dlf\Domain\Repository; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Extbase\Persistence\Repository; use TYPO3\CMS\Extbase\Persistence\QueryInterface; +use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; -class MetadataRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +class MetadataRepository extends Repository { /** * Finds all collection for the given settings * * @param array $settings * - * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface + * @return array|QueryResultInterface */ public function findBySettings($settings = []) { diff --git a/Classes/Domain/Repository/PrinterRepository.php b/Classes/Domain/Repository/PrinterRepository.php index ba8bf605d..5433b390a 100644 --- a/Classes/Domain/Repository/PrinterRepository.php +++ b/Classes/Domain/Repository/PrinterRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class PrinterRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class PrinterRepository extends Repository { } diff --git a/Classes/Domain/Repository/SolrCoreRepository.php b/Classes/Domain/Repository/SolrCoreRepository.php index 586ce722c..d6ed58215 100644 --- a/Classes/Domain/Repository/SolrCoreRepository.php +++ b/Classes/Domain/Repository/SolrCoreRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class SolrCoreRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class SolrCoreRepository extends Repository { } \ No newline at end of file diff --git a/Classes/Domain/Repository/StructureRepository.php b/Classes/Domain/Repository/StructureRepository.php index 3b9287a0e..5e85e9e25 100644 --- a/Classes/Domain/Repository/StructureRepository.php +++ b/Classes/Domain/Repository/StructureRepository.php @@ -12,7 +12,9 @@ namespace Kitodo\Dlf\Domain\Repository; -class StructureRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +use TYPO3\CMS\Extbase\Persistence\Repository; + +class StructureRepository extends Repository { } \ No newline at end of file diff --git a/Classes/Domain/Repository/TokenRepository.php b/Classes/Domain/Repository/TokenRepository.php index 88527c89c..25b83f3fc 100644 --- a/Classes/Domain/Repository/TokenRepository.php +++ b/Classes/Domain/Repository/TokenRepository.php @@ -12,11 +12,10 @@ namespace Kitodo\Dlf\Domain\Repository; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Persistence\Repository; -class TokenRepository extends \TYPO3\CMS\Extbase\Persistence\Repository +class TokenRepository extends Repository { /** * Delete all expired token diff --git a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php index 8d498eb31..a2fbd3b71 100644 --- a/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php +++ b/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php @@ -13,7 +13,6 @@ namespace Kitodo\Dlf\ExpressionLanguage; use Kitodo\Dlf\Common\AbstractDocument; -use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\IiifManifest; use Kitodo\Dlf\Domain\Model\Document; use Kitodo\Dlf\Domain\Repository\DocumentRepository; @@ -51,7 +50,7 @@ public function getFunctions() /** * This holds the current document * - * @var \Kitodo\Dlf\Domain\Model\Document + * @var Document * @access protected */ protected $document; @@ -87,7 +86,7 @@ public function injectDocumentRepository(DocumentRepository $documentRepository) */ protected function initializeRepositories($storagePid) { - $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); + $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $frameworkConfiguration['persistence']['storagePid'] = MathUtility::forceIntegerInRange((int) $storagePid, 0); $this->configurationManager->setConfiguration($frameworkConfiguration); @@ -98,7 +97,7 @@ protected function initializeRepositories($storagePid) /** * Shortcut function to access field values * - * @return \Symfony\Component\ExpressionLanguage\ExpressionFunction + * @return ExpressionFunction */ protected function getDocumentTypeFunction(): ExpressionFunction { diff --git a/Classes/ExpressionLanguage/DocumentTypeProvider.php b/Classes/ExpressionLanguage/DocumentTypeProvider.php index 8a2acf0a6..44b35aa72 100644 --- a/Classes/ExpressionLanguage/DocumentTypeProvider.php +++ b/Classes/ExpressionLanguage/DocumentTypeProvider.php @@ -13,7 +13,6 @@ namespace Kitodo\Dlf\ExpressionLanguage; use TYPO3\CMS\Core\ExpressionLanguage\AbstractProvider; -use TYPO3\CMS\Core\ExpressionLanguage\FunctionsProvider\Typo3ConditionFunctionsProvider; /** * Wrapper class to provide variables and functions for the ExpressionLanguage. diff --git a/Classes/Format/AudioVideoMD.php b/Classes/Format/AudioVideoMD.php index 5c65677b7..ede534833 100644 --- a/Classes/Format/AudioVideoMD.php +++ b/Classes/Format/AudioVideoMD.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Format; +use Kitodo\Dlf\Common\MetadataInterface; + /** * Process AudioMD and VideoMD metadata. * @@ -23,7 +25,7 @@ * @subpackage dlf * @access public */ -class AudioVideoMD implements \Kitodo\Dlf\Common\MetadataInterface +class AudioVideoMD implements MetadataInterface { /** * Extract some essential AudioMD/VideoMD metadata. diff --git a/Classes/Format/Mods.php b/Classes/Format/Mods.php index 4ed9a5c62..a8c038789 100644 --- a/Classes/Format/Mods.php +++ b/Classes/Format/Mods.php @@ -14,6 +14,7 @@ use Kitodo\Dlf\Api\Orcid\Profile as OrcidProfile; use Kitodo\Dlf\Api\Viaf\Profile as ViafProfile; +use Kitodo\Dlf\Common\MetadataInterface; /** * Metadata MODS format class for the 'dlf' extension @@ -23,7 +24,7 @@ * @subpackage dlf * @access public */ -class Mods implements \Kitodo\Dlf\Common\MetadataInterface +class Mods implements MetadataInterface { /** * The metadata XML diff --git a/Classes/Format/TeiHeader.php b/Classes/Format/TeiHeader.php index 6c2aeaf12..bab6aacd7 100644 --- a/Classes/Format/TeiHeader.php +++ b/Classes/Format/TeiHeader.php @@ -12,6 +12,8 @@ namespace Kitodo\Dlf\Format; +use Kitodo\Dlf\Common\MetadataInterface; + /** * Metadata TEI-Header format class for the 'dlf' extension * @@ -20,7 +22,7 @@ * @subpackage dlf * @access public */ -class TeiHeader implements \Kitodo\Dlf\Common\MetadataInterface +class TeiHeader implements MetadataInterface { /** * This extracts the essential TEIHDR metadata from XML diff --git a/Classes/Hooks/ConfigurationForm.php b/Classes/Hooks/ConfigurationForm.php index 6556d6d99..9861335db 100644 --- a/Classes/Hooks/ConfigurationForm.php +++ b/Classes/Hooks/ConfigurationForm.php @@ -14,12 +14,7 @@ use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Solr\Solr; -use TYPO3\CMS\Core\Core\Bootstrap; -use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Localization\LanguageService; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -use TYPO3\CMS\Core\Utility\VersionNumberUtility; +use TYPO3\CMS\Core\Messaging\FlashMessage; /** * Hooks and helper for \TYPO3\CMS\Core\TypoScript\ConfigurationForm @@ -46,13 +41,13 @@ public function checkSolrConnection() Helper::addMessage( Helper::getLanguageService()->getLL('solr.status'), Helper::getLanguageService()->getLL('solr.connected'), - \TYPO3\CMS\Core\Messaging\FlashMessage::OK + FlashMessage::OK ); } else { Helper::addMessage( Helper::getLanguageService()->getLL('solr.error'), Helper::getLanguageService()->getLL('solr.notConnected'), - \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING + FlashMessage::WARNING ); } return Helper::renderFlashMessages(); diff --git a/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php b/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php index a21845d66..26ae12bd0 100644 --- a/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php +++ b/Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php @@ -14,6 +14,7 @@ use Kitodo\Dlf\Common\Helper; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Core\Messaging\FlashMessage; /** * FieldInformation renderType for TYPO3 FormEngine @@ -43,7 +44,7 @@ public function render(): array Helper::addMessage( htmlspecialchars(Helper::getLanguageService()->getLL('flash.editInProductionWarning')), '', // We must not set a title/header, because

isn't allowed in FieldInformation. - \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING + FlashMessage::WARNING ); // Add message to result array. $result['html'] = Helper::renderFlashMessages(); diff --git a/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php b/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php index dff2574e2..66f497412 100644 --- a/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php +++ b/Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php @@ -15,6 +15,7 @@ use Kitodo\Dlf\Common\Helper; use Kitodo\Dlf\Common\Solr\Solr; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Core\Messaging\FlashMessage; /** * FieldInformation renderType for TYPO3 FormEngine @@ -63,7 +64,7 @@ public function render(): array Helper::addMessage( sprintf(Helper::getLanguageService()->getLL('flash.coreStatus'), $startTime, $uptime, $lastModified, $numDocuments), '', // We must not set a title/header, because

isn't allowed in FieldInformation. - \TYPO3\CMS\Core\Messaging\FlashMessage::INFO + FlashMessage::INFO ); } } else { @@ -71,7 +72,7 @@ public function render(): array Helper::addMessage( Helper::getLanguageService()->getLL('solr.error'), '', // We must not set a title/header, because

isn't allowed in FieldInformation. - \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR + FlashMessage::ERROR ); } // Add message to result array. diff --git a/Classes/Hooks/ItemsProcFunc.php b/Classes/Hooks/ItemsProcFunc.php index b94ce252d..aa58e62b7 100644 --- a/Classes/Hooks/ItemsProcFunc.php +++ b/Classes/Hooks/ItemsProcFunc.php @@ -15,9 +15,10 @@ use Kitodo\Dlf\Common\Helper; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; +use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\TypoScript\TemplateService; use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; use TYPO3\CMS\Extbase\Object\ObjectManager; /** @@ -65,7 +66,7 @@ public function toolList(&$params) public function getTyposcriptConfigFromPluginSiteRoot($params) { $objectManager = GeneralUtility::makeInstance(ObjectManager::class); $pid = $params['flexParentDatabaseRow']['pid']; - $rootline = \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($pid); + $rootline = BackendUtility::BEgetRootLine($pid); $siterootRow = []; foreach ($rootline as $_row) { if ($_row['is_siteroot'] == '1') { @@ -75,7 +76,7 @@ public function getTyposcriptConfigFromPluginSiteRoot($params) { } try { - $ts = $objectManager->get(\TYPO3\CMS\Core\TypoScript\TemplateService::class, [$siterootRow['uid']]); + $ts = $objectManager->get(TemplateService::class, [$siterootRow['uid']]); $ts->rootLine = $rootline; $ts->runThroughTemplates($rootline, 0); $ts->generateConfig(); diff --git a/Classes/Updates/MigrateSettings.php b/Classes/Updates/MigrateSettings.php index 22b939fed..a2bd0d027 100644 --- a/Classes/Updates/MigrateSettings.php +++ b/Classes/Updates/MigrateSettings.php @@ -13,7 +13,6 @@ namespace Kitodo\Dlf\Updates; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite; From d696e527afe183b261cd1e811730aab6494afa9f Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Thu, 28 Sep 2023 18:03:50 +0200 Subject: [PATCH 2/4] Add newline at end of file --- Classes/Domain/Repository/MetadataFormatRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/MetadataFormatRepository.php b/Classes/Domain/Repository/MetadataFormatRepository.php index ba597a125..c7b724f0a 100644 --- a/Classes/Domain/Repository/MetadataFormatRepository.php +++ b/Classes/Domain/Repository/MetadataFormatRepository.php @@ -17,4 +17,4 @@ class MetadataFormatRepository extends Repository { -} \ No newline at end of file +} From fbbd48f997ec9553bc3be2c80b9cee7af6660242 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Thu, 28 Sep 2023 18:04:26 +0200 Subject: [PATCH 3/4] Add newline at end of file --- Classes/Domain/Repository/SolrCoreRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/SolrCoreRepository.php b/Classes/Domain/Repository/SolrCoreRepository.php index d6ed58215..9cb250ea5 100644 --- a/Classes/Domain/Repository/SolrCoreRepository.php +++ b/Classes/Domain/Repository/SolrCoreRepository.php @@ -17,4 +17,4 @@ class SolrCoreRepository extends Repository { -} \ No newline at end of file +} From f25083257850e00221b446619b3e66b02a57087e Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Thu, 28 Sep 2023 18:04:58 +0200 Subject: [PATCH 4/4] Add newline at end of file --- Classes/Domain/Repository/StructureRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Domain/Repository/StructureRepository.php b/Classes/Domain/Repository/StructureRepository.php index 5e85e9e25..906076b2d 100644 --- a/Classes/Domain/Repository/StructureRepository.php +++ b/Classes/Domain/Repository/StructureRepository.php @@ -17,4 +17,4 @@ class StructureRepository extends Repository { -} \ No newline at end of file +}