Skip to content

Commit

Permalink
Merge pull request #324 from jolicode/phpstan-level8
Browse files Browse the repository at this point in the history
PHPStan level 8 compliance
  • Loading branch information
lyrixx authored Nov 11, 2024
2 parents 70373af + d751fed commit cf7ac22
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .castor/docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function about(): void

try {
$routers = http_client()
->request('GET', sprintf('http://%s:8080/api/http/routers', variable('root_domain')))
->request('GET', \sprintf('http://%s:8080/api/http/routers', variable('root_domain')))
->toArray()
;
$projectName = variable('project_name');
Expand Down Expand Up @@ -349,7 +349,7 @@ function create_default_context(): Context
$data['power_shell'] = true;
}

if ($data['user_id'] > 256000) {
if (false === $data['user_id'] || $data['user_id'] > 256000) {
$data['user_id'] = 1000;
}

Expand Down
5 changes: 5 additions & 0 deletions .castor/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function init(): void
fs()->rename('README.dist.md', 'README.md');

$readMeContent = file_get_contents('README.md');

if (false === $readMeContent) {
return;
}

$urls = [variable('root_domain'), ...variable('extra_domains')];
$readMeContent = str_replace('<your hostnames>', implode(' ', $urls), $readMeContent);
file_put_contents('README.md', $readMeContent);
Expand Down
2 changes: 1 addition & 1 deletion castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import(__DIR__ . '/.castor');

/**
* @return array<string, mixed>
* @return array{project_name: string, root_domain: string, extra_domains: string[], php_version: string}
*/
function create_default_variables(): array
{
Expand Down
3 changes: 1 addition & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 6
level: 8
paths:
# - application/src
- application/public
Expand Down Expand Up @@ -28,7 +28,6 @@ parameters:
power_shell: bool,
user_id: int,
root_dir: string,
env: string,
composer_cache_dir: string,
}
'''

0 comments on commit cf7ac22

Please sign in to comment.