-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set controller as service * ParameterBag service no exist in Symfony 3.4 * use ParameterBag instead of container service * add ParameterBag comment * explode services for export * remove entityManager not used * fix unused param in service * update README * fix wording
- Loading branch information
Showing
8 changed files
with
191 additions
and
54 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\FriendsOfSylius\SyliusImportExportPlugin\Controller; | ||
|
||
use FriendsOfSylius\SyliusImportExportPlugin\Controller\ImportDataController; | ||
use PhpSpec\ObjectBehavior; | ||
use Sylius\Component\Registry\ServiceRegistryInterface; | ||
use Symfony\Component\Form\FormFactoryInterface; | ||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | ||
|
||
class ImportDataControllerSpec extends ObjectBehavior | ||
{ | ||
function let( | ||
ServiceRegistryInterface $registry, | ||
FlashBagInterface $flashBag, | ||
FormFactoryInterface $formFactory, | ||
\Twig_Environment $twig | ||
) { | ||
$this->beConstructedWith( | ||
$registry, | ||
$flashBag, | ||
$formFactory, | ||
$twig | ||
); | ||
} | ||
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(ImportDataController::class); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/* | ||
* This is file is required as long as SyliusImportExportPlugin supports Symfony versions lower than 4.1. Before this version, ParameterBag wasn't a service available. | ||
* | ||
* See: https://symfony.com/blog/new-in-symfony-4-1-getting-container-parameters-as-a-service | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FriendsOfSylius\SyliusImportExportPlugin\DependencyInjection\ParameterBag; | ||
|
||
use Symfony\Component\DependencyInjection\Container; | ||
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; | ||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||
|
||
final class ParameterBag extends FrozenParameterBag implements ParameterBagInterface | ||
{ | ||
private $container; | ||
|
||
public function __construct(Container $container) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function all() | ||
{ | ||
return $this->container->getParameterBag()->all(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function get($name) | ||
{ | ||
return $this->container->getParameter($name); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function has($name) | ||
{ | ||
return $this->container->hasParameter($name); | ||
} | ||
} |
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.