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 EZP-21924: [SensioLabsInsight] Refactor LegacyKernelController to be less than 20 lines #607

Merged
merged 1 commit into from Nov 12, 2013

Conversation

lolautruche
Copy link
Contributor

https://jira.ez.no/browse/EZP-21924

See https://insight.sensiolabs.com/projects/0885c0ce-4b9f-4b89-aa9c-e8f9f7a315e0/analyses/7#rule-24-034

This PR refactors LegacyKernelController to be thiner and delegates LegacyResponse generation to new LegacyResponseManager service.

Note that mapHeaders() cannot be tested because of issues in PHPUnit with process isolation (see also this issue on testing headers with PHPUnit)

* @param string $view The view name
* @param array $parameters An array of parameters to pass to the view
*
* @return LegacyResponse A LegacyResponse instance
Copy link
Contributor

Choose a reason for hiding this comment

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

\eZ\Bundle\EzPublishLegacyBundle\LegacyResponse

@dpobel
Copy link
Contributor

dpobel commented Nov 12, 2013

To make the mapHeaders method testable, you can pass the headers array to the method instead of calling header_list inside it (unless the issue lies somewhere else ?).
Except this and the few inline nitpicks, +1

@lolautruche
Copy link
Contributor Author

@dpobel Done. And mapHeaders() is now tested 😃

@dpobel
Copy link
Contributor

dpobel commented Nov 12, 2013

still +1

@lolautruche lolautruche merged commit e013ed8 into master Nov 12, 2013
@lolautruche lolautruche deleted the fix_EZP-21924_sli_legacy_kernel_too_long branch November 12, 2013 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants