Skip to content

Commit 47cda6a

Browse files
committed
CS: minor nitpicks
* Add missing `@throws` tag. * Remove unused import `use` statements. * Alphabetically ordered import `use` statements. * Blank line before the test assertions.
1 parent aa4d7dd commit 47cda6a

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/Utility/HttpStatus.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ final class HttpStatus {
837837
*
838838
* @param int|string $code Status code.
839839
* @return string Status message.
840+
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $code argument is not a valid status code.
840841
*/
841842
public static function get_text($code) {
842843
if (self::is_valid_code($code) === false) {

tests/Exception/Http/StatusCodeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use WpOrg\Requests\Exception\Http;
66
use WpOrg\Requests\Response;
7-
use WpOrg\Requests\Utility\HttpStatus;
87
use WpOrg\Requests\Tests\TestCase;
8+
use WpOrg\Requests\Utility\HttpStatus;
99

1010
/**
1111
* @covers \WpOrg\Requests\Exception\Http\Status304
@@ -124,6 +124,7 @@ public function testKnownStatusCodes($status_code, $expected_exception_class) {
124124

125125
$exception_class = Http::get_class($status_code);
126126
$exception_object = new $exception_class('testing-1-2-3');
127+
127128
$this->assertInstanceOf(Http::class, $exception_object);
128129
$this->assertInstanceOf($expected_exception_class, $exception_object);
129130
}

tests/Utility/HttpStatus/GetTextTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace WpOrg\Requests\Tests\Utility\HttpStatus;
44

5-
use WpOrg\Requests\Exception;
65
use WpOrg\Requests\Exception\InvalidArgument;
76
use WpOrg\Requests\Tests\TestCase;
87
use WpOrg\Requests\Tests\TypeProviderHelper;

tests/Utility/HttpStatus/IsValidCodeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace WpOrg\Requests\Tests\Utility\HttpStatus;
44

5-
use WpOrg\Requests\Exception;
6-
use WpOrg\Requests\Exception\InvalidArgument;
75
use WpOrg\Requests\Tests\TestCase;
86
use WpOrg\Requests\Tests\TypeProviderHelper;
97
use WpOrg\Requests\Utility\HttpStatus;

0 commit comments

Comments
 (0)