Skip to content

Commit f46fcde

Browse files
committed
refactor: removes isSafe method
1 parent 3eb8fa5 commit f46fcde

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/Providers/Http/Enums/HttpMethodEnum.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,6 @@ final class HttpMethodEnum extends AbstractEnum
9696
*/
9797
public const TRACE = 'TRACE';
9898

99-
/**
100-
* Checks if this method is safe (doesn't modify server state).
101-
*
102-
* @since n.e.x.t
103-
*
104-
* @return bool True if the method is safe, false otherwise.
105-
*/
106-
public function isSafe(): bool
107-
{
108-
return in_array($this->value, [self::GET, self::HEAD, self::OPTIONS, self::TRACE], true);
109-
}
110-
11199
/**
112100
* Checks if this method is idempotent.
113101
*

tests/unit/Providers/Http/Enums/HttpMethodEnumTest.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,6 @@ protected function getExpectedValues(): array
4343
];
4444
}
4545

46-
/**
47-
* Tests that safe methods are correctly identified.
48-
*
49-
* @return void
50-
*/
51-
public function testIsSafe(): void
52-
{
53-
$this->assertTrue(HttpMethodEnum::GET()->isSafe());
54-
$this->assertTrue(HttpMethodEnum::HEAD()->isSafe());
55-
$this->assertTrue(HttpMethodEnum::OPTIONS()->isSafe());
56-
$this->assertTrue(HttpMethodEnum::TRACE()->isSafe());
57-
58-
$this->assertFalse(HttpMethodEnum::POST()->isSafe());
59-
$this->assertFalse(HttpMethodEnum::PUT()->isSafe());
60-
$this->assertFalse(HttpMethodEnum::PATCH()->isSafe());
61-
$this->assertFalse(HttpMethodEnum::DELETE()->isSafe());
62-
$this->assertFalse(HttpMethodEnum::CONNECT()->isSafe());
63-
}
64-
6546
/**
6647
* Tests that idempotent methods are correctly identified.
6748
*

0 commit comments

Comments
 (0)