Skip to content

Commit

Permalink
Run php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
nhovratov committed Sep 29, 2023
1 parent 88a2f74 commit bf73660
Show file tree
Hide file tree
Showing 21 changed files with 49 additions and 57 deletions.
51 changes: 32 additions & 19 deletions Classes/Controller/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

namespace Dan\Jobfair\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Extbase\Http\ForwardResponse;
use TYPO3\CMS\Core\Resource\StorageRepository;
use Dan\Jobfair\Domain\Model\Application;
use Dan\Jobfair\Domain\Model\Category;
use Dan\Jobfair\Domain\Model\Discipline;
Expand All @@ -39,10 +35,14 @@
use Dan\Jobfair\Property\TypeConverter\UploadedFileReferenceConverter;
use Dan\Jobfair\Service\AccessControlService;
use Dan\Jobfair\Utility\Div;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Resource\StorageRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Annotation as Extbase;
use TYPO3\CMS\Extbase\Http\ForwardResponse;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
Expand Down Expand Up @@ -313,10 +313,12 @@ public function newAction(Job $newJob = null): ResponseInterface
if (!$this->settings['feuser']['enableEdit']) {
$this->flashMessageService('editingDisabledMessage', 'editingDisabledStatus', 'ERROR');
return $this->redirect('list');
} elseif (!$this->accessControlService->hasLoggedInFrontendUser()) {
}
if (!$this->accessControlService->hasLoggedInFrontendUser()) {
$this->flashMessageService('editingNotLoggedInMessage', 'editingNotLoggedInStatus', 'ERROR');
return $this->redirect('list');
} elseif ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
}
if ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
$this->settings['feuser']['editorUsergroupUid'],
$this->accessControlService->getFrontendUserGroups()
)) {
Expand All @@ -338,10 +340,12 @@ public function createAction(Job $newJob): ResponseInterface
if (!$this->settings['feuser']['enableEdit']) {
$this->flashMessageService('editingDisabledMessage', 'editingDisabledStatus', 'ERROR');
return $this->redirect('list');
} elseif (!$this->accessControlService->hasLoggedInFrontendUser()) {
}
if (!$this->accessControlService->hasLoggedInFrontendUser()) {
$this->flashMessageService('editingNotLoggedInMessage', 'editingNotLoggedInStatus', 'ERROR');
return $this->redirect('list');
} elseif ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
}
if ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
$this->settings['feuser']['editorUsergroupUid'],
$this->accessControlService->getFrontendUserGroups()
)) {
Expand All @@ -356,7 +360,7 @@ public function createAction(Job $newJob): ResponseInterface
$newJob->setSorting(9999999);
$this->jobRepository->add($newJob);
// @todo Migrate to PSR-14
// $this->signalSlotDispatcher->dispatch(__CLASS__, self::SIGNAL_CreateActionAfterAdd, ['job' => $newJob]);
// $this->signalSlotDispatcher->dispatch(__CLASS__, self::SIGNAL_CreateActionAfterAdd, ['job' => $newJob]);
if ($this->settings['new']['enableAdminNotificaton'] &&
GeneralUtility::validEmail($this->settings['new']['adminEmail']) &&
GeneralUtility::validEmail($this->settings['new']['fromEmail'])) {
Expand Down Expand Up @@ -404,10 +408,12 @@ public function editAction(Job $job): ResponseInterface
if (!$this->settings['feuser']['enableEdit']) {
$this->flashMessageService('editingDisabledMessage', 'editingDisabledStatus', 'ERROR');
return $this->redirect('list');
} elseif (!$this->accessControlService->hasLoggedInFrontendUser()) {
}
if (!$this->accessControlService->hasLoggedInFrontendUser()) {
$this->flashMessageService('editingNotLoggedInMessage', 'editingNotLoggedInStatus', 'ERROR');
return $this->redirect('list');
} elseif ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
}
if ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
$this->settings['feuser']['editorUsergroupUid'],
$this->accessControlService->getFrontendUserGroups()
)) {
Expand All @@ -432,10 +438,12 @@ public function updateAction(Job $job): ResponseInterface
if (!$this->settings['feuser']['enableEdit']) {
$this->flashMessageService('editingDisabledMessage', 'editingDisabledStatus', 'ERROR');
return $this->redirect('list');
} elseif (!$this->accessControlService->hasLoggedInFrontendUser()) {
}
if (!$this->accessControlService->hasLoggedInFrontendUser()) {
$this->flashMessageService('editingNotLoggedInMessage', 'editingNotLoggedInStatus', 'ERROR');
return $this->redirect('list');
} elseif ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
}
if ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
$this->settings['feuser']['editorUsergroupUid'],
$this->accessControlService->getFrontendUserGroups()
)) {
Expand All @@ -449,7 +457,7 @@ public function updateAction(Job $job): ResponseInterface
$this->flashMessageService('jobEditedMessage', 'jobEditedStatus', 'OK');
$this->jobRepository->update($job);
// @todo Migrate to PSR-14
// $this->signalSlotDispatcher->dispatch(__CLASS__, self::SIGNAL_UpdateActionAfterUpdate, ['job' => $job]);
// $this->signalSlotDispatcher->dispatch(__CLASS__, self::SIGNAL_UpdateActionAfterUpdate, ['job' => $job]);
return $this->redirect('show', 'Job', null, ['job' => $job]);
}

Expand All @@ -458,10 +466,12 @@ public function confirmDeleteAction(Job $job): ResponseInterface
if (!$this->settings['feuser']['enableEdit']) {
$this->flashMessageService('editingDisabledMessage', 'editingDisabledStatus', 'ERROR');
return $this->redirect('list');
} elseif (!$this->accessControlService->hasLoggedInFrontendUser()) {
}
if (!$this->accessControlService->hasLoggedInFrontendUser()) {
$this->flashMessageService('editingNotLoggedInMessage', 'editingNotLoggedInStatus', 'ERROR');
return $this->redirect('list');
} elseif ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
}
if ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
$this->settings['feuser']['editorUsergroupUid'],
$this->accessControlService->getFrontendUserGroups()
)) {
Expand All @@ -481,10 +491,12 @@ public function deleteAction(Job $job): ResponseInterface
if (!$this->settings['feuser']['enableEdit']) {
$this->flashMessageService('editingDisabledMessage', 'editingDisabledStatus', 'ERROR');
return $this->redirect('list');
} elseif (!$this->accessControlService->hasLoggedInFrontendUser()) {
}
if (!$this->accessControlService->hasLoggedInFrontendUser()) {
$this->flashMessageService('editingNotLoggedInMessage', 'editingNotLoggedInStatus', 'ERROR');
return $this->redirect('list');
} elseif ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
}
if ($this->settings['feuser']['editorUsergroupUid'] && !in_array(
$this->settings['feuser']['editorUsergroupUid'],
$this->accessControlService->getFrontendUserGroups()
)) {
Expand Down Expand Up @@ -621,7 +633,8 @@ public function createApplicationAction(Application $newApplication, Job $job):

// send email to contacts and frontend users
$subject = LocalizationUtility::translate(
'tx_jobfair_domain_model_application.email_subject', 'jobfair',
'tx_jobfair_domain_model_application.email_subject',
'jobfair',
['jobTitle' => $job->getJobTitle()]
);
$sentMessageResult = $this->div->sendEmail(
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
class Application extends AbstractEntity
{

/**
* title
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class Category extends AbstractEntity
{

/**
* name
*
Expand Down
3 changes: 1 addition & 2 deletions Classes/Domain/Model/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
namespace Dan\Jobfair\Domain\Model;

use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;

/**
* The model for Contact
Expand All @@ -26,7 +26,6 @@
*/
class Contact extends AbstractEntity
{

/**
* name
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Discipline.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class Discipline extends AbstractEntity
{

/**
* name
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Education.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class Education extends AbstractEntity
{

/**
* name
*
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/FileReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
namespace Dan\Jobfair\Domain\Model;

use TYPO3\CMS\Core\Resource\ResourceInterface;

/**
* Class FileReference
*
* @author Helmut Hummel
*/
class FileReference extends \TYPO3\CMS\Extbase\Domain\Model\FileReference
{

/**
* Uid of a sys_file
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class Filter extends AbstractEntity
{

/**
* categories
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
*/
class Job extends AbstractEntity
{

/**
* jobTitle
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class Region extends AbstractEntity
{

/**
* name
*
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/Sector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class Sector extends AbstractEntity
{

/**
* name
*
Expand Down
4 changes: 1 addition & 3 deletions Classes/Domain/Repository/JobRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

namespace Dan\Jobfair\Domain\Repository;

use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use Dan\Jobfair\Domain\Model\Category;
use Dan\Jobfair\Domain\Model\Discipline;
use Dan\Jobfair\Domain\Model\Education;
Expand All @@ -25,6 +24,7 @@
use Dan\Jobfair\Service\AccessControlService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;

/**
Expand All @@ -34,7 +34,6 @@
*/
class JobRepository extends Repository
{

/**
* @var AccessControlService
*/
Expand All @@ -51,7 +50,6 @@ public function findFiltered(Filter $filter = null)
$query = $this->createQuery();
$constraints = []; //to collect all filter constraints
if ($filter !== null) {

//jobtype
$jobType = $filter->getJobType();
if (($jobType!== null) && ($jobType != 99)) { // 99 is used as "all" option in hard coded select forms
Expand Down
18 changes: 9 additions & 9 deletions Classes/Domain/Validator/ApplicationCreateValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,29 @@ public function isValid($application): void
if (empty($application->getEmail()) && $this->settings['application']['validation']['email']['required']) {
$this->addError(
$this->translateErrorMessage(
'validation.email.required',
'jobfair'
),
'validation.email.required',
'jobfair'
),
1502963660
);
}

if (!$this->validEmail($application->getEmail()) && $this->settings['application']['validation']['email']['validEmail']) {
$this->addError(
$this->translateErrorMessage(
'validation.email.validEmail',
'jobfair'
),
'validation.email.validEmail',
'jobfair'
),
1502963661
);
}

if (!is_string($application->getMessage()) && $this->settings['application']['validation']['message']['required']) {
$this->addError(
$this->translateErrorMessage(
'validation.message.required',
'jobfair'
),
'validation.message.required',
'jobfair'
),
1502963662
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@

namespace Dan\Jobfair\Property\TypeConverter;

use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\Security\FileNameValidator;
use TYPO3\CMS\Core\Utility\StringUtility;
use TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Resource\DuplicationBehavior;
use TYPO3\CMS\Core\Resource\Exception\ExistingTargetFileNameException;
use TYPO3\CMS\Core\Resource\File as FalFile;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\FileReference as FalFileReference;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Resource\Security\FileNameValidator;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\PathUtility;
use TYPO3\CMS\Core\Utility\StringUtility;
use TYPO3\CMS\Extbase\Domain\Model\AbstractFileFolder;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Error\Error;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
Expand All @@ -42,7 +42,6 @@
*/
class UploadedFileReferenceConverter extends AbstractTypeConverter
{

/**
* Folder where the file upload should go to (including storage).
*/
Expand Down
1 change: 0 additions & 1 deletion Classes/Service/AccessControlService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
class AccessControlService implements SingletonInterface
{

/**
* @var UserRepository
*/
Expand Down
5 changes: 1 addition & 4 deletions Classes/Utility/Div.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
namespace Dan\Jobfair\Utility;

use Symfony\Component\Mime\Address;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Mail\FluidEmail;
use TYPO3\CMS\Core\Mail\Mailer;
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Fluid\View\StandaloneView;

/**
Expand Down
1 change: 0 additions & 1 deletion Classes/Utility/FlexFormFieldSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class FlexFormFieldSelection
{

/**
* Add options to FlexForm Selection - Options can be defined in TSConfig
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class CamelCaseToLowerCaseUnderscoredViewHelper extends AbstractViewHelper
{

/**
* View helper to transform a camelCase string to to lower_case_underscored
*
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Misc/ExplodeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
class ExplodeViewHelper extends AbstractViewHelper
{

/**
* View helper to explode a list
*
Expand Down
1 change: 0 additions & 1 deletion Classes/ViewHelpers/Misc/FeuserlinkViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
class FeuserlinkViewHelper extends AbstractViewHelper
{

/**
* View helper to
*
Expand Down
Loading

0 comments on commit bf73660

Please sign in to comment.