Skip to content

Commit a84cae8

Browse files
committed
validator 0.4 support added
1 parent 34193b9 commit a84cae8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
run: vendor/bin/phpunit test/
2929

3030
php81a:
31-
name: "php 8.1, laravel 8, symfony 5"
31+
name: "php 8.1, laravel 8, symfony 5, validator 0.3"
3232
runs-on: ubuntu-latest
3333
container: "nofutur3/php-tests:8.1"
3434
steps:
3535
- name: Checkout repository
3636
uses: actions/checkout@v2
3737

3838
- name: Install dependencies
39-
run: composer update --no-interaction --with illuminate/support:^8.81 --with symfony/http-kernel:^5.4 --with symfony/http-foundation:^5.4
39+
run: composer update --no-interaction --with illuminate/support:^8.81 --with symfony/http-kernel:^5.4 --with symfony/http-foundation:^5.4 --with simple-as-fuck/php-validator:^0.3.0
4040

4141
- name: Run static analysis
4242
run: vendor/bin/phpstan analyse

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"ext-json": "*",
66
"psr/http-message": "^1.0",
77
"psr/http-factory": "^1.0",
8-
"simple-as-fuck/php-validator": "^0.3.0",
8+
"simple-as-fuck/php-validator": "^0.3.0|^0.4.0",
99
"guzzlehttp/guzzle": "^7.4",
1010
"illuminate/support": "^8.81|^9.0",
1111
"kayex/http-codes": "^1.1",

src/Model/Client/Request.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ final class Request
3333
public function __construct(string $method, string $url, array $query = [], ?StreamInterface $body = null, array $headers = [])
3434
{
3535
if (count($query) !== 0) {
36-
$url = ParseUrl::make($url, [], [PHP_URL_QUERY, PHP_URL_FRAGMENT], '$url')->notNull();
36+
$url = ParseUrl::make($url, [], [PHP_URL_QUERY, PHP_URL_FRAGMENT], 'Parameter $url')->notNull();
3737
$url .= '?'.\http_build_query($query, '', '&', PHP_QUERY_RFC3986);
3838
}
3939

4040
$this->method = $method;
41-
$this->url = ParseUrl::make($url, [], [PHP_URL_SCHEME, PHP_URL_USER, PHP_URL_PASS, PHP_URL_HOST, PHP_URL_PORT], '$url')->notNull();
41+
$this->url = ParseUrl::make($url, [], [PHP_URL_SCHEME, PHP_URL_USER, PHP_URL_PASS, PHP_URL_HOST, PHP_URL_PORT], 'Parameter $url')->notNull();
4242
$this->headers = $headers;
4343
$this->body = $body;
4444
$this->baseUrl = null;
@@ -50,7 +50,7 @@ public function __construct(string $method, string $url, array $query = [], ?Str
5050
public function withBaseUrl(string $baseUrl): self
5151
{
5252
$request = new self($this->method, $this->url, [], $this->body, $this->headers);
53-
$request->baseUrl = StringRule::make($baseUrl, '$baseUrl')->parseHttpUrl([], [PHP_URL_QUERY, PHP_URL_FRAGMENT])->notNull();
53+
$request->baseUrl = StringRule::make($baseUrl, 'Parameter $baseUrl')->parseHttpUrl([], [PHP_URL_QUERY, PHP_URL_FRAGMENT])->notNull();
5454
return $request;
5555
}
5656

0 commit comments

Comments
 (0)