Skip to content

Commit

Permalink
chore: update rector to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Feb 14, 2024
1 parent fa19954 commit 7dffec5
Show file tree
Hide file tree
Showing 17 changed files with 476 additions and 283 deletions.
4 changes: 2 additions & 2 deletions Classes/Core/Model/TypeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getProperty(string $propertyName);
* @param mixed $propertyValue The value of the property
* @return self
*/
public function setProperty(string $propertyName, $propertyValue);
public function setProperty(string $propertyName, mixed $propertyValue);

/**
* Adds a value to a property
Expand All @@ -52,7 +52,7 @@ public function setProperty(string $propertyName, $propertyValue);
* @param mixed $propertyValue The property value
* @return self
*/
public function addProperty(string $propertyName, $propertyValue);
public function addProperty(string $propertyName, mixed $propertyValue);

/**
* Set multiple properties at once
Expand Down
13 changes: 7 additions & 6 deletions Classes/Core/ViewHelpers/AbstractBaseTypeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
use Brotkrueml\Schema\Core\TypeStack;
use Brotkrueml\Schema\Manager\SchemaManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;

/**
* @internal
*/
abstract class AbstractBaseTypeViewHelper extends ViewHelper\AbstractViewHelper
abstract class AbstractBaseTypeViewHelper extends AbstractViewHelper
{
protected const ARGUMENT_AS = '-as';
protected const ARGUMENT_ID = '-id';
Expand Down Expand Up @@ -88,7 +89,7 @@ private function checkAsAttribute(): void
$parentPropertyNameFromArgument = $this->arguments[static::ARGUMENT_AS];

if ($parentPropertyNameFromArgument === '') {
throw new ViewHelper\Exception(
throw new Exception(
\sprintf(
'The child view helper of schema type "%s" must have an "%s" argument for embedding into the parent type',
$this->getType(),
Expand All @@ -110,7 +111,7 @@ private function checkIsMainEntityOfWebPage(): void
$this->isMainEntityOfWebPage = $isMainEntityOfWebPage === 'true' ? 1 : (int)$isMainEntityOfWebPage;

if ($this->isMainEntityOfWebPage < 0 || $this->isMainEntityOfWebPage > 2) {
throw new ViewHelper\Exception(
throw new Exception(
\sprintf(
'The value of argument "%s" must be between 0 and 2, "%d" given (allowed: 0 = not a main entity, 1 = main entity, 2 = prioritised main entity',
static::ARGUMENT_IS_MAIN_ENTITY_OF_WEBPAGE,
Expand All @@ -121,7 +122,7 @@ private function checkIsMainEntityOfWebPage(): void
}

if ($this->isMainEntityOfWebPage > 0 && ! $this->stack->isEmpty()) {
throw new ViewHelper\Exception(
throw new Exception(
\sprintf(
'The argument "%s" must not be used in the child type "%s", only the main type is allowed',
static::ARGUMENT_IS_MAIN_ENTITY_OF_WEBPAGE,
Expand Down Expand Up @@ -168,7 +169,7 @@ private function assignIdToModel(): void
}

if (! \is_string($id) && ! $id instanceof NodeIdentifierInterface) {
throw new ViewHelper\Exception(
throw new Exception(
\sprintf(
'The %s argument has to be either a string or an instance of %s, %s given',
static::ARGUMENT_ID,
Expand Down
Loading

0 comments on commit 7dffec5

Please sign in to comment.