Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Optional usage of twig service #207

Merged
merged 1 commit into from
Feb 24, 2018
Merged

Conversation

covex-nn
Copy link
Contributor

I am targeting this branch, because this is a patch.

See #206

Changelog

### Fixed
- Usage of twig service in SonataCacheBundle is optional now

Subject

To find Twig base template class, Sonata\CacheBundle\SonataCacheBundle::boot method gets twig service from container and does not check if it exists.

if (method_exists($baseTemplateClass, 'attachRecorder')) {
call_user_func([$baseTemplateClass, 'attachRecorder'], $this->container->get('sonata.cache.recorder'));
if (method_exists($baseTemplateClass, 'attachRecorder')) {
call_user_func([$baseTemplateClass, 'attachRecorder'], $this->container->get('sonata.cache.recorder'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Please linebreak lines over 120 chars (on my phone, can't check the actual length)

Copy link
Contributor

Choose a reason for hiding this comment

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

Its exactly 120 chars 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Great then

@greg0ire greg0ire merged commit 8696d5a into sonata-project:2.x Feb 24, 2018
@greg0ire
Copy link
Contributor

greg0ire commented Feb 24, 2018

Thanks @covex-nn

@covex-nn covex-nn deleted the optional-twig branch February 24, 2018 19:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants