Skip to content

Commit

Permalink
Correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Jul 2, 2024
1 parent 0f2a887 commit 3347006
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/UiElement/UiElementFormOptionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ trait UiElementFormOptionsTrait
public function getFormOptions(): array
{
try {
/** @phpstan-ignore-next-line */
/** @var array */
return $this->metadata->getParameter('form_options');
} catch (InvalidArgumentException) {
return [];
Expand Down
25 changes: 8 additions & 17 deletions src/UiElement/UiElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace MonsieurBiz\SyliusRichEditorPlugin\UiElement;

use Exception;
use PHPUnit\Framework\Assert;
use ReturnTypeWillChange;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
Expand Down Expand Up @@ -82,43 +81,35 @@ public function isEnabled(): bool
*/
public function getTitle(): string
{
$value = $this->metadata->getParameter('title');
Assert::assertIsString($value);

return $value;
/** @var string */
return $this->metadata->getParameter('title');
}

/**
* @inheritdoc
*/
public function getDescription(): string
{
$value = $this->metadata->getParameter('description');
Assert::assertIsString($value);

return $value;
/** @var string */
return $this->metadata->getParameter('description');
}

/**
* @inheritdoc
*/
public function getIcon(): string
{
$value = $this->metadata->getParameter('icon');
Assert::assertIsString($value);

return $value;
/** @var string */
return $this->metadata->getParameter('icon');
}

/**
* @inheritdoc
*/
public function getWireframe(): string
{
$value = $this->metadata->getParameter('wireframe');
Assert::assertIsString($value);

return $value;
/** @var string */
return $this->metadata->getParameter('wireframe');
}

/**
Expand Down

0 comments on commit 3347006

Please sign in to comment.