-
-
Notifications
You must be signed in to change notification settings - Fork 261
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 QA checks through PHPStan and Psalm #413
Conversation
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64084 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64085 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64088 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64090 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64104 This comment was posted by FlintCI. It can be disabled in the repository settings. |
src/AuditReader.php
Outdated
@@ -64,6 +64,9 @@ class AuditReader | |||
* Entity cache to prevent circular references. | |||
* | |||
* @var array | |||
* | |||
* @phpstan-template T of object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A template on a property seems weird, it's on the class or on a method generally.
All the @phpstan-template T of object
might be moved to the class...
src/Collection/AuditedCollection.php
Outdated
* @phpstan-template TKey | ||
* @psalm-template TKey of array-key | ||
* @psalm-template T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need different template for phpstan and psalm ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was copied from Collection
.
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64105 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64106 This comment was posted by FlintCI. It can be disabled in the repository settings. |
src/ChangedEntity.php
Outdated
@@ -17,6 +17,8 @@ class ChangedEntity | |||
{ | |||
/** | |||
* @var string | |||
* | |||
* @phpstan-var class-string<T> $className |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu use T, u have to defining the template on the class, and not only the construct i think
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64108 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Lint errors were found. A patch is also available. Please see the report: https://flintci.io/repositories/8593/analyses/64109 This comment was posted by FlintCI. It can be disabled in the repository settings. |
Could you please rebase your PR and fix merge conflicts? |
ed43cd1
to
f5c11b5
Compare
@@ -34,6 +35,8 @@ abstract class BaseTest extends TestCase | |||
protected static $conn; | |||
|
|||
/** | |||
* NEXT_MAJOR: Use `\Doctrine\ORM\EntityManagerInterface` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a test class, cant it be changes right away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because the real classes are using EntityManager
in its argument declarations.
By instance:
Parameter #1 $em of method SimpleThings\EntityAudit\AuditManager::createAuditReader() expects Doctrine\ORM\EntityManager, Doctrine\ORM\EntityManagerInterface given.
@jordisala1991, @franmomu; could you please review again? |
composer.json
Outdated
"symfony/phpunit-bridge": "^5.3 || ^6.0" | ||
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0", | ||
"symfony/phpunit-bridge": "^5.3 || ^6.0", | ||
"symfony/security-core": "^4.4 || ^5.3 || ^6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already on require section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Removed.
composer.json
Outdated
"symfony/cache": "^4.4 || ^5.3 || ^6.0", | ||
"symfony/http-foundation": "^4.4 || ^5.3 || ^6.0", | ||
"symfony/phpunit-bridge": "^5.3 || ^6.0" | ||
"symfony/http-kernel": "^4.4 || ^5.3 || ^6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one too
composer.json
Outdated
"symfony/cache": "^4.4 || ^5.3 || ^6.0", | ||
"symfony/http-foundation": "^4.4 || ^5.3 || ^6.0", | ||
"symfony/phpunit-bridge": "^5.3 || ^6.0" | ||
"symfony/phpunit-bridge": "^5.3 || ^6.0", | ||
"symfony/var-dumper": "^4.4 || ^5.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use 4.4 5.3 and 6.0. To be consistent with the other symfony dependencies.
93c23c7
to
e282775
Compare
80e4638
Please remember to open the dev-kit PR to add psalm and phpstan @phansys |
Depends on #414 and #415.
Changelog
To Do
tests/
directory.