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 new shopware versions to git workflow #283

Merged
merged 4 commits into from
Jan 9, 2024
Merged

Conversation

momocode-de
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@rommelfreddy rommelfreddy left a comment

Choose a reason for hiding this comment

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

Basiclly, i am fine with the changes.
But it would be munch prettier, if you are defining the entity type for the repository for each repository declaration. e.g.:

/**
* @var EntityRepository<EntityCollection<OrderEntity>>
*/
private EntityRepository $orderRepository;

So you do not need to add type-hints like

/** @var OrderEntity|null $order */

For lower Shopware version you need to add the PHPStan ignore entry in the phpstan.neon:

parameters:
    ignoreErrors:
        -
            # verified errors: SW < 6.5.4.0 does not support generic types for EntityRepository
            messages:
                - '#PHPDoc tag @var for property .*Repository contains generic type Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityRepository<.*but class Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityRepository is not generic.#'
                - '#PHPDoc tag @param for parameter .*Repository contains generic type Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityRepository<.*but class Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityRepository is not generic.#'

@momocode-de
Copy link
Collaborator Author

@rommelfreddy Yes, I know that this has been added as of 6.5.4. By the way, you can also do EntityRepository<OrderCollection> instead of EntityRepository<EntityCollection<OrderEntity>>. I agree that we should do it this way, but shouldn't we do it in an extra PR for the whole code?

@rommelfreddy
Copy link
Collaborator

@rommelfreddy Yes, I know that this has been added as of 6.5.4. By the way, you can also do EntityRepository<OrderCollection> instead of EntityRepository<EntityCollection<OrderEntity>>. I agree that we should do it this way, but shouldn't we do it in an extra PR for the whole code?

yes, we could do this in a separate PR, but instead of adding legacy code, we could add better code ;-)

yes, i know that there are exist collection-models for some entities - but not for all - thats the reason why i added the long version

@janteuber janteuber merged commit da1c483 into master Jan 9, 2024
34 checks passed
@janteuber janteuber deleted the new-shopware-versions branch January 9, 2024 08: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