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

Update to Laminas Coding Standard 2.3 #99

Merged
merged 15 commits into from
Jan 8, 2022
Merged

Conversation

gsteel
Copy link
Member

@gsteel gsteel commented Dec 30, 2021

Q A
QA yes

Description

Updating and cleaning up for Laminas Coding Standard 2.3 including WIP on reducing Psalm Errors.

I appreciate that reviewing this is going to be hellish… FWIW, I'm pretty confident that there are no BC breaks but I have fixed some obvious errors in doc blocks.

The most notable changes are likely adding nullable type hints such as function Foo(Type $baz = null) changed to function Foo(?Type $baz = null).

Also, there are a number of placeholder container/array access methods that had doc blocks for void return on methods such as next() that were returning parent::next() - as these methods should have always been returning void anyhow, the return statements have been dropped in these cases to satisfy CS.

Please let me know if you'd like me to squash.

I also got a bit cavalier with the psalm baseline - I was left with around 130 new errors that all looked like the result of changing line numbers rather than new errors, so I just updated/added to the baseline - ~1000 psalm errors have been fixed in this pull so I decided to quit whilst I was ahead…

Signed-off-by: George Steel <george@net-glue.co.uk>
…mportInternalFunction

Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

Hmm, we'll need a 2.17.x branch here, before merging

Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @gsteel!

src/Helper/AbstractHtmlElement.php Show resolved Hide resolved
src/Helper/HeadLink.php Show resolved Hide resolved
src/Helper/Navigation/Links.php Show resolved Hide resolved
src/Helper/PaginationControl.php Show resolved Hide resolved
@@ -85,7 +83,7 @@ public function setFilterChain(FilterChain $filters)
public function getFilterChain()
{
if (null === $this->__filterChain) {
$this->setFilterChain(new FilterChain());
$this->__filterChain = new FilterChain();
Copy link
Member

Choose a reason for hiding this comment

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

Not much of a problem, but it may be possible that overrides to setFilterChain() make this change a potential issue.

I'll let this one roll though, as it's really an edge case.

@@ -414,7 +429,7 @@ public function setFilterChain(FilterChain $filters)
public function getFilterChain()
{
if (null === $this->__filterChain) {
$this->setFilterChain(new FilterChain());
$this->__filterChain = new FilterChain();
Copy link
Member

Choose a reason for hiding this comment

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

Similar to above location: setter may have been overridden, although I'll let this one through.

src/Resolver/PrefixPathStackResolver.php Show resolved Hide resolved
@Ocramius Ocramius self-assigned this Jan 8, 2022
@Ocramius Ocramius changed the base branch from 2.16.x to 2.17.x January 8, 2022 16:14
@Ocramius Ocramius changed the title WIP: Update to Laminas Coding Standard 2.3 Update to Laminas Coding Standard 2.3 Jan 8, 2022
@Ocramius Ocramius merged commit 92d591a into laminas:2.17.x Jan 8, 2022
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2022

Thanks @gsteel!

@gsteel
Copy link
Member Author

gsteel commented Jan 8, 2022

Thanks @gsteel!

Thanks for reviewing @Ocramius! It was a bit of a monster that one 😅

@gsteel gsteel deleted the lcs2 branch January 8, 2022 16:17
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2022

Yeah, but I was waiting while I was generating an almost 40Gb performance profile for an app: https://twitter.com/Ocramius/status/1479844147427172360 :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants