Skip to content

Commit

Permalink
[TASK] Manual fixes for v11
Browse files Browse the repository at this point in the history
  • Loading branch information
david-km2 committed Apr 18, 2023
1 parent 0937374 commit 212b356
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Classes/Analyzers/AbstractAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class AbstractAnalyzer implements AnalyzerInterface
{
final const TYPE_INTERNAL = 'internal';

protected string $type = '';
protected $type = '';

/**
* @var array
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/PresetByPageUidCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
declare(strict_types=1);
namespace UniWue\UwA11yCheck\Command;

use TYPO3\CMS\Extbase\Object\ObjectManager;
use UniWue\UwA11yCheck\Check\Preset;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use UniWue\UwA11yCheck\Check\Result\Impact;
use UniWue\UwA11yCheck\Check\ResultSet;
use UniWue\UwA11yCheck\Service\PresetService;
Expand Down
17 changes: 9 additions & 8 deletions Classes/Controller/A11yCheckController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Fluid\View\TemplateView;
use UniWue\UwA11yCheck\Domain\Model\Dto\CheckDemand;
use UniWue\UwA11yCheck\Service\PresetService;
use UniWue\UwA11yCheck\Service\ResultsService;
Expand Down Expand Up @@ -70,10 +73,10 @@ protected function initializeView(ViewInterface $view): void
parent::initializeView($view);

$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->resultsService = $this->objectManager->get(ResultsService::class);
$this->resultsService =GeneralUtility::makeInstance(ObjectManager::class)->get(ResultsService::class);

$moduleTemplate->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
if ($view instanceof BackendTemplateView) {
if ($view instanceof TemplateView) {
$moduleTemplate->getPageRenderer()->addCssFile(
'EXT:uw_a11y_check/Resources/Public/Css/a11y_check.css'
);
Expand All @@ -94,10 +97,9 @@ public function initializeAction(): void
/**
* Index action
*
* @param CheckDemand $checkDemand
* @IgnoreValidation("checkDemand")
*/
public function indexAction($checkDemand = null): ResponseInterface
public function indexAction(CheckDemand $checkDemand = null): ResponseInterface
{
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
if ($checkDemand === null) {
Expand All @@ -115,7 +117,6 @@ public function indexAction($checkDemand = null): ResponseInterface
]
);
}

$this->view->assignMultiple([
'checkDemand' => $checkDemand,
'presets' => $this->presetService->getPresets(),
Expand Down Expand Up @@ -197,7 +198,7 @@ public function acknowledgeResultAction(int $pageUid): ResponseInterface
protected function createMenu(): void
{
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$uriBuilder = $this->objectManager->get(UriBuilder::class);
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$uriBuilder->setRequest($this->request);

$menu = $moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
Expand Down Expand Up @@ -229,8 +230,8 @@ protected function createDefaultButtons(): void
// Shortcut
if ($this->getBackendUser()->mayMakeShortcut()) {
$shortcutButton = $buttonBar->makeShortcutButton()
->setModuleName('web_UwA11yCheckTxUwa11ycheckM1')
->setGetVariables(['route', 'module', 'id'])
->setRouteIdentifier('web_UwA11yCheckTxUwa11ycheckM1')
->setArguments(['route', 'module', 'id'])
->setDisplayName('Shortcut');
$buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controller/ContentElementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function showAction(int $pageUid, string $ignoreContentTypes, string $hma
$expectedHmac = GeneralUtility::hmac($hmacString, 'page_content');

if ($expectedHmac !== $hmac) {
throw new Exception('HMAC does not match', 1_572_608_738_828);
throw new Exception('HMAC does not match', 1572608738828);
}

$whereCondition = 'colPos >= 0';
Expand Down
3 changes: 2 additions & 1 deletion Classes/Property/TypeConverter/PresetTypeConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UniWue\UwA11yCheck\Property\TypeConverter;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Error\Error;
use TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationInterface;
use TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter;
Expand Down Expand Up @@ -53,7 +54,7 @@ public function convertFrom(
$preset = $this->presetService->getPresetById($source);

if (!$preset instanceof Preset) {
return $this->objectManager->get(Error::class, 'Preset not found', 1_573_053_017_102);
return GeneralUtility::makeInstance(Error::class, 'Preset not found', 1573053017102);
}

return $preset;
Expand Down
10 changes: 5 additions & 5 deletions Classes/Tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
*/
abstract class AbstractTest implements TestInterface
{
protected string $id = '';
protected $id = '';

protected string $description = '';
protected $description = '';

protected string $help = '';
protected $help = '';

protected string $helpUrl = '';
protected $helpUrl = '';

protected int $impact = 0;
protected $impact = 0;

public function getId(): string
{
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Partials/Results.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h3>
<div class="panel panel-default panel-a11y">
<div class="panel-heading impact-{resultSet.impact}" role="tab" id="heading-{preset.id}-{i.index}">
<h2 class="panel-title">
<a href="#resultset-{preset.id}-{i.index}" class="{f:if(condition: '{results -> f:count()} > 1', then: 'collapsed', else: '')}" data-toggle="collapse" aria-controls="#resultset-{i.index}">
<a href="#resultset-{preset.id}-{i.index}" class="{f:if(condition: '{results -> f:count()} > 1', then: 'collapsed', else: '')}" data-bs-toggle="collapse" aria-controls="#resultset-{i.index}">
<span class="caret"></span>
<strong>{resultSet.table} - {resultSet.uid}</strong>
</a>
Expand Down Expand Up @@ -88,4 +88,4 @@ <h2 class="panel-title">
</f:for>
</div>

</html>
</html>
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
},
"autoload": {
"psr-4": {
"UniWue\\UwA11yCheck\\": "Classes"
"UniWue\\UwA11yCheck\\": "Classes",
"UniWue\\UwA11yCheck\\Tests\\": "Tests",
"UniWue\\UwA11yCheck\\Domain\\Model\\Dto": "Classes/Domain/Model/Dto"
}
},
"autoload-dev": {
"psr-4": {
"UniWue\\UwA11yCheck\\Tests\\": "Tests"
"UniWue\\UwA11yCheck\\Tests\\": "Tests",
"UniWue\\UwA11yCheck\\": "Classes"
}
},
"config": {
Expand Down

0 comments on commit 212b356

Please sign in to comment.