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 decorators #6090

Merged
merged 3 commits into from
Jun 8, 2022
Merged

Fix decorators #6090

merged 3 commits into from
Jun 8, 2022

Conversation

lonnieezell
Copy link
Member

@lonnieezell lonnieezell commented Jun 7, 2022

Description
Fixed a typo for View Decorators documentation. Also, the current code, while passing tests, wasn't working
for me in a real-word test. Modified to better check the class implements the ViewDecoratorInterface.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell lonnieezell requested a review from MGatner June 7, 2022 04:15
@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 7, 2022
@@ -24,7 +24,7 @@ protected function decorateOutput(string $html): string
$decorators = \config('View')->decorators;

foreach ($decorators as $decorator) {
if (! is_subclass_of($decorator, ViewDecoratorInterface::class)) {
Copy link
Member

@kenjis kenjis Jun 7, 2022

Choose a reason for hiding this comment

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

The code seems fine, but did you get the ViewException thrown?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the exception was thrown when using is_subclass_of. Not sure how I didn't run into that previously but following the docs I had to make these changes to get it to work.

system/View/ViewDecoratorTrait.php Outdated Show resolved Hide resolved
@kenjis kenjis added the documentation Pull requests for documentation only label Jun 8, 2022
@kenjis kenjis removed the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 8, 2022
@MGatner MGatner merged commit 31bd101 into develop Jun 8, 2022
@kenjis kenjis deleted the decorator-fix branch June 8, 2022 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants