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

Helper and Inheritance Deprecations #146

Merged
merged 7 commits into from
Mar 24, 2022

Conversation

gsteel
Copy link
Member

@gsteel gsteel commented Feb 21, 2022

Q A
BC Break no
New Feature yes
QA yes

Description

  • Json Helper: Deprecate inheritance tree, deprecate setResponse() so it's effectively just json_encode() (Eventually) - The response really shouldn't be modified in the view should it?
  • HtmlAttributes Helper: Deprecate inheritance tree - it only needs an escaper to do its job
  • The HTML List helper - also only needs access to an escaper
  • The Gravatar helper is deprecated completely with all its setters and getters. An alternative implementation is provided that simply returns an tag based on its arguments Moved to Deprecates and replaces the Gravatar helper with a simplified version… #147
  • The view model helper doesn't need its current inheritance tree
  • The layout helper only needs access to the view model helper so it is changed to pave the way for factory based constructor injection of the dependent helper

There's no need IMO to have this block a 2.20 release

…structor - there is no need to reach into the view to retrieve one.

Signed-off-by: George Steel <george@net-glue.co.uk>
…that you can manipulate response headers from the view layer.

Signed-off-by: George Steel <george@net-glue.co.uk>
… the view model helper from the renderer favouring constructor injection of the helper. Also mark it as final

Signed-off-by: George Steel <george@net-glue.co.uk>
…e marked as final.

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

Signed-off-by: George Steel <george@net-glue.co.uk>
…e consistent with arguments to other helpers

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

Let's split this up: gravatar added in smells a bit 😁

@gsteel gsteel force-pushed the deprecate-inheritance-in-helpers branch from 4c97a22 to 125f5f9 Compare February 22, 2022 08:31
@gsteel gsteel changed the base branch from 2.20.x to 2.21.x March 23, 2022 14:32
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!

Few notes of things that may be improved in future:

  • when checking against Foo|null, instead of ! $foo, $foo === null is a better approach, as it will be picked up by static analysis, if the type changes
  • when casting object to string, use $object->__toString() rather than (string) $object, which avoids having regressions when $object (by accident) is no longer an object

@Ocramius Ocramius self-assigned this Mar 24, 2022
@Ocramius Ocramius added this to the 2.21.0 milestone Mar 24, 2022
@Ocramius Ocramius merged commit 3b906d3 into laminas:2.21.x Mar 24, 2022
@gsteel gsteel deleted the deprecate-inheritance-in-helpers branch March 24, 2022 12:20
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