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 Psalm #74

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add Psalm #74

wants to merge 7 commits into from

Conversation

Jean85
Copy link

@Jean85 Jean85 commented Mar 12, 2021

Fixes #72.

Copy link
Author

@Jean85 Jean85 left a 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 = [])
Copy link
Author

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
Copy link
Author

@Jean85 Jean85 Mar 12, 2021

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
Copy link
Author

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?

@Jean85
Copy link
Author

Jean85 commented Mar 12, 2021

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
immagine
Furthermore the new pricing model of Travis (there is a monthly amount of build minutes available for OSS projects) could become a problem on the long run.

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.

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.

Psalm annotations
2 participants