From 274eb9ebafe368b08e351c3aeed6b13368dbbf71 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 20 Jul 2012 01:18:14 +0200 Subject: [PATCH 1/2] [EventDispatcher] Rename UnmodifiableEventDispatcher to ImmutableEventDispatcher --- src/Symfony/Component/EventDispatcher/CHANGELOG.md | 2 +- ...leEventDispatcher.php => ImmutableEventDispatcher.php} | 2 +- ...ispatcherTest.php => ImmutableEventDispatcherTest.php} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename src/Symfony/Component/EventDispatcher/{UnmodifiableEventDispatcher.php => ImmutableEventDispatcher.php} (96%) rename src/Symfony/Component/EventDispatcher/Tests/{UnmodifiableEventDispatcherTest.php => ImmutableEventDispatcherTest.php} (91%) diff --git a/src/Symfony/Component/EventDispatcher/CHANGELOG.md b/src/Symfony/Component/EventDispatcher/CHANGELOG.md index 9f8c8129e2..536c5ac729 100644 --- a/src/Symfony/Component/EventDispatcher/CHANGELOG.md +++ b/src/Symfony/Component/EventDispatcher/CHANGELOG.md @@ -13,4 +13,4 @@ CHANGELOG * added GenericEvent event class * added the possibility for subscribers to subscribe several times for the same event - * added UnmodifiableEventDispatcher + * added ImmutableEventDispatcher diff --git a/src/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php b/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php similarity index 96% rename from src/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php rename to src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php index c7097aa429..b70b81a8b2 100644 --- a/src/Symfony/Component/EventDispatcher/UnmodifiableEventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php @@ -16,7 +16,7 @@ namespace Symfony\Component\EventDispatcher; * * @author Bernhard Schussek */ -class UnmodifiableEventDispatcher implements EventDispatcherInterface +class ImmutableEventDispatcher implements EventDispatcherInterface { /** * The proxied dispatcher. diff --git a/src/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php similarity index 91% rename from src/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php rename to src/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php index d2502b1957..6402f89fa5 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/UnmodifiableEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/ImmutableEventDispatcherTest.php @@ -12,13 +12,13 @@ namespace Symfony\Component\EventDispatcher\Tests; use Symfony\Component\EventDispatcher\Event; -use Symfony\Component\EventDispatcher\UnmodifiableEventDispatcher; +use Symfony\Component\EventDispatcher\ImmutableEventDispatcher; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * @author Bernhard Schussek */ -class UnmodifiableEventDispatcherTest extends \PHPUnit_Framework_TestCase +class ImmutableEventDispatcherTest extends \PHPUnit_Framework_TestCase { /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -26,14 +26,14 @@ class UnmodifiableEventDispatcherTest extends \PHPUnit_Framework_TestCase private $innerDispatcher; /** - * @var UnmodifiableEventDispatcher + * @var ImmutableEventDispatcher */ private $dispatcher; protected function setUp() { $this->innerDispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface'); - $this->dispatcher = new UnmodifiableEventDispatcher($this->innerDispatcher); + $this->dispatcher = new ImmutableEventDispatcher($this->innerDispatcher); } public function testDispatchDelegates() From c81b2ad3e2aad81144182190086af7d6ffc775ec Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 20 Jul 2012 01:18:42 +0200 Subject: [PATCH 2/2] [Form] Rename UnmodifiableFormConfig to ImmutableFormConfig --- src/Symfony/Component/Form/Form.php | 8 ++++---- ...UnmodifiableFormConfig.php => ImmutableFormConfig.php} | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) rename src/Symfony/Component/Form/{UnmodifiableFormConfig.php => ImmutableFormConfig.php} (96%) diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index e191cc9669..a2383948e7 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -126,8 +126,8 @@ class Form implements \IteratorAggregate, FormInterface */ public function __construct(FormConfigInterface $config) { - if (!$config instanceof UnmodifiableFormConfig) { - $config = new UnmodifiableFormConfig($config); + if (!$config instanceof ImmutableFormConfig) { + $config = new ImmutableFormConfig($config); } // Compound forms always need a data mapper, otherwise calls to @@ -152,7 +152,7 @@ class Form implements \IteratorAggregate, FormInterface /** * Returns the configuration of the form. * - * @return UnmodifiableFormConfig The form's immutable configuration. + * @return ImmutableFormConfig The form's immutable configuration. */ public function getConfig() { @@ -562,7 +562,7 @@ class Form implements \IteratorAggregate, FormInterface // Synchronize representations - must not change the content! $modelData = $this->normToModel($normData); $viewData = $this->normToView($normData); - + $synchronized = true; } catch (TransformationFailedException $e) { } diff --git a/src/Symfony/Component/Form/UnmodifiableFormConfig.php b/src/Symfony/Component/Form/ImmutableFormConfig.php similarity index 96% rename from src/Symfony/Component/Form/UnmodifiableFormConfig.php rename to src/Symfony/Component/Form/ImmutableFormConfig.php index cb586a8ca0..36bd867469 100644 --- a/src/Symfony/Component/Form/UnmodifiableFormConfig.php +++ b/src/Symfony/Component/Form/ImmutableFormConfig.php @@ -12,14 +12,14 @@ namespace Symfony\Component\Form; use Symfony\Component\Form\Util\PropertyPath; -use Symfony\Component\EventDispatcher\UnmodifiableEventDispatcher; +use Symfony\Component\EventDispatcher\ImmutableEventDispatcher; /** * A read-only form configuration. * * @author Bernhard Schussek */ -class UnmodifiableFormConfig implements FormConfigInterface +class ImmutableFormConfig implements FormConfigInterface { /** * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface @@ -134,8 +134,8 @@ class UnmodifiableFormConfig implements FormConfigInterface public function __construct(FormConfigInterface $config) { $dispatcher = $config->getEventDispatcher(); - if (!$dispatcher instanceof UnmodifiableEventDispatcher) { - $dispatcher = new UnmodifiableEventDispatcher($dispatcher); + if (!$dispatcher instanceof ImmutableEventDispatcher) { + $dispatcher = new ImmutableEventDispatcher($dispatcher); } $this->dispatcher = $dispatcher;