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

Fix #25 assertModulesLoaded not matching all loaded Modules #84

Merged
merged 9 commits into from
Sep 12, 2024

Conversation

visto9259
Copy link
Contributor

Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

@visto9259
Copy link
Contributor Author

This is only for #25.
As this is my first code contribution, I will wait for review feeback to ensure the process was followed correctly before proceeding with resolving the other issues.

@visto9259
Copy link
Contributor Author

I thought I had signoff set in my IDE. I guess I was wrong.

@Xerkus
Copy link
Member

Xerkus commented Sep 12, 2024

You will need to rebase this

@visto9259
Copy link
Contributor Author

Because of the missing signoff? No problem

@Xerkus Xerkus added this to the 4.10.1 milestone Sep 12, 2024
@Xerkus Xerkus added the Bug Something isn't working label Sep 12, 2024
@Xerkus
Copy link
Member

Xerkus commented Sep 12, 2024

No, because it is based off of the wrong branch

@visto9259
Copy link
Contributor Author

I am confused here.
Arent't bug fixes against current release branch? which 4.10.x

Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Thanks @visto9259

LGTM other than a couple of minor points.

The remaining 3 UnusedBaselineEntry issues can be solved by running vendor/bin/psalm --update-baseline

I'll leave approval for someone else who has a better memory for MVC stuff 👍

Comment on lines 385 to 386
/** @var ModuleManager $moduleManager */
$moduleManager = $this->getApplicationServiceLocator()->get('ModuleManager');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** @var ModuleManager $moduleManager */
$moduleManager = $this->getApplicationServiceLocator()->get('ModuleManager');
$moduleManager = $this->getApplicationServiceLocator()->get('ModuleManager');
assert($moduleManager instanceof ModuleManager);

Try to use an assertion in cases like this - it has the same effect of telling your IDE and psalm what the type is expected to be, but with the added benefit of causing a runtime error when the type does not match with a clear assertion failure.

When the type should be verified as part of expectations for the subject under test, then PHPUnit's self::assertInstanceOf() method should be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Thanks

@visto9259
Copy link
Contributor Author

So was I correct in using the 4.10.x branch for a bug fix?

@gsteel
Copy link
Member

gsteel commented Sep 12, 2024

Looks to me like you worked on the patch by branching from 4.11.x, then sent the changes to the 4.10.x branch, hence all the lock file maintenance commits from renovate that are not present in 4.10.x.

In order to clean things up, you'd need to create a new branch from 4.10.x, then "Cherry Pick" your commits here from "Fix Laminas 25", then force push that new branch to this PR.

@visto9259
Copy link
Contributor Author

Good grief.... you are right! Rookie mistake.

Signed-off-by: Eric Richer eric.richer@vistoconsulting.com <eric.richer@vistoconsulting.com>
Signed-off-by: Eric Richer eric.richer@vistoconsulting.com <eric.richer@vistoconsulting.com>
visto9259 and others added 5 commits September 12, 2024 12:52
Signed-off-by: Eric Richer eric.richer@vistoconsulting.com <eric.richer@vistoconsulting.com>
Signed-off-by: Eric Richer eric.richer@vistoconsulting.com <eric.richer@vistoconsulting.com>
…eption

Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
Signed-off-by: Aleksei Khudiakov <aleksey@xerkus.pro>
@Xerkus
Copy link
Member

Xerkus commented Sep 12, 2024

Ignoring DCO check for non-essential commits

@Xerkus Xerkus merged commit a8de7f8 into laminas:4.10.x Sep 12, 2024
10 of 11 checks passed
@Xerkus
Copy link
Member

Xerkus commented Sep 12, 2024

@visto9259 thank you

@Xerkus Xerkus linked an issue Sep 12, 2024 that may be closed by this pull request
@visto9259 visto9259 deleted the fix-25 branch September 12, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertModulesLoaded not matching all loaded Modules
3 participants