Skip to content

Commit

Permalink
switch to php enums
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomail-cz committed Aug 29, 2024
1 parent d5edae6 commit 4bb4503
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/Http/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@

namespace EcomailFlexibee\Http;

use Consistence\Enum\Enum;

final class Method extends Enum
enum Method: string
{

public const GET = 'GET';
public const POST = 'POST';
public const DELETE = 'DELETE';
public const PUT = 'PUT';
case GET = 'GET';
case POST = 'POST';
case DELETE = 'DELETE';
case PUT = 'PUT';

public function __toString(): string
{
/** @phpstan-ignore-next-line */
return $this->getValue();
return $this->value;
}

}
3 changes: 1 addition & 2 deletions src/Http/ResponseHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace EcomailFlexibee\Http;

use Consistence\ObjectPrototype;
use EcomailFlexibee\Config;
use EcomailFlexibee\Exception\EcomailFlexibeeNoEvidenceResult;
use EcomailFlexibee\Exception\EcomailFlexibeeRequestFail;
Expand All @@ -13,7 +12,7 @@
use function array_map;
use function count;

class ResponseHydrator extends ObjectPrototype
class ResponseHydrator
{

public function __construct(private Config $config)
Expand Down

0 comments on commit 4bb4503

Please sign in to comment.