Skip to content

Commit

Permalink
fix symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Jan 10, 2025
1 parent 758aeb4 commit ca66698
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/ControllerName.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@

use Chevere\Action\Interfaces\ControllerInterface;
use Chevere\Action\Interfaces\ControllerNameInterface;
use Chevere\Action\Traits\ControllerNameTrait;
use Chevere\Action\Traits\ActionNameTrait;

final class ControllerName implements ControllerNameInterface
{
use ControllerNameTrait;
use ActionNameTrait;

public static function symbol(): string

Check warning on line 24 in src/ControllerName.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 test on ubuntu-24.04

Escaped Mutant for Mutator "PublicVisibility": @@ @@ final class ControllerName implements ControllerNameInterface { use ActionNameTrait; - public static function symbol(): string + protected static function symbol(): string { return 'Controller'; }

Check warning on line 24 in src/ControllerName.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 test on ubuntu-24.04

Escaped Mutant for Mutator "PublicVisibility": @@ @@ final class ControllerName implements ControllerNameInterface { use ActionNameTrait; - public static function symbol(): string + protected static function symbol(): string { return 'Controller'; }

Check warning on line 24 in src/ControllerName.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 test on ubuntu-24.04

Escaped Mutant for Mutator "PublicVisibility": @@ @@ final class ControllerName implements ControllerNameInterface { use ActionNameTrait; - public static function symbol(): string + protected static function symbol(): string { return 'Controller'; }

Check warning on line 24 in src/ControllerName.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 test on ubuntu-24.04

Escaped Mutant for Mutator "PublicVisibility": @@ @@ final class ControllerName implements ControllerNameInterface { use ActionNameTrait; - public static function symbol(): string + protected static function symbol(): string { return 'Controller'; }
{
return 'Controller';
}

public static function interface(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use InvalidArgumentException;
use function Chevere\Message\message;

trait ControllerNameTrait
trait ActionNameTrait
{
public function __construct(
private string $name
Expand All @@ -27,7 +27,8 @@ public function __construct(

throw new InvalidArgumentException(
(string) message(
"Controller `{{ name }}` doesn't implement `{{ interface }}`",
"{{ action }} `{{ name }}` doesn't implement `{{ interface }}`",
action: $this::symbol(),
name: $this->name,
interface: $this->interface()
)
Expand All @@ -45,5 +46,10 @@ public function isSubclassOf(string $class): bool
return is_subclass_of($this->name, $class, true);
}

public static function symbol(): string
{
return 'Action';
}

abstract public static function interface(): string;
}

0 comments on commit ca66698

Please sign in to comment.