Skip to content

Commit 2d97803

Browse files
committed
refactor: rename parameter name
1 parent 0007146 commit 2d97803

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

system/HTTP/IncomingRequest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,14 @@ public function negotiate(string $type, array $supported, bool $strictMatch = fa
376376
}
377377

378378
/**
379-
* Checks if this request is.
379+
* Checks this request type.
380380
*
381-
* @param string $value HTTP verb or 'json' or 'ajax'
382-
* @phpstan-param string|'get'|'post'|'put'|'delete'|'head'|'patch'|'options'|'json'|'ajax' $value
381+
* @param string $type HTTP verb or 'json' or 'ajax'
382+
* @phpstan-param string|'get'|'post'|'put'|'delete'|'head'|'patch'|'options'|'json'|'ajax' $type
383383
*/
384-
public function is(string $value): bool
384+
public function is(string $type): bool
385385
{
386-
$valueUpper = strtoupper($value);
386+
$valueUpper = strtoupper($type);
387387

388388
$httpMethods = ['GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'PATCH', 'OPTIONS'];
389389

@@ -399,7 +399,7 @@ public function is(string $value): bool
399399
return $this->isAJAX();
400400
}
401401

402-
throw new InvalidArgumentException('Unknown value: ' . $value);
402+
throw new InvalidArgumentException('Unknown type: ' . $type);
403403
}
404404

405405
/**

tests/system/HTTP/IncomingRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ public function testIsHTTPMethodUpperCase(string $value)
653653
public function testIsInvalidValue()
654654
{
655655
$this->expectException(InvalidArgumentException::class);
656-
$this->expectExceptionMessage('Unknown value: invalid');
656+
$this->expectExceptionMessage('Unknown type: invalid');
657657

658658
$request = $this->request->withMethod('GET');
659659

0 commit comments

Comments
 (0)