-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency on symfony/templating
- Loading branch information
Showing
23 changed files
with
56 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,22 +17,12 @@ | |
use Sonata\BlockBundle\Model\BlockInterface; | ||
use Sonata\CoreBundle\Model\Metadata; | ||
use Sonata\CoreBundle\Validator\ErrorElement; | ||
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; | ||
|
||
/** | ||
* @author Christian Gripp <[email protected]> | ||
*/ | ||
abstract class AbstractAdminBlockService extends AbstractBlockService implements AdminBlockServiceInterface | ||
{ | ||
/** | ||
* @param string $name | ||
* @param EngineInterface $templating | ||
*/ | ||
public function __construct($name, EngineInterface $templating) | ||
{ | ||
parent::__construct($name, $templating); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,10 @@ | |
|
||
use Sonata\BlockBundle\Block\BlockContextInterface; | ||
use Sonata\BlockBundle\Model\BlockInterface; | ||
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | ||
use Twig\Environment; | ||
|
||
/** | ||
* @author Sullivan Senechal <[email protected]> | ||
|
@@ -31,23 +31,12 @@ abstract class AbstractBlockService implements BlockServiceInterface | |
protected $name; | ||
|
||
/** | ||
* @var EngineInterface|null | ||
* @var Environment | ||
*/ | ||
protected $templating; | ||
|
||
/** | ||
* @param string $name | ||
* @param EngineInterface $templating | ||
*/ | ||
public function __construct($name = null, EngineInterface $templating = null) | ||
public function __construct(string $name, Environment $templating) | ||
{ | ||
if (null === $name || null === $templating) { | ||
@trigger_error( | ||
'The $name and $templating parameters will be required fields with the 4.0 release.', | ||
E_USER_DEPRECATED | ||
); | ||
} | ||
|
||
$this->name = $name; | ||
$this->templating = $templating; | ||
} | ||
|
@@ -63,7 +52,11 @@ public function __construct($name = null, EngineInterface $templating = null) | |
*/ | ||
public function renderResponse($view, array $parameters = [], Response $response = null) | ||
{ | ||
return $this->getTemplating()->renderResponse($view, $parameters, $response); | ||
$response = $response ?? new Response(); | ||
|
||
$response->setContent($this->getTemplating()->render($view, $parameters)); | ||
|
||
return $response; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,13 +23,13 @@ | |
use Sonata\CoreBundle\Form\Type\ImmutableArrayType; | ||
use Sonata\CoreBundle\Model\Metadata; | ||
use Sonata\CoreBundle\Validator\ErrorElement; | ||
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; | ||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
use Symfony\Component\Form\FormTypeInterface; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
use Twig\Environment; | ||
|
||
/** | ||
* @author Hugo Briand <[email protected]> | ||
|
@@ -56,12 +56,9 @@ class MenuBlockService extends AbstractAdminBlockService | |
protected $menuRegistry; | ||
|
||
/** | ||
* @param string $name | ||
* @param EngineInterface $templating | ||
* @param MenuProviderInterface $menuProvider | ||
* @param MenuRegistryInterface|null $menuRegistry | ||
*/ | ||
public function __construct($name, EngineInterface $templating, MenuProviderInterface $menuProvider, $menuRegistry = null) | ||
public function __construct(string $name, Environment $templating, MenuProviderInterface $menuProvider, $menuRegistry = null) | ||
{ | ||
parent::__construct($name, $templating); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.