Skip to content

Commit cc22bf0

Browse files
authored
Merge pull request #16 from ismaail/feature/phpstan
Feature/phpstan
2 parents fda193c + 52a3adc commit cc22bf0

File tree

7 files changed

+32
-7
lines changed

7 files changed

+32
-7
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"pestphp/pest": "^3.8",
5050
"pestphp/pest-plugin-laravel": "^3.2",
5151
"orchestra/testbench": "^10.4",
52-
"laravel/pint": "^1.23"
52+
"laravel/pint": "^1.23",
53+
"larastan/larastan": "^3.5"
5354
},
5455
"config": {
5556
"allow-plugins": {

phpstan.neon

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
includes:
2+
- vendor/larastan/larastan/extension.neon
3+
4+
parameters:
5+
phpVersion:
6+
min: 80200
7+
max: 80400
8+
9+
paths:
10+
- src
11+
12+
excludePaths:
13+
analyseAndScan:
14+
- tests/*
15+
16+
# Level 9 is the highest level
17+
level: 6
18+
19+
ignoreErrors:
20+
- '#no value type specified in iterable type array#'
21+
- '#return type with generic class#'
22+
- '#uses generic trait#'
23+
24+
reportUnmatchedIgnoredErrors: false

src/Client/Api/AbstractApi.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ abstract class AbstractApi
1212
{
1313
public function __construct(protected PendingRequest $httpClient)
1414
{
15-
$baseUrl = Config::get('n8n.api.base_url');
16-
$key = Config::get('n8n.api.key');
15+
$baseUrl = Config::string('n8n.api.base_url');
16+
$key = Config::string('n8n.api.key');
17+
1718
$this->httpClient = $httpClient->baseUrl($baseUrl)->withHeaders([
1819
'X-N8N-API-KEY' => $key,
1920
'Accept' => 'application/json',

src/Client/Api/Users.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function get(string $idOrEmail, bool $includeRole = false): array
4141
* @throws ConnectionException
4242
* @throws RequestException
4343
*/
44-
public function delete(string $idOrEmail)
44+
public function delete(string $idOrEmail): array
4545
{
4646
return $this->request(RequestMethod::Delete, "/users/{$idOrEmail}");
4747
}

src/Client/N8nClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct()
3232
->when($retry, fn ($request) => $request->retry($retry));
3333
}
3434

35-
public function webhooks($method = RequestMethod::Post): Webhooks
35+
public function webhooks(RequestMethod $method = RequestMethod::Post): Webhooks
3636
{
3737
return new Webhooks($this->httpClient, $method);
3838
}

src/Client/Webhook/Webhooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(
3434
* @throws ConnectionException
3535
* @throws RequestException
3636
*/
37-
public function request($path, array $data = []): ?array
37+
public function request(string $path, array $data = []): ?array
3838
{
3939
return $this->httpClient
4040
->when($this->basicAuth,

src/Enums/RequestMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ enum RequestMethod: string
1414
case Delete = 'delete';
1515
case Patch = 'patch';
1616
case Head = 'head';
17-
case Options = 'options';
1817

1918
/**
2019
* True when the given value refers to **this** method.

0 commit comments

Comments
 (0)