Skip to content

Commit

Permalink
[CI] Update rector to ^1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasnorre committed Jul 1, 2024
1 parent 68e7258 commit 3e832a2
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/Backend/Helper/UrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand All @@ -33,7 +33,7 @@ class UrlBuilder
*
* @param array $uriParameters optional parameters to add to the URL
*
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
* @throws RouteNotFoundException
*/
public static function getBackendModuleUrl(array $uriParameters = [], string $module = 'web_site_crawler'): Uri
{
Expand Down
5 changes: 3 additions & 2 deletions Classes/Domain/Model/ProcessCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace AOE\Crawler\Domain\Model;

use InvalidArgumentException;
use AOE\Crawler\Exception\NoIndexFoundException;

/***************************************************************
Expand Down Expand Up @@ -54,7 +55,7 @@ public function offsetGet(mixed $index): Process
* Method to add an element to the collection-
*
* @param Process $subject
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function offsetSet(mixed $index, $subject): void
{
Expand All @@ -71,7 +72,7 @@ public function offsetSet(mixed $index, $subject): void
/**
* Method to append an element to the collection
* @param Process $subject
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function append($subject): void
{
Expand Down
7 changes: 4 additions & 3 deletions Classes/Middleware/CrawlerInitialization.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException;
use TYPO3\CMS\Core\Error\Http\ServiceUnavailableException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
Expand Down Expand Up @@ -46,8 +47,8 @@ public function __construct(?Context $context = null)
}

/**
* @throws \TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
* @throws \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException
* @throws AspectNotFoundException
* @throws ServiceUnavailableException
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
Expand Down
9 changes: 5 additions & 4 deletions Classes/Middleware/FrontendUserAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Context\Exception\AspectNotFoundException;
use TYPO3\CMS\Core\Error\Http\ServiceUnavailableException;
use AOE\Crawler\Converter\JsonCompatibilityConverter;
use AOE\Crawler\Domain\Repository\QueueRepository;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -50,8 +51,8 @@ public function __construct(
}

/**
* @throws \TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
* @throws \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException
* @throws AspectNotFoundException
* @throws ServiceUnavailableException
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
Expand Down Expand Up @@ -118,7 +119,7 @@ private function isRequestHashMatchingQueueRecord(?array $queueRec, string $hash
}

/**
* @return mixed|string|\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
* @return mixed|string|FrontendUserAuthentication
*/
private function getFrontendUser(string $grList, ServerRequestInterface $request)
{
Expand Down
10 changes: 5 additions & 5 deletions Classes/Service/BackendModuleLinkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use AOE\Crawler\Controller\Backend\BackendModuleCrawlerProcessController;
use AOE\Crawler\Controller\Backend\Helper\UrlBuilder;
use Psr\Http\Message\UriInterface;
Expand All @@ -37,7 +37,7 @@ public function __construct(
/**
* Returns a tag for the refresh icon
*
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
* @throws RouteNotFoundException
*/
public function getRefreshLink(ModuleTemplate $moduleTemplate, int $pageUid): string
{
Expand All @@ -56,7 +56,7 @@ public function getRefreshLink(ModuleTemplate $moduleTemplate, int $pageUid): st
}

/**
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
* @throws RouteNotFoundException
*/
public function getAddLink(
ModuleTemplate $moduleTemplate,
Expand Down Expand Up @@ -84,7 +84,7 @@ public function getAddLink(
}

/**
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
* @throws RouteNotFoundException
*/
public function getModeLink(ModuleTemplate $moduleTemplate, string $mode): string
{
Expand Down Expand Up @@ -120,7 +120,7 @@ public function getModeLink(ModuleTemplate $moduleTemplate, string $mode): strin
/**
* Returns a link for the panel to enable or disable the crawler
*
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
* @throws RouteNotFoundException
*/
public function getEnableDisableLink(ModuleTemplate $moduleTemplate, bool $isCrawlerEnabled): string
{
Expand Down
7 changes: 4 additions & 3 deletions Classes/Service/BackendModuleLogService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Core\Http\Uri;
use AOE\Crawler\Controller\Backend\BackendModuleCrawlerLogController;
use AOE\Crawler\Controller\Backend\Helper\ResultHandler;
use AOE\Crawler\Controller\Backend\Helper\UrlBuilder;
Expand All @@ -41,9 +42,9 @@ public function __construct(
* Create the rows for display of the page tree
* For each page a number of rows are shown displaying GET variable configuration
*
* @throws \TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException
* @throws RouteNotFoundException
*
* @psalm-return non-empty-list<array{titleRowSpan: positive-int, colSpan: int, title: string, noEntries?: string, trClass?: string, qid?: array{link: \TYPO3\CMS\Core\Http\Uri, link-text: string}, refresh?: array{link: \TYPO3\CMS\Core\Http\Uri, link-text: Icon, warning: Icon|string}, columns?: array{url: mixed|string, scheduled: string, exec_time: string, result_log: string, result_status: string, feUserGroupList: string, procInstructions: string, set_id: string, tsfe_id: string, tsfe_gr_list: string}}>
* @psalm-return non-empty-list<array{titleRowSpan: positive-int, colSpan: int, title: string, noEntries?: string, trClass?: string, qid?: array{link: Uri, link-text: string}, refresh?: array{link: Uri, link-text: Icon, warning: (Icon | string)}, columns?: array{url: (mixed | string), scheduled: string, exec_time: string, result_log: string, result_status: string, feUserGroupList: string, procInstructions: string, set_id: string, tsfe_id: string, tsfe_gr_list: string}}>
*/
public function addRows(
array $logEntriesOfPage,
Expand Down
10 changes: 6 additions & 4 deletions Classes/Service/UrlService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Routing\InvalidRouteArgumentsException;
use Doctrine\DBAL\Driver\Exception;
use Psr\Http\Message\UriInterface;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Http\Uri;
Expand All @@ -36,9 +38,9 @@ class UrlService
* the Site instance.
*
* @param int $httpsOrHttp see tx_crawler_configuration.force_ssl
* @throws \TYPO3\CMS\Core\Exception\SiteNotFoundException
* @throws \TYPO3\CMS\Core\Routing\InvalidRouteArgumentsException
* @throws \Doctrine\DBAL\Driver\Exception
* @throws SiteNotFoundException
* @throws InvalidRouteArgumentsException
* @throws Exception
*/
public function getUrlFromPageAndQueryParameters(
int $pageId,
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Converter/JsonCompatibilityConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The TYPO3 project - inspiring people to share!
*/

use Exception;
use AOE\Crawler\Converter\JsonCompatibilityConverter;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
Expand Down Expand Up @@ -67,7 +67,7 @@ public static function jsonCompatibilityConverterDataProvider(): iterable
}

/**
* @throws \Exception
* @throws Exception
*/
#[\PHPUnit\Framework\Attributes\Test]
public function jsonCompatibilityConverterTestThrowException(): void
Expand Down
10 changes: 5 additions & 5 deletions rector-ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Rector\DeadCode\Rector\Property\RemoveSetterOnlyPropertyAndMethodCallRector;
use Rector\DeadCode\Rector\Property\RemoveUnusedPrivatePropertyRector;
use Rector\DeadCode\Rector\Stmt\RemoveUnreachableStatementRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
Expand All @@ -34,7 +33,6 @@
Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class => [
__DIR__ . '/Classes/Domain/Repository/QueueRepository.php'
],
JsonThrowOnErrorRector::class,
RemoveAlwaysTrueIfConditionRector::class => null,
RemoveUnreachableStatementRector::class => [
__DIR__ . '/Tests/Unit/CrawlStrategy/SubProcessExecutionStrategyTest.php'
Expand All @@ -55,12 +53,14 @@
//SetList::CODE_QUALITY,
//SetList::CODING_STYLE,
LevelSetList::UP_TO_PHP_81,
Typo3SetList::TYPO3_11,
Typo3SetList::TYPO3_12,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_100,
NimutTestingFrameworkSetList::class::NIMUT_TESTING_FRAMEWORK_TO_TYPO3_TESTING_FRAMEWORK,
]);
])
->registerService(
Typo3SetList::TYPO3_11,
Typo3SetList::TYPO3_12,
);


/**return static function (RectorConfig $rectorConfig): void {
Expand Down

0 comments on commit 3e832a2

Please sign in to comment.