-
Notifications
You must be signed in to change notification settings - Fork 31
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 Psalm #74
base: master
Are you sure you want to change the base?
Add Psalm #74
Conversation
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.
I've put Psalm on the suggested level (4) by psalm --init
. It immediately found some inconsistencies that I was able to fix, and others that instead aren't fixable right away, so I've put up a baseline.
{ | ||
array_pop($context[$key]); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function map($source, string $destinationClass, array $context = []) | ||
public function map($source, string $targetClass, array $context = []) |
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.
Those renames are probably due to PHP 8 named arguments.
@@ -15,9 +15,11 @@ interface MapperInterface | |||
* Maps an object to an instance of class $to, provided a mapping is | |||
* configured. | |||
* | |||
* @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.
These templates are the main improvements for the end user.
@@ -10,14 +10,14 @@ | |||
interface PropertyReaderInterface | |||
{ | |||
/** | |||
* @param $object | |||
* @param object|array $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.
This was added to be more correct, but the ArrayPropertyReader
breaks the Liskov principle... What can we do?
Travis reporting doesn't seem to work, but the build seems green: https://travis-ci.org/github/mark-gerarts/automapper-plus/builds/762590792 I would suggest to migrate away from Travis though: it already reports a forced migration to the .com unified infra I'll try to draft up a separate PR to move to GitHub Actions. [EDIT] Done #75, but depending on which gets merged first I'll need to migrate the Psalm CI job too. |
Fixes #72.