Skip to content

Commit

Permalink
More rector
Browse files Browse the repository at this point in the history
  • Loading branch information
tmotyl committed Nov 26, 2021
1 parent 89586e7 commit 1b026a7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
6 changes: 4 additions & 2 deletions Classes/Controller/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

use Macopedia\Community\Controller\Cacheable\ControllerInterface;
use Macopedia\Community\Domain\Model\Group;
use Macopedia\Community\Domain\Model\User;
use Macopedia\Community\Helper\GroupHelper;
use TYPO3\CMS\Extbase\Annotation as Extbase;

/**
* Controller for the Group object
*
* @author Pascal Jungblut <[email protected]>
*/
class GroupController extends BaseController implements \Macopedia\Community\Controller\Cacheable\ControllerInterface
class GroupController extends BaseController implements ControllerInterface
{
/**
* Show the form to create a new group
Expand Down Expand Up @@ -80,7 +82,7 @@ public function createAction(Group $group)
* Display the form to edit a group
*
* @param Group $group
* @dontvalidate $group
* @Extbase\IgnoreValidation("group")
*/
public function editAction(Group $group)
{
Expand Down
14 changes: 9 additions & 5 deletions Classes/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

use Macopedia\Community\Controller\Cacheable\ControllerInterface;
use Macopedia\Community\Domain\Model\Album;
use Macopedia\Community\Domain\Model\Photo;
use Macopedia\Community\Domain\Model\User;
use Macopedia\Community\Service\Notification\Notification;
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
use TYPO3\CMS\Core\Messaging\FlashMessage;

/**
* Controller for the User object
Expand All @@ -38,7 +42,7 @@
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
* @author Pascal Jungblut <[email protected]>
*/
class UserController extends BaseController implements \Macopedia\Community\Controller\Cacheable\ControllerInterface
class UserController extends BaseController implements ControllerInterface
{
/**
* @var \SJBR\StaticInfoTables\Domain\Repository\CountryRepository
Expand All @@ -50,7 +54,7 @@ class UserController extends BaseController implements \Macopedia\Community\Cont
*
* @param \SJBR\StaticInfoTables\Domain\Repository\CountryRepository $repository repository to inject
*/
public function injectStaticCountryRepository(\SJBR\StaticInfoTables\Domain\Repository\CountryRepository $repository)
public function injectStaticCountryRepository(CountryRepository $repository)
{
$this->staticCountryRepository = $repository;
}
Expand Down Expand Up @@ -162,7 +166,7 @@ public function updateImageAction(User $user)
$this->addFlashMessage($this->_('profile.updateImage.success'));
$this->redirect('edit', 'User', null, ['user' => $user]);
} else {
$this->addFlashMessage($this->_('profile.updateImage.error'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->addFlashMessage($this->_('profile.updateImage.error'), '', FlashMessage::ERROR);
$this->redirect('editImage', 'User', null, ['user' => $user]);
}
}
Expand Down Expand Up @@ -241,11 +245,11 @@ public function searchBoxAction()
public function reportAction(User $user, $reason = '')
{
if ($this->settings['profile']['reasonForReportRequired'] && strlen($reason) == 0) {
$this->addFlashMessage($this->_('profile.report.needReason'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->addFlashMessage($this->_('profile.report.needReason'), '', FlashMessage::ERROR);
} else {
$this->addFlashMessage($this->_('profile.report.reported'));

$notification = new \Macopedia\Community\Service\Notification\Notification(
$notification = new Notification(
'userReport',
$this->requestingUser,
$this->requestedUser
Expand Down
12 changes: 8 additions & 4 deletions Classes/Service/Access/SimpleAccessService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

use Macopedia\Community\Domain\Model\Relation;
use Macopedia\Community\Domain\Model\User;
use Macopedia\Community\Service\RepositoryServiceInterface;
use Macopedia\Community\Service\SettingsService;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;

/**
* A simple access helper.
Expand All @@ -37,7 +41,7 @@
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
* @author Pascal Jungblut <[email protected]>
*/
class SimpleAccessService implements AccessServiceInterface, \TYPO3\CMS\Core\SingletonInterface
class SimpleAccessService implements AccessServiceInterface, SingletonInterface
{
/**
* Logged out users, and requested user not set
Expand Down Expand Up @@ -132,7 +136,7 @@ public function sameUser($requestingUser, $requestedUser)
*
* @param \Macopedia\Community\Service\RepositoryServiceInterface $repositoryService
*/
public function injectRepositoryService(\Macopedia\Community\Service\RepositoryServiceInterface $repositoryService)
public function injectRepositoryService(RepositoryServiceInterface $repositoryService)
{
$this->repositoryService = $repositoryService;
}
Expand All @@ -142,7 +146,7 @@ public function injectRepositoryService(\Macopedia\Community\Service\RepositoryS
*
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
public function injectObjectManager(ObjectManagerInterface $objectManager)
{
$this->objectManager = $objectManager;
}
Expand All @@ -152,7 +156,7 @@ public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInter
*
* @param \Macopedia\Community\Service\SettingsService $settingsService
*/
public function injectSettingsService(\Macopedia\Community\Service\SettingsService $settingsService)
public function injectSettingsService(SettingsService $settingsService)
{
$this->settingsService = $settingsService;
}
Expand Down
3 changes: 2 additions & 1 deletion Tests/Unit/ViewHelpers/SameUserViewHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@

use Macopedia\Community\Domain\Model\User;
use Macopedia\Community\ViewHelpers\SameUserViewHelper;
use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;

/**
* Test for the SameUserViewHelper
*/
class SameUserViewHelperTest extends \TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase
class SameUserViewHelperTest extends ViewHelperBaseTestcase
{
/**
* @var \Macopedia\Community\ViewHelpers\SameUserViewHelper|\TYPO3\TestingFramework\Core\AccessibleObjectInterface
Expand Down

0 comments on commit 1b026a7

Please sign in to comment.