Skip to content

Conversation

@szepeviktor
Copy link
Contributor

Under level 4 👺 viktor says: broken application/package
(not polite)

@szepeviktor
Copy link
Contributor Author

szepeviktor commented May 7, 2023

Yes, many return types are interfaces, not concrete implementations.
So: many methods are missing.

But there are exceptions 🤯

private ShopOrderRepository $repository;

@szepeviktor
Copy link
Contributor Author

szepeviktor commented May 7, 2023

Let me pull out my secret laser gun 🔫

/** @var TermRepository */
private RepositoryInterface $repository;

@szepeviktor
Copy link
Contributor Author

szepeviktor commented May 7, 2023

Errors on Level 2 reduced from 140 to 51 🎉

Supporting RepositoryClass attribute: phpstan/phpstan#9279

I do not know how to go on as there is no mechanism in PHPStan
getRepository(string $entityClassName): RepositoryInterface to find out the repository class from entity class.

... although one can write a tiny type specifying extension.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented May 10, 2023

The above so called "PHPStan extension" finds out Repository names using str_replace :(
But reduces the number of problems to 38!

@szepeviktor
Copy link
Contributor Author

@williarin Could you help fixing remaining ones?

@szepeviktor szepeviktor marked this pull request as ready for review May 10, 2023 06:14
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.

1 participant