forked from ezsystems/JMSJobQueueBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unneeded files and use UNIX line endings (schmittjoh#178)
* Remove uneeded files * Use UNIX line endings in all files
- Loading branch information
Showing
22 changed files
with
2,162 additions
and
2,170 deletions.
There are no files selected for viewing
80 changes: 40 additions & 40 deletions
80
DependencyInjection/Compiler/AddPaymentMethodFormTypesPass.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
<?php | ||
|
||
namespace JMS\Payment\CoreBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
|
||
/** | ||
* Wires payment method types. | ||
* | ||
* @author Johannes M. Schmitt <[email protected]> | ||
*/ | ||
class AddPaymentMethodFormTypesPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasDefinition('payment.form.choose_payment_method_type')) { | ||
return; | ||
} | ||
|
||
$paymentMethodFormTypes = array(); | ||
foreach ($container->findTaggedServiceIds('payment.method_form_type') as $id => $attributes) { | ||
$definition = $container->getDefinition($id); | ||
|
||
// check that this definition is also registered as a form type | ||
$attributes = $definition->getTag('form.type'); | ||
if (!$attributes) { | ||
throw new \RuntimeException(sprintf('The service "%s" is marked as payment method form type (tagged with "payment.method_form_type"), but is not registered as a form type with the Form Component. Please also add a "form.type" tag.', $id)); | ||
} | ||
|
||
if (!isset($attributes[0]['alias'])) { | ||
throw new \RuntimeException(sprintf('Please define an alias attribute for tag "form.type" of service "%s".', $id)); | ||
} | ||
|
||
$paymentMethodFormTypes[] = $attributes[0]['alias']; | ||
} | ||
|
||
$container->getDefinition('payment.form.choose_payment_method_type') | ||
->addArgument($paymentMethodFormTypes); | ||
} | ||
<?php | ||
|
||
namespace JMS\Payment\CoreBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
|
||
/** | ||
* Wires payment method types. | ||
* | ||
* @author Johannes M. Schmitt <[email protected]> | ||
*/ | ||
class AddPaymentMethodFormTypesPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasDefinition('payment.form.choose_payment_method_type')) { | ||
return; | ||
} | ||
|
||
$paymentMethodFormTypes = array(); | ||
foreach ($container->findTaggedServiceIds('payment.method_form_type') as $id => $attributes) { | ||
$definition = $container->getDefinition($id); | ||
|
||
// check that this definition is also registered as a form type | ||
$attributes = $definition->getTag('form.type'); | ||
if (!$attributes) { | ||
throw new \RuntimeException(sprintf('The service "%s" is marked as payment method form type (tagged with "payment.method_form_type"), but is not registered as a form type with the Form Component. Please also add a "form.type" tag.', $id)); | ||
} | ||
|
||
if (!isset($attributes[0]['alias'])) { | ||
throw new \RuntimeException(sprintf('Please define an alias attribute for tag "form.type" of service "%s".', $id)); | ||
} | ||
|
||
$paymentMethodFormTypes[] = $attributes[0]['alias']; | ||
} | ||
|
||
$container->getDefinition('payment.form.choose_payment_method_type') | ||
->addArgument($paymentMethodFormTypes); | ||
} | ||
} |
Oops, something went wrong.