-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from dpfaffenbauer/fix-export-runners
Fix export runners
- Loading branch information
Showing
7 changed files
with
109 additions
and
5 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
27 changes: 27 additions & 0 deletions
27
...ImportDefinitionsBundle/DependencyInjection/Compiler/ExportRunnerRegistryCompilerPass.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* Import Definitions. | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the GNU General Public License version 3 (GPLv3) | ||
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt | ||
* files that are distributed with this source code. | ||
* | ||
* @copyright Copyright (c) 2016-2018 w-vision AG (https://www.w-vision.ch) | ||
* @license https://github.com/w-vision/ImportDefinitions/blob/master/gpl-3.0.txt GNU General Public License version 3 (GPLv3) | ||
*/ | ||
|
||
namespace ImportDefinitionsBundle\DependencyInjection\Compiler; | ||
|
||
final class ExportRunnerRegistryCompilerPass extends AbstractServiceRegistryCompilerPass | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct( | ||
'import_definition.registry.export_runner', | ||
'import_definition.export_runners', | ||
'import_definition.export_runner' | ||
); | ||
} | ||
} |
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
61 changes: 61 additions & 0 deletions
61
src/ImportDefinitionsBundle/Form/Type/ExportRunnerChoiceType.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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Import Definitions. | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the GNU General Public License version 3 (GPLv3) | ||
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt | ||
* files that are distributed with this source code. | ||
* | ||
* @copyright Copyright (c) 2016-2018 w-vision AG (https://www.w-vision.ch) | ||
* @license https://github.com/w-vision/ImportDefinitions/blob/master/gpl-3.0.txt GNU General Public License version 3 (GPLv3) | ||
*/ | ||
|
||
namespace ImportDefinitionsBundle\Form\Type; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
final class ExportRunnerChoiceType extends AbstractType | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $runners; | ||
|
||
/** | ||
* @param array $runners | ||
*/ | ||
public function __construct(array $runners) | ||
{ | ||
$this->runners = $runners; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function configureOptions(OptionsResolver $resolver) | ||
{ | ||
$resolver->setDefaults([ | ||
'choices' => array_flip($this->runners), | ||
]); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getParent() | ||
{ | ||
return ChoiceType::class; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getBlockPrefix() | ||
{ | ||
return 'import_definitions_export_runner_choice'; | ||
} | ||
} |
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