Skip to content

Commit

Permalink
Update codacy issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Aug 28, 2024
1 parent bfb9328 commit 5ff5c49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Classes/Validation/AbstractDlfValidationStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ protected function addValidator(string $className, string $title, bool $breakOnE
* Check if value is valid across all validation classes of validation stack.
*
* @param $value The value of defined class name.
*
* @throws InvalidArgumentException
*
* @return void
*/
protected function isValid($value): void
Expand Down
7 changes: 4 additions & 3 deletions Classes/Validation/SaxonXslToSvrlValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ class SaxonXslToSvrlValidator extends AbstractDlfValidator implements LoggerAwar
public function __construct(array $configuration)
{
parent::__construct(DOMDocument::class);

if (!isset($configuration["jar"]) || empty($this->jar = GeneralUtility::getFileAbsFileName($configuration["jar"]))) {
$this->jar = GeneralUtility::getFileAbsFileName(isset($configuration["jar"]) ?? '');

Check failure on line 43 in Classes/Validation/SaxonXslToSvrlValidator.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis

Expression on left side of ?? is not nullable.

Check failure on line 43 in Classes/Validation/SaxonXslToSvrlValidator.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis

Parameter #1 $filename of static method TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName() expects string, bool given.
$this->xsl = GeneralUtility::getFileAbsFileName(isset($configuration["xsl"]) ?? '');

Check failure on line 44 in Classes/Validation/SaxonXslToSvrlValidator.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis

Expression on left side of ?? is not nullable.

Check failure on line 44 in Classes/Validation/SaxonXslToSvrlValidator.php

View workflow job for this annotation

GitHub Actions / Static Code Analysis

Parameter #1 $filename of static method TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName() expects string, bool given.
if (empty($this->jar)) {
$this->logger->error('Saxon JAR file not found.');
throw new InvalidArgumentException('Saxon JAR file not found.', 1723121212747);
}
if (!isset($configuration["xsl"]) || empty($this->xsl = GeneralUtility::getFileAbsFileName($configuration["xsl"]))) {
if (empty($this->xsl)) {
$this->logger->error('XSL Schematron file not found.');
throw new InvalidArgumentException('XSL Schematron file not found.', 1723121212747);
}
Expand Down

0 comments on commit 5ff5c49

Please sign in to comment.