-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
496 additions
and
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ branches: | |
only: | ||
- master | ||
- 1.x | ||
- 0.x | ||
|
||
language: php | ||
|
||
|
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 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 |
---|---|---|
|
@@ -18,13 +18,15 @@ | |
|
||
/** | ||
* @author Marko Kunic <[email protected]> | ||
* | ||
* @final since sonata-project/twig-extensions 0.x | ||
*/ | ||
final class DeprecatedTemplateExtension extends AbstractExtension | ||
class DeprecatedTemplateExtension extends AbstractExtension | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
* @return array | ||
*/ | ||
public function getTokenParsers(): array | ||
public function getTokenParsers() | ||
{ | ||
return [ | ||
new DeprecatedTemplateTokenParser(), | ||
|
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 |
---|---|---|
|
@@ -21,18 +21,26 @@ | |
* | ||
* @author Vincent Composieux <[email protected]> | ||
* @author Titouan Galopin <[email protected]> | ||
* | ||
* @final since sonata-project/twig-extensions 0.x | ||
*/ | ||
final class FlashMessageExtension extends AbstractExtension | ||
class FlashMessageExtension extends AbstractExtension | ||
{ | ||
public function getFunctions(): array | ||
/** | ||
* @return TwigFunction[] | ||
*/ | ||
public function getFunctions() | ||
{ | ||
return [ | ||
new TwigFunction('sonata_flashmessages_get', [FlashMessageRuntime::class, 'getFlashMessages']), | ||
new TwigFunction('sonata_flashmessages_types', [FlashMessageRuntime::class, 'getFlashMessagesTypes']), | ||
]; | ||
} | ||
|
||
public function getName(): string | ||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return 'sonata_twig_flashmessage'; | ||
} | ||
|
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 |
---|---|---|
|
@@ -20,8 +20,10 @@ | |
* | ||
* @author Vincent Composieux <[email protected]> | ||
* @author Titouan Galopin <[email protected]> | ||
* | ||
* @final since sonata-project/twig-extensions 0.x | ||
*/ | ||
final class FlashMessageRuntime | ||
class FlashMessageRuntime | ||
{ | ||
/** | ||
* @var FlashManager | ||
|
@@ -36,17 +38,22 @@ public function __construct(FlashManager $flashManager) | |
/** | ||
* Returns flash messages handled by Sonata flash manager. | ||
* | ||
* @param string $type Type of flash message | ||
* @param string $type Type of flash message | ||
* @param string|null $deprecatedDomain Translation domain to use | ||
* | ||
* @return array | ||
*/ | ||
public function getFlashMessages(string $type): array | ||
public function getFlashMessages($type, $deprecatedDomain = null) | ||
{ | ||
return $this->flashManager->get($type); | ||
return $this->flashManager->get($type, $deprecatedDomain); | ||
} | ||
|
||
/** | ||
* Returns flash messages types handled by Sonata flash manager. | ||
* | ||
* @return array | ||
*/ | ||
public function getFlashMessagesTypes(): array | ||
public function getFlashMessagesTypes() | ||
{ | ||
return $this->flashManager->getHandledTypes(); | ||
} | ||
|
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 |
---|---|---|
|
@@ -19,8 +19,10 @@ | |
/** | ||
* @author Hugo Briand <[email protected]> | ||
* @author Titouan Galopin <[email protected]> | ||
* | ||
* @final since sonata-project/twig-extensions 0.x | ||
*/ | ||
final class StatusExtension extends AbstractExtension | ||
class StatusExtension extends AbstractExtension | ||
{ | ||
public function getFilters(): array | ||
{ | ||
|
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 |
---|---|---|
|
@@ -18,8 +18,10 @@ | |
/** | ||
* @author Hugo Briand <[email protected]> | ||
* @author Titouan Galopin <[email protected]> | ||
* | ||
* @final since sonata-project/twig-extensions 0.x | ||
*/ | ||
final class StatusRuntime | ||
class StatusRuntime | ||
{ | ||
/** | ||
* @var StatusClassRendererInterface[] | ||
|
@@ -29,15 +31,19 @@ final class StatusRuntime | |
/** | ||
* Adds a renderer to the status services list. | ||
*/ | ||
public function addStatusService(StatusClassRendererInterface $renderer): void | ||
public function addStatusService(StatusClassRendererInterface $renderer) | ||
{ | ||
$this->statusServices[] = $renderer; | ||
} | ||
|
||
/** | ||
* @param mixed $statusType | ||
* @param object $object | ||
* @param mixed|null $statusType | ||
* @param string $default | ||
* | ||
* @return string | ||
*/ | ||
public function statusClass(object $object, $statusType = null, string $default = ''): string | ||
public function statusClass($object, $statusType = null, $default = '') | ||
{ | ||
foreach ($this->statusServices as $statusService) { | ||
\assert($statusService instanceof StatusClassRendererInterface); | ||
|
Oops, something went wrong.