Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan level 8 compliance #324

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in f495759

composer_cache_dir: string,
}
'''