From 84d8e97b1ebf4fc18a2568b8c0c19c29a401e92e Mon Sep 17 00:00:00 2001
From: Matthias Adrowski <matthias.adrowski@sgalinski.de>
Date: Mon, 10 Jan 2022 10:03:51 +0100
Subject: [PATCH] [TASK] Rector run

---
 .../Domain/Repository/CompanyRepository.php   |  1 +
 .../UploadedFileReferenceConverter.php        |  2 +-
 Classes/Updates/DepartmentUpdateWizard.php    |  2 +-
 .../Widget/Controller/PaginateController.php  |  2 +-
 Classes/ViewHelpers/SetViewHelper.php         |  2 +-
 Classes/ViewHelpers/Widget/UriViewHelper.php  |  1 -
 .../TCA/tx_sgjobs_domain_model_company.php    |  7 +-----
 .../TCA/tx_sgjobs_domain_model_contact.php    |  5 +----
 .../TCA/tx_sgjobs_domain_model_department.php |  5 +----
 ...x_sgjobs_domain_model_experience_level.php |  5 +----
 .../TCA/tx_sgjobs_domain_model_job.php        | 18 +--------------
 ...tx_sgjobs_domain_model_job_application.php |  6 +----
 ext_localconf.php                             | 22 +++++++++----------
 ext_tables.php                                |  4 ++--
 14 files changed, 24 insertions(+), 58 deletions(-)

diff --git a/Classes/Domain/Repository/CompanyRepository.php b/Classes/Domain/Repository/CompanyRepository.php
index 031a5b55..556457d0 100644
--- a/Classes/Domain/Repository/CompanyRepository.php
+++ b/Classes/Domain/Repository/CompanyRepository.php
@@ -124,6 +124,7 @@ class CompanyRepository extends Repository {
 	 * @throws \TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
 	 */
 	public function getAllCompanies($pageUid) {
+		$companyConstraints = [];
 		$query = $this->createQuery();
 		$querySettings = $query->getQuerySettings();
 		$querySettings->setStoragePageIds([$pageUid]);
diff --git a/Classes/Property/TypeConverter/UploadedFileReferenceConverter.php b/Classes/Property/TypeConverter/UploadedFileReferenceConverter.php
index 1edded6c..d54ee084 100644
--- a/Classes/Property/TypeConverter/UploadedFileReferenceConverter.php
+++ b/Classes/Property/TypeConverter/UploadedFileReferenceConverter.php
@@ -371,7 +371,7 @@ class UploadedFileReferenceConverter implements TypeConverterInterface {
 		$fileName = $this->getTargetUploadFileName();
 		$finalFileName = $fileName . '.' . strtolower($filePathInfo['extension']);
 		if (!$uploadInfo['wasUploaded']) {
-			if (!GeneralUtility::verifyFilenameAgainstDenyPattern($uploadInfo['name'])) {
+			if (!\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Security\FileNameValidator::class)->isValid($uploadInfo['name'])) {
 				throw new TypeConverterException(
 					'Uploading files with PHP file extensions is not allowed!', 1399312430
 				);
diff --git a/Classes/Updates/DepartmentUpdateWizard.php b/Classes/Updates/DepartmentUpdateWizard.php
index f9f97de0..e023bd68 100644
--- a/Classes/Updates/DepartmentUpdateWizard.php
+++ b/Classes/Updates/DepartmentUpdateWizard.php
@@ -41,7 +41,7 @@ class DepartmentUpdateWizard implements UpgradeWizardInterface {
 	/**
 	 * The wizard identifier
 	 */
-	const IDENTIFIER = 'tx_sgjobs_departmentupdatewizward';
+	public const IDENTIFIER = 'tx_sgjobs_departmentupdatewizward';
 
 	/**
 	 * Check if the job table has a deleted area field
diff --git a/Classes/ViewHelpers/Backend/Widget/Controller/PaginateController.php b/Classes/ViewHelpers/Backend/Widget/Controller/PaginateController.php
index 47265580..c29cb315 100644
--- a/Classes/ViewHelpers/Backend/Widget/Controller/PaginateController.php
+++ b/Classes/ViewHelpers/Backend/Widget/Controller/PaginateController.php
@@ -92,7 +92,7 @@ class PaginateController extends \TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controll
 	 */
 	protected function buildPagination() {
 		$pagination = parent::buildPagination();
-		$pagination['totalObjects'] = \count($this->objects);
+		$pagination['totalObjects'] = is_countable($this->objects) ? \count($this->objects) : 0;
 		return $pagination;
 	}
 }
diff --git a/Classes/ViewHelpers/SetViewHelper.php b/Classes/ViewHelpers/SetViewHelper.php
index 782d2211..9280d9a9 100644
--- a/Classes/ViewHelpers/SetViewHelper.php
+++ b/Classes/ViewHelpers/SetViewHelper.php
@@ -47,7 +47,7 @@ class SetViewHelper extends AbstractViewHelper {
 	 * Set (override) the variable in $name.
 	 *
 	 * @return void
-	 * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception\InvalidVariableException
+	 * @throws \TYPO3Fluid\Fluid\Core\Exception
 	 */
 	public function render() {
 		$value = $this->arguments['value'];
diff --git a/Classes/ViewHelpers/Widget/UriViewHelper.php b/Classes/ViewHelpers/Widget/UriViewHelper.php
index e33ba7e3..560113e1 100644
--- a/Classes/ViewHelpers/Widget/UriViewHelper.php
+++ b/Classes/ViewHelpers/Widget/UriViewHelper.php
@@ -149,7 +149,6 @@ class UriViewHelper extends AbstractViewHelper {
 			->setArguments($allArguments)
 			->setSection($arguments['section'])
 			->setAddQueryString(TRUE)
-			->setAddQueryStringMethod($arguments['addQueryStringMethod'] ?? '')
 			->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash'])
 			->setFormat($arguments['format'])
 			->build();
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_company.php b/Configuration/TCA/tx_sgjobs_domain_model_company.php
index 7f15060d..dc54ecee 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_company.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_company.php
@@ -31,7 +31,6 @@ $columns = [
 		'tstamp' => 'tstamp',
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
-		'dividers2tabs' => TRUE,
 		'searchFields' => 'job_id, zip, city, state, country, description, name, street, contact',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
@@ -51,11 +50,7 @@ $columns = [
 	'interface' => [],
 	'types' => [
 		'1' => [
-			'showitem' => '--palette--;;sysLanguageAndHidden,
-			job_id, zip, city, street,name, state, country, description, contact;;;richtext[*]:rte_transform[mode=ts],
-			--div--; LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.seo_tab,
-				identifying_url,
-			--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
+			'showitem' => '--palette--;;sysLanguageAndHidden,job_id,zip,city,street,name,state,country,description,contact,--palette--,--div--;LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.seo_tab,identifying_url,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime,endtime',
 		],
 	],
 	'palettes' => [
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_contact.php b/Configuration/TCA/tx_sgjobs_domain_model_contact.php
index 45668581..ef78201d 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_contact.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_contact.php
@@ -33,7 +33,6 @@ $columns = [
 		'tstamp' => 'tstamp',
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
-		'dividers2tabs' => TRUE,
 		'searchFields' => 'title, first_name, last_name, street, city, zip, email, phone, hide_in_frontend',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
@@ -53,9 +52,7 @@ $columns = [
 	'interface' => [],
 	'types' => [
 		'1' => [
-			'showitem' => '--palette--;;sysLanguageAndHidden,
-			hide_in_frontend, title, first_name, last_name, image, street, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts],
-			--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
+			'showitem' => '--palette--;;sysLanguageAndHidden,hide_in_frontend,title,first_name,last_name,image,street,city,zip,email,phone,--palette--,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime,endtime',
 		],
 	],
 	'palettes' => [
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_department.php b/Configuration/TCA/tx_sgjobs_domain_model_department.php
index e021bbe1..01e9134d 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_department.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_department.php
@@ -31,7 +31,6 @@ $columns = [
 		'tstamp' => 'tstamp',
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
-		'dividers2tabs' => TRUE,
 		'searchFields' => 'title',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
@@ -51,9 +50,7 @@ $columns = [
 	'interface' => [],
 	'types' => [
 		'1' => [
-			'showitem' => '--palette--;;sysLanguageAndHidden,
-			title,
-			--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
+			'showitem' => '--palette--;;sysLanguageAndHidden,title,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime,endtime',
 		],
 	],
 	'palettes' => [
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_experience_level.php b/Configuration/TCA/tx_sgjobs_domain_model_experience_level.php
index 9f363e7f..010f6592 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_experience_level.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_experience_level.php
@@ -31,7 +31,6 @@ $columns = [
 		'tstamp' => 'tstamp',
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
-		'dividers2tabs' => TRUE,
 		'searchFields' => 'title',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
@@ -51,9 +50,7 @@ $columns = [
 	'interface' => [],
 	'types' => [
 		'1' => [
-			'showitem' => '--palette--;;sysLanguageAndHidden,
-			title,
-			--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
+			'showitem' => '--palette--;;sysLanguageAndHidden,title,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime,endtime',
 		],
 	],
 	'palettes' => [
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_job.php b/Configuration/TCA/tx_sgjobs_domain_model_job.php
index e9186cf4..8434f553 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_job.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_job.php
@@ -35,7 +35,6 @@ $columns = [
 		'tstamp' => 'tstamp',
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
-		'dividers2tabs' => TRUE,
 		'searchFields' => 'title, job_id, path_segment, start_date, alternative_start_date, location, apply_external_link, description, task, qualification',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
@@ -55,22 +54,7 @@ $columns = [
 	'interface' => [],
 	'types' => [
 		'1' => [
-			'showitem' => '--palette--;;sysLanguageAndHidden, --palette--;;palette_title,
-				--palette--;;palette_title_start_location,
-				--palette--;;palette_apply_function,
-				apply_external_link,
-				department,
-				experience_level,
-				company,
-				contact,
-				--div--; LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.qualification_tab, description, task, qualification, attachment,
-				--div--; LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.seo_tab,
-					--palette--;;palette_location_specifications,
-					employment_types,
-					--palette--;;palette_seo_dates,
-					--palette--;;palette_salary,
-				--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime,
-				--div--;LLL:EXT:languagevisibility/Resources/Private/Language/locallang_db.xml:tabname, tx_languagevisibility_visibility',
+			'showitem' => '--palette--;;sysLanguageAndHidden,--palette--;;palette_title,--palette--;;palette_title_start_location,--palette--;;palette_apply_function,apply_external_link,department,experience_level,company,contact,--div--;LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.qualification_tab,description,task,qualification,attachment,--div--;LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.seo_tab,--palette--;;palette_location_specifications,employment_types,--palette--;;palette_seo_dates,--palette--;;palette_salary,--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime,endtime,--div--;LLL:EXT:languagevisibility/Resources/Private/Language/locallang_db.xml:tabname,tx_languagevisibility_visibility',
 		],
 	],
 	'palettes' => [
diff --git a/Configuration/TCA/tx_sgjobs_domain_model_job_application.php b/Configuration/TCA/tx_sgjobs_domain_model_job_application.php
index 40f8d7b4..8465671d 100644
--- a/Configuration/TCA/tx_sgjobs_domain_model_job_application.php
+++ b/Configuration/TCA/tx_sgjobs_domain_model_job_application.php
@@ -33,7 +33,6 @@ $columns = [
 		'tstamp' => 'tstamp',
 		'crdate' => 'crdate',
 		'cruser_id' => 'cruser_id',
-		'dividers2tabs' => TRUE,
 		'searchFields' => 'job_id, job, job_title, company, gender, first_name, last_name, street, city, zip, country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, certificate, cv',
 		'versioningWS' => 2,
 		'versioning_followPages' => TRUE,
@@ -53,10 +52,7 @@ $columns = [
 	'interface' => [],
 	'types' => [
 		'1' => [
-			'showitem' => '--palette--;;sysLanguageAndHidden,job_id, job, job_title, company, gender, first_name, last_name, street, city, zip,
-				country, nationality, education, birth_date, phone, mobile, email, message, privacy_policy, cover_letter, cv, certificate,
-				div;;richtext[*]:rte_transform[mode=ts],
-				--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
+			'showitem' => '--palette--;;sysLanguageAndHidden,job_id,job,job_title,company,gender,first_name,last_name,street,city,zip,country,nationality,education,birth_date,phone,mobile,email,message,privacy_policy,cover_letter,cv,certificate,div,--palette--;;richtext[*]:rte_transform[mode=ts],--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access,starttime,endtime',
 		],
 	],
 	'palettes' => [
diff --git a/ext_localconf.php b/ext_localconf.php
index 0b4b7a24..47d880f7 100644
--- a/ext_localconf.php
+++ b/ext_localconf.php
@@ -30,39 +30,39 @@ call_user_func(
 		);
 		// Configure frontend plugins
 		\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
-			'SGalinski.sg_jobs',
+			'Srectorprefix20211231gJobs',
 			'Joblist',
 			[
 				// Available actions
-				'Joblist' => 'index'
+				\SGalinski\Srectorprefix20211231gJobs\Controller\JoblistController::class => 'index'
 			],
 			[
 				// Uncacheable actions
-				'Joblist' => ''
+				\SGalinski\Srectorprefix20211231gJobs\Controller\JoblistController::class => ''
 			]
 		);
 		\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
-			'SGalinski.sg_jobs',
+			'Srectorprefix20211231gJobs',
 			'JobApplication',
 			[
 				// Available actions
-				'Joblist' => 'applyForm, apply'
+				\SGalinski\Srectorprefix20211231gJobs\Controller\JoblistController::class => 'applyForm, apply'
 			],
 			[
 				// Uncacheable actions
-				'Joblist' => 'applyForm, apply'
+				\SGalinski\Srectorprefix20211231gJobs\Controller\JoblistController::class => 'applyForm, apply'
 			]
 		);
 		\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
-			'SGalinski.sg_jobs',
+			'Srectorprefix20211231gJobs',
 			'JobTeaser',
 			[
 				// Available actions
-				'JobTeaser' => 'index'
+				\SGalinski\Srectorprefix20211231gJobs\Controller\JobTeaserController::class => 'index'
 			],
 			[
 				// Uncacheable actions
-				'JobTeaser' => ''
+				\SGalinski\Srectorprefix20211231gJobs\Controller\JobTeaserController::class => ''
 			]
 		);
 		// Backend preview for plugins
@@ -110,9 +110,9 @@ call_user_func(
 		// Class aliasing for TYPO3 version compatibility
 		if (!class_exists('SgJobsPageRepository')) {
 			if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '10.3.0', '>=')) {
-				class_alias('\TYPO3\CMS\Core\Domain\Repository\PageRepository', 'SgJobsPageRepository');
+				class_alias(\TYPO3\CMS\Core\Domain\Repository\PageRepository::class, 'SgJobsPageRepository');
 			} else {
-				class_alias('\TYPO3\CMS\Frontend\Page\PageRepository', 'SgJobsPageRepository');
+				class_alias(\TYPO3\CMS\Core\Domain\Repository\PageRepository::class, 'SgJobsPageRepository');
 			}
 		}
 	}
diff --git a/ext_tables.php b/ext_tables.php
index d2787813..b223ba7b 100644
--- a/ext_tables.php
+++ b/ext_tables.php
@@ -46,12 +46,12 @@ call_user_func(
 
 		// Register backend modules
 		\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
-			'SGalinski.sg_jobs',
+			'Srectorprefix20211231gJobs',
 			'web',
 			'Backend',
 			'',
 			[
-				'Backend' => 'index',
+				\SGalinski\Srectorprefix20211231gJobs\Controller\BackendController::class => 'index',
 			],
 			[
 				'access' => 'user,group',
-- 
GitLab