Commit 5c1d5f7f authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Merge branches 'master' and 'zf-3.x' of https://git.unicaen.fr/lib/unicaen/import

parents cca7cd5d d2efbf09
Pipeline #5362 failed with stage
in 10 seconds
......@@ -8,11 +8,11 @@
}
],
"require" : {
"unicaen/auth": "^1.2 || dev-master",
"unicaen/oracle": "^1.1 || dev-master"
"unicaen/auth": "dev-zf-3.x || ^3.0",
"unicaen/oracle": "^1.2"
},
"require-dev" : {
"phpunit/PHPUnit": "^5.7"
"phpunit/phpunit": "^5.7"
},
"autoload" : {
"psr-0" : {
......
......@@ -2,13 +2,11 @@
namespace UnicaenImport\Controller\Factory;
use Interop\Container\ContainerInterface;
use UnicaenImport\Controller\DifferentielController;
use UnicaenImport\Service\DifferentielService;
use UnicaenImport\Service\QueryGeneratorService;
use UnicaenImport\Service\SchemaService;
use Zend\Mvc\Controller\ControllerManager as ContainerInterface;
/**
* Description of DifferentielControllerFactory
......@@ -27,9 +25,6 @@ class DifferentielControllerFactory
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* On quitte le ControllerManager */
$container = $container->getServiceLocator();
$controller = new DifferentielController();
$controller->setServiceSchema($container->get(SchemaService::class));
$controller->setServiceQueryGenerator($container->get(QueryGeneratorService::class));
......
......@@ -2,11 +2,10 @@
namespace UnicaenImport\Controller\Factory;
use Interop\Container\ContainerInterface;
use UnicaenImport\Controller\ImportController;
use UnicaenImport\Processus\ImportProcessus;
use UnicaenImport\Service\SchemaService;
use Zend\Mvc\Controller\ControllerManager as ContainerInterface;
/**
* Description of ImportControllerFactory
......@@ -25,8 +24,6 @@ class ImportControllerFactory
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
$container = $container->getServiceLocator();
$controller = new ImportController();
$controller->setServiceSchema($container->get(SchemaService::class));
$controller->setProcessusImport($container->get(ImportProcessus::class));
......
......@@ -2,13 +2,11 @@
namespace UnicaenImport\Controller\Factory;
use Interop\Container\ContainerInterface;
use UnicaenImport\Form\SourceForm;
use UnicaenImport\Service\SourceService;
use Zend\Mvc\Controller\ControllerManager as ContainerInterface;
use UnicaenImport\Controller\SourceController;
/**
* Description of SourceControllerFactory
*
......@@ -26,9 +24,6 @@ class SourceControllerFactory
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* On quitte le ControllerManager */
$container = $container->getServiceLocator();
$controller = new SourceController;
$controller->setServiceSource($container->get(SourceService::class));
$controller->setFormSource($container->get('FormElementManager')->get(SourceForm::class));
......
......@@ -2,12 +2,11 @@
namespace UnicaenImport\Controller\Factory;
use Interop\Container\ContainerInterface;
use UnicaenImport\Controller\TableController;
use UnicaenImport\Form\TableForm;
use UnicaenImport\Service\SchemaService;
use UnicaenImport\Service\TableService;
use Zend\Mvc\Controller\ControllerManager as ContainerInterface;
use UnicaenImport\Controller\TableController;
/**
......@@ -27,9 +26,6 @@ class TableControllerFactory
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* On quitte le ControllerManager */
$container = $container->getServiceLocator();
$controller = new TableController;
$controller->setServiceTable($container->get(TableService::class));
$controller->setServiceSchema($container->get(SchemaService::class));
......
......@@ -2,11 +2,9 @@
namespace UnicaenImport\Form\Factory;
use Zend\Form\FormElementManager as ContainerInterface;
use Interop\Container\ContainerInterface;
use UnicaenImport\Form\SourceForm;
/**
* Description of SourceFormFactory
*
......@@ -14,22 +12,8 @@ use UnicaenImport\Form\SourceForm;
*/
class SourceFormFactory
{
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param array|null $options
*
* @return SourceForm
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* On quitte le FormElementManager */
$container = $container->getServiceLocator();
$form = new SourceForm;
/* Injectez vos dépendances ICI */
return $form;
return new SourceForm;
}
}
\ No newline at end of file
......@@ -2,11 +2,9 @@
namespace UnicaenImport\Form\Factory;
use Zend\Form\FormElementManager as ContainerInterface;
use Interop\Container\ContainerInterface;
use UnicaenImport\Form\TableForm;
/**
* Description of TableFormFactory
*
......@@ -14,22 +12,8 @@ use UnicaenImport\Form\TableForm;
*/
class TableFormFactory
{
/**
* @param ContainerInterface $container
* @param string $requestedName
* @param array|null $options
*
* @return TableForm
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* On quitte le FormElementManager */
$container = $container->getServiceLocator();
$form = new TableForm;
/* Injectez vos dépendances ICI */
return $form;
return new TableForm();
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ namespace UnicaenImport\Form;
use UnicaenImport\Entity\Db\Source;
use Zend\Form\Form;
use Zend\InputFilter\InputFilterProviderInterface;
use Zend\Stdlib\Hydrator\HydratorInterface;
use Zend\Hydrator\HydratorInterface;
/**
......
......@@ -5,7 +5,7 @@ namespace UnicaenImport\Form;
use UnicaenImport\Entity\Db\Table;
use Zend\Form\Form;
use Zend\InputFilter\InputFilterProviderInterface;
use Zend\Stdlib\Hydrator\HydratorInterface;
use Zend\Hydrator\HydratorInterface;
/**
......@@ -47,7 +47,7 @@ class TableForm extends Form implements InputFilterProviderInterface
'id' => 'sync_filtre',
'rows' => '5',
],
'type' => 'TextArea',
'type' => 'Textarea',
]);
$this->add([
......@@ -59,7 +59,7 @@ class TableForm extends Form implements InputFilterProviderInterface
'id' => 'sync_hook_before',
'rows' => '5',
],
'type' => 'TextArea',
'type' => 'Textarea',
]);
$this->add([
......@@ -71,7 +71,7 @@ class TableForm extends Form implements InputFilterProviderInterface
'id' => 'sync_hook_after',
'rows' => '5',
],
'type' => 'TextArea',
'type' => 'Textarea',
]);
$this->add([
......
......@@ -23,7 +23,7 @@ trait SourceFormAwareTrait
*
* @return self
*/
public function setFormSource( SourceForm $formSource )
public function setFormSource(SourceForm $formSource)
{
$this->formSource = $formSource;
......@@ -38,12 +38,8 @@ trait SourceFormAwareTrait
* @return SourceForm
* @throws RuntimeException
*/
public function getFormSource() : SourceForm
public function getFormSource(): SourceForm
{
if ($this->formSource){
return $this->formSource;
}else{
return \Application::$container->get('FormElementManager')->get(SourceForm::class);
}
return $this->formSource;
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@ trait TableFormAwareTrait
*
* @return self
*/
public function setFormTable( TableForm $formTable )
public function setFormTable(TableForm $formTable)
{
$this->formTable = $formTable;
......@@ -38,12 +38,8 @@ trait TableFormAwareTrait
* @return TableForm
* @throws RuntimeException
*/
public function getFormTable() : TableForm
public function getFormTable(): TableForm
{
if ($this->formTable){
return $this->formTable;
}else{
return \Application::$container->get('FormElementManager')->get(TableForm::class);
}
return $this->formTable;
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
namespace UnicaenImport\ORM\Event\Listeners\Factory;
use Interop\Container\ContainerInterface;
use UnicaenImport\Options\ModuleOptions;
use UnicaenImport\ORM\Event\Listeners\EntitySourceInjector;
use Zend\ServiceManager\FactoryInterface;
......@@ -10,18 +11,18 @@ use Zend\ServiceManager\ServiceLocatorInterface;
final class EntitySourceInjectorFactory implements FactoryInterface
{
/**
* Create service
*
* @param ServiceLocatorInterface $serviceLocator
*
* @return EntitySourceInjector
* @deprecated
*/
public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this->__invoke($serviceLocator, '');
}
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$service = new EntitySourceInjector();
$service->setOptionsModule($serviceLocator->get(ModuleOptions::class));
$service->setOptionsModule($container->get(ModuleOptions::class));
return $service;
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
namespace UnicaenImport\Options\Factory;
use UnicaenImport\Options\ModuleOptions;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
/**
......
......@@ -6,7 +6,7 @@ use UnicaenImport\Processus\ImportProcessus;
use UnicaenImport\Service\DifferentielService;
use UnicaenImport\Service\QueryGeneratorService;
use UnicaenImport\Service\TableService;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
/**
......
......@@ -4,7 +4,7 @@ namespace UnicaenImport\Service\Factory;
use UnicaenImport\Service\DifferentielService;
use UnicaenImport\Service\QueryGeneratorService;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
/**
......
......@@ -5,7 +5,7 @@ namespace UnicaenImport\Service\Factory;
use UnicaenImport\Options\ModuleOptions;
use UnicaenImport\Service\QueryGeneratorService;
use UnicaenImport\Service\SchemaService;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
/**
......
......@@ -3,7 +3,7 @@
namespace UnicaenImport\Service\Factory;
use UnicaenImport\Service\SchemaService;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
/**
......
......@@ -2,7 +2,7 @@
namespace UnicaenImport\Service\Factory;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
use UnicaenImport\Service\SourceService;
......
......@@ -3,7 +3,7 @@
namespace UnicaenImport\Service\Factory;
use UnicaenImport\Service\QueryGeneratorService;
use Zend\ServiceManager\ServiceLocatorInterface as ContainerInterface;
use Interop\Container\ContainerInterface;
use UnicaenImport\Service\TableService;
......
......@@ -4,7 +4,7 @@ namespace UnicaenImport\View\Helper\DifferentielLigne\Factory;
use UnicaenImport\Options\ModuleOptions;
use UnicaenImport\View\Helper\DifferentielLigne\DifferentielLigne;
use Zend\View\HelperPluginManager as ContainerInterface;
use Interop\Container\ContainerInterface;
/**
......@@ -24,8 +24,6 @@ class DifferentielLigneViewHelperFactory
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
$container = $container->getServiceLocator();
$viewHelper = new DifferentielLigne();
$viewHelper->setOptionsModule($container->get(ModuleOptions::class));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment