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

Add PHPStan #468

Merged
merged 7 commits into from
Dec 20, 2023
Merged

Add PHPStan #468

merged 7 commits into from
Dec 20, 2023

Conversation

yguedidi
Copy link
Contributor

@yguedidi yguedidi commented Dec 9, 2023

No description provided.

@@ -14,13 +15,21 @@
* Sets the username from the security context by listening on kernel.request
*
* @author Christophe Coevoet <[email protected]>
*
* @phpstan-template T of Loggable|object
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this right?

@@ -31,11 +32,13 @@ public function getName()
}

/**
* @return ?string
* @return int|null
Copy link
Contributor Author

Choose a reason for hiding this comment

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

covariance with interface

.github/workflows/ci.yml Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
src/EventListener/BlameListener.php Outdated Show resolved Hide resolved
src/EventListener/IpTraceListener.php Outdated Show resolved Hide resolved
src/EventListener/LoggerListener.php Outdated Show resolved Hide resolved
@@ -14,13 +15,21 @@
* Sets the username from the security context by listening on kernel.request
*
* @author Christophe Coevoet <[email protected]>
*
* @phpstan-template T of Loggable|object
Copy link
Owner

Choose a reason for hiding this comment

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

Loggable|object is the same than object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used the same definition as in LoggableListener, so what should I do here?

Copy link

Choose a reason for hiding this comment

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

Either leave it as is or just make it T of object. Gedmo\Loggable\Loggable is an optional marker interface folks can use in their applications if they want to mark their models as loggable, but nothing requires implementing it and the only references to it in the library are template annotations.

src/Uploadable/ValidatorConfigurator.php Outdated Show resolved Hide resolved
@stof stof merged commit 9ff44ce into stof:main Dec 20, 2023
11 checks passed
@yguedidi yguedidi deleted the add-phpstan branch December 20, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants