-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
28 changed files
with
538 additions
and
119 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 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 |
---|---|---|
|
@@ -24,15 +24,20 @@ | |
* returning true value when the form is bind. | ||
* | ||
* @author Sylvain Rascar <[email protected]> | ||
* | ||
* @final since sonata-project/form-extensions 0.x | ||
*/ | ||
final class FixCheckboxDataListener implements EventSubscriberInterface | ||
class FixCheckboxDataListener implements EventSubscriberInterface | ||
{ | ||
public static function getSubscribedEvents(): array | ||
/** | ||
* @return array | ||
*/ | ||
public static function getSubscribedEvents() | ||
{ | ||
return [FormEvents::PRE_SUBMIT => 'preSubmit']; | ||
} | ||
|
||
public function preSubmit(FormEvent $event): void | ||
public function preSubmit(FormEvent $event) | ||
{ | ||
$data = $event->getData(); | ||
$transformers = $event->getForm()->getConfig()->getViewTransformers(); | ||
|
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 |
---|---|---|
|
@@ -22,8 +22,10 @@ | |
* Resize a collection form element based on the data sent from the client. | ||
* | ||
* @author Bernhard Schussek <[email protected]> | ||
* | ||
* @final since sonata-project/form-extensions 0.x | ||
*/ | ||
final class ResizeFormListener implements EventSubscriberInterface | ||
class ResizeFormListener implements EventSubscriberInterface | ||
{ | ||
/** | ||
* @var string | ||
|
@@ -67,7 +69,7 @@ public function __construct( | |
$this->preSubmitDataCallback = $preSubmitDataCallback; | ||
} | ||
|
||
public static function getSubscribedEvents(): array | ||
public static function getSubscribedEvents() | ||
{ | ||
return [ | ||
FormEvents::PRE_SET_DATA => 'preSetData', | ||
|
@@ -79,7 +81,7 @@ public static function getSubscribedEvents(): array | |
/** | ||
* @throws UnexpectedTypeException | ||
*/ | ||
public function preSetData(FormEvent $event): void | ||
public function preSetData(FormEvent $event) | ||
{ | ||
$form = $event->getForm(); | ||
$data = $event->getData(); | ||
|
@@ -111,7 +113,7 @@ public function preSetData(FormEvent $event): void | |
/** | ||
* @throws UnexpectedTypeException | ||
*/ | ||
public function preSubmit(FormEvent $event): void | ||
public function preSubmit(FormEvent $event) | ||
{ | ||
if (!$this->resizeOnSubmit) { | ||
return; | ||
|
@@ -158,7 +160,7 @@ public function preSubmit(FormEvent $event): void | |
/** | ||
* @throws UnexpectedTypeException | ||
*/ | ||
public function onSubmit(FormEvent $event): void | ||
public function onSubmit(FormEvent $event) | ||
{ | ||
if (!$this->resizeOnSubmit) { | ||
return; | ||
|
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\Form\Fixtures; | ||
|
||
use Twig\Loader\FilesystemLoader; | ||
|
||
final class StubFilesystemLoader extends FilesystemLoader | ||
{ | ||
protected function findTemplate($name, $throw = true) | ||
{ | ||
// strip away bundle name | ||
$parts = explode(':', $name); | ||
|
||
return parent::findTemplate(end($parts), $throw); | ||
} | ||
} |
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
Oops, something went wrong.