diff --git a/phpstan.neon b/phpstan.neon index 40c39e1..e03b0af 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -22,4 +22,5 @@ parameters: - '#Call to an undefined method Hyperf\\Database\\Query\\Builder::firstOrFail\(\).#' - '#Call to an undefined method Hyperf\\Contract\\SessionInterface::isValidId\(\).#' - '#Call to an undefined method LightSaml\\Model\\Protocol\\SamlMessage::setInResponseTo\(\).#' - - '#Class App\\Constants\\ErrorCode not found.#' \ No newline at end of file + - '#Class App\\Constants\\ErrorCode not found.#' + - '#Undefined variable: \$this#' \ No newline at end of file diff --git a/tests/HttpTestCase.php b/tests/HttpTestCase.php index d1cdb81..a37609c 100644 --- a/tests/HttpTestCase.php +++ b/tests/HttpTestCase.php @@ -12,12 +12,12 @@ declare(strict_types=1); namespace Tests; -use function Hyperf\Config\config; use Hyperf\Testing\Client; use Lmc\HttpConstants\Header; use PHPUnit\Framework\TestCase; use Singularity\HDK\Core\Enumerations\Http\Header\RFCs\RFC7617; +use function Hyperf\Config\config; use function Hyperf\Support\make; /** @@ -35,13 +35,19 @@ abstract class HttpTestCase extends TestCase { protected Client $client; - public function __construct($name = null, array $data = [], $dataName = '') + public function __construct(?string $name = null) { - parent::__construct($name, $data, $dataName); + parent::__construct($name); $this->client = make(Client::class); } - public function __call($name, $arguments) + /** + * @param string $name + * @param array $arguments + * + * @return array + */ + public function __call(string $name, array $arguments): array { $uri = $arguments[0]; $data = $arguments[1] ?? [];