Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Installation
Use Composer to install the bundle:

```bash
$ composer require qossmic/rich-model-forms-bundle
$ composer require opensc/rich-model-forms-bundle
```

When using Symfony Flex, the bundle will be enabled automatically. Otherwise, you need to make sure that the bundle is
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "qossmic/rich-model-forms-bundle",
"name": "opensc/rich-model-forms-bundle",
"description": "Provides additional data mapper options that ease the use of the Symfony Form component with rich models.",
"keywords": ["Symfony", "form", "forms", "bundle", "rich model", "DDD", "domain-driven design"],
"type": "symfony-bundle",
Expand Down Expand Up @@ -38,12 +38,12 @@
},
"autoload": {
"psr-4": {
"Qossmic\\RichModelForms\\": "src/Qossmic"
"OpenSC\\RichModelForms\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Qossmic\\RichModelForms\\Tests\\": "tests"
"OpenSC\\RichModelForms\\Tests\\": "tests"
}
},
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion docs/mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Alternatively, you can also implement the `PropertyMapperInterface` and fully cu

```php
// ...
use Qossmic\RichModelForms\DataMapper\PropertyMapperInterface;
use OpenSC\RichModelForms\DataMapper\PropertyMapperInterface;

public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\DataMapper;
namespace OpenSC\RichModelForms\DataMapper;

use Qossmic\RichModelForms\ExceptionHandling\FormExceptionHandler;
use OpenSC\RichModelForms\ExceptionHandling\FormExceptionHandler;
use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\Exception\LogicException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\DataMapper;
namespace OpenSC\RichModelForms\DataMapper;

/**
* @author Christian Flothmann <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\DataTransformer;
namespace OpenSC\RichModelForms\DataTransformer;

use Qossmic\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry;
use Qossmic\RichModelForms\ExceptionHandling\ExceptionToErrorMapperTrait;
use Qossmic\RichModelForms\Instantiator\ViewDataInstantiator;
use OpenSC\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry;
use OpenSC\RichModelForms\ExceptionHandling\ExceptionToErrorMapperTrait;
use OpenSC\RichModelForms\Instantiator\ViewDataInstantiator;
use Symfony\Component\Form\ButtonBuilder;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\DependencyInjection\Compiler;
namespace OpenSC\RichModelForms\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
Expand All @@ -29,16 +29,16 @@ final class RegisterExceptionHandlersPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('qossmic.rich_model_forms.exception_handler.registry')) {
if (!$container->hasDefinition('opensc.rich_model_forms.exception_handler.registry')) {
return;
}

$exceptionHandlerRegistry = $container->getDefinition('qossmic.rich_model_forms.exception_handler.registry');
$exceptionHandlerRegistry = $container->getDefinition('opensc.rich_model_forms.exception_handler.registry');

$exceptionHandlers = [];
$strategies = [];

foreach ($container->findTaggedServiceIds('qossmic.rich_model_forms.exception_handler') as $id => $tag) {
foreach ($container->findTaggedServiceIds('opensc.rich_model_forms.exception_handler') as $id => $tag) {
/** @var class-string $class */
$class = $container->getParameterBag()->resolveValue($container->getDefinition($id)->getClass());
$exceptionHandlers[$id] = new TypedReference($id, $class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\DependencyInjection;
namespace OpenSC\RichModelForms\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormConfigInterface;
use Symfony\Component\PropertyAccess\Exception\InvalidArgumentException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormConfigInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

/**
* @author Christian Flothmann <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormConfigInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Psr\Container\ContainerInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormConfigInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormConfigInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\ExceptionHandling;
namespace OpenSC\RichModelForms\ExceptionHandling;

use Symfony\Component\Form\FormConfigInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Extension;

use Qossmic\RichModelForms\DataMapper\DataMapper;
use Qossmic\RichModelForms\DataMapper\PropertyMapperInterface;
use Qossmic\RichModelForms\DataTransformer\ValueObjectTransformer;
use Qossmic\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry;
use Qossmic\RichModelForms\ExceptionHandling\FormExceptionHandler;
use Qossmic\RichModelForms\Instantiator\FormDataInstantiator;
namespace OpenSC\RichModelForms\Extension;

use OpenSC\RichModelForms\DataMapper\DataMapper;
use OpenSC\RichModelForms\DataMapper\PropertyMapperInterface;
use OpenSC\RichModelForms\DataTransformer\ValueObjectTransformer;
use OpenSC\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry;
use OpenSC\RichModelForms\ExceptionHandling\FormExceptionHandler;
use OpenSC\RichModelForms\Instantiator\FormDataInstantiator;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Exception\InvalidConfigurationException;
use Symfony\Component\Form\Extension\Core\Type\FormType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Instantiator;
namespace OpenSC\RichModelForms\Instantiator;

use Symfony\Component\Form\FormInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Instantiator;
namespace OpenSC\RichModelForms\Instantiator;

use Symfony\Component\Form\Exception\TransformationFailedException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Instantiator;
namespace OpenSC\RichModelForms\Instantiator;

use Symfony\Component\Form\FormBuilderInterface;

Expand Down
35 changes: 0 additions & 35 deletions src/Qossmic/Resources/config/services.xml

This file was deleted.

35 changes: 35 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<defaults public="false" />

<service id="opensc.rich_model_forms.type_extension" class="OpenSC\RichModelForms\Extension\RichModelFormsTypeExtension">
<argument type="service" id="property_accessor" />
<argument type="service" id="opensc.rich_model_forms.exception_handler.registry" />
<argument type="service" id="opensc.rich_model_forms.form_exception_handler" />
<tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\FormType" />
</service>

<service id="opensc.rich_model_forms.form_exception_handler" class="OpenSC\RichModelForms\ExceptionHandling\FormExceptionHandler">
<argument type="service" id="opensc.rich_model_forms.exception_handler.registry" />
<argument type="service" id="translator" on-invalid="ignore" />
<argument type="string">%validator.translation_domain%</argument>
</service>

<service id="opensc.rich_model_forms.exception_handler.registry" class="OpenSC\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry">
<argument>null</argument> <!-- service locator will be injected during compilation -->
<argument type="collection" /> <!-- exception handling strategies, will be injected during compilation -->
</service>

<service id="opensc.rich_model_forms.exception_handler.strategy.argument_type_mismatch" class="OpenSC\RichModelForms\ExceptionHandling\ArgumentTypeMismatchExceptionHandler">
<tag name="opensc.rich_model_forms.exception_handler" strategy="type_error" />
</service>

<service id="opensc.rich_model_forms.exception_handler.strategy.fallback" class="OpenSC\RichModelForms\ExceptionHandling\FallbackExceptionHandler">
<tag name="opensc.rich_model_forms.exception_handler" strategy="fallback" />
</service>
</services>
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms;
namespace OpenSC\RichModelForms;

use Qossmic\RichModelForms\DependencyInjection\Compiler\RegisterExceptionHandlersPass;
use OpenSC\RichModelForms\DependencyInjection\Compiler\RegisterExceptionHandlersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand Down
8 changes: 4 additions & 4 deletions tests/ExceptionHandlerRegistryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Tests;
namespace OpenSC\RichModelForms\Tests;

use Qossmic\RichModelForms\ExceptionHandling\ArgumentTypeMismatchExceptionHandler;
use Qossmic\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry;
use Qossmic\RichModelForms\ExceptionHandling\FallbackExceptionHandler;
use OpenSC\RichModelForms\ExceptionHandling\ArgumentTypeMismatchExceptionHandler;
use OpenSC\RichModelForms\ExceptionHandling\ExceptionHandlerRegistry;
use OpenSC\RichModelForms\ExceptionHandling\FallbackExceptionHandler;
use Symfony\Component\DependencyInjection\ContainerBuilder;

trait ExceptionHandlerRegistryTrait
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/DependencyInjection/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Tests\Fixtures\DependencyInjection;
namespace OpenSC\RichModelForms\Tests\Fixtures\DependencyInjection;

use Qossmic\RichModelForms\RichModelFormsBundle;
use OpenSC\RichModelForms\RichModelFormsBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
Expand Down
6 changes: 3 additions & 3 deletions tests/Fixtures/DependencyInjection/PublicTestAliasPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Tests\Fixtures\DependencyInjection;
namespace OpenSC\RichModelForms\Tests\Fixtures\DependencyInjection;

use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand All @@ -26,12 +26,12 @@ public function process(ContainerBuilder $container): void
$testAliases = [];

foreach ($container->getDefinitions() as $id => $definition) {
if (str_starts_with($id, 'qossmic.rich_model_forms.')) {
if (str_starts_with($id, 'opensc.rich_model_forms.')) {
$container->setAlias('test.'.$id, new Alias($id, true));
$testAliases['test.'.$id] = $definition->getClass();
}
}

$container->setParameter('qossmic.rich_model_forms.test_service_aliases', $testAliases);
$container->setParameter('opensc.rich_model_forms.test_service_aliases', $testAliases);
}
}
4 changes: 2 additions & 2 deletions tests/Fixtures/Form/AddressType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

declare(strict_types = 1);

namespace Qossmic\RichModelForms\Tests\Fixtures\Form;
namespace OpenSC\RichModelForms\Tests\Fixtures\Form;

use Qossmic\RichModelForms\Tests\Fixtures\Model\Address;
use OpenSC\RichModelForms\Tests\Fixtures\Model\Address;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down
Loading
Loading