Skip to content

Commit

Permalink
CS: minor nitpicks
Browse files Browse the repository at this point in the history
* Add missing `@throws` tag.
* Remove unused import `use` statements.
* Alphabetically ordered import `use` statements.
* Blank line before the test assertions.
  • Loading branch information
jrfnl committed Jan 9, 2024
1 parent aa4d7dd commit 47cda6a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Utility/HttpStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ final class HttpStatus {
*
* @param int|string $code Status code.
* @return string Status message.
* @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $code argument is not a valid status code.
*/
public static function get_text($code) {
if (self::is_valid_code($code) === false) {
Expand Down
3 changes: 2 additions & 1 deletion tests/Exception/Http/StatusCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use WpOrg\Requests\Exception\Http;
use WpOrg\Requests\Response;
use WpOrg\Requests\Utility\HttpStatus;
use WpOrg\Requests\Tests\TestCase;
use WpOrg\Requests\Utility\HttpStatus;

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

$exception_class = Http::get_class($status_code);
$exception_object = new $exception_class('testing-1-2-3');

$this->assertInstanceOf(Http::class, $exception_object);
$this->assertInstanceOf($expected_exception_class, $exception_object);
}
Expand Down
1 change: 0 additions & 1 deletion tests/Utility/HttpStatus/GetTextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace WpOrg\Requests\Tests\Utility\HttpStatus;

use WpOrg\Requests\Exception;
use WpOrg\Requests\Exception\InvalidArgument;
use WpOrg\Requests\Tests\TestCase;
use WpOrg\Requests\Tests\TypeProviderHelper;
Expand Down
2 changes: 0 additions & 2 deletions tests/Utility/HttpStatus/IsValidCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace WpOrg\Requests\Tests\Utility\HttpStatus;

use WpOrg\Requests\Exception;
use WpOrg\Requests\Exception\InvalidArgument;
use WpOrg\Requests\Tests\TestCase;
use WpOrg\Requests\Tests\TypeProviderHelper;
use WpOrg\Requests\Utility\HttpStatus;
Expand Down

0 comments on commit 47cda6a

Please sign in to comment.