Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Preview/phpstan #60

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

Open
alexcoderabbitai wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from preview/phpstan
Open
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
9 changes: 9 additions & 0 deletions phpstan.neon
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
parameters:
level: 0
paths:
- .
excludePaths:
- vendor/*
- node_modules/*
- .git/*

9 changes: 9 additions & 0 deletions test.php
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

class HelloWorld
{
public function sayHello(DateTimeImutable $date): void
Copy link

@coderabbitai coderabbitai bot Jul 16, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the typo in the class name.

There's a typo in the parameter type. DateTimeImutable should be DateTimeImmutable (missing 'm').

- public function sayHello(DateTimeImutable $date): void
+ public function sayHello(DateTimeImmutable $date): void
📝 Committable suggestion

!!️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public function sayHello(DateTimeImutable $date): void
public function sayHello(DateTimeImmutable $date): void
🧰 Tools
🪛 PHPStan (2.1.17)

5-5: Parameter $date of method HelloWorld::sayHello() has invalid type DateTimeImutable.

(class.notFound)

🤖 Prompt for AI Agents
In test.php at line 5, correct the typo in the parameter type from
DateTimeImutable to DateTimeImmutable by adding the missing 'm' to fix the class
name.

{
echo 'Hello, ' . $date->format('j. n. Y');
}
}

AltStyle によって変換されたページ (->オリジナル) /