mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,31 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\DocStoreBundle\DependencyInjection;
|
||||
|
||||
use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
/**
|
||||
* This is the class that loads and manages your bundle configuration
|
||||
* This is the class that loads and manages your bundle configuration.
|
||||
*
|
||||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
|
||||
*/
|
||||
class ChillDocStoreExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$configuration = new Configuration();
|
||||
$config = $this->processConfiguration($configuration, $configs);
|
||||
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
|
||||
$loader->load('services.yaml');
|
||||
$loader->load('services/media.yaml');
|
||||
$loader->load('services/controller.yaml');
|
||||
@@ -41,40 +45,40 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf
|
||||
$this->prependTwig($container);
|
||||
}
|
||||
|
||||
protected function prependAuthorization(ContainerBuilder $container)
|
||||
{
|
||||
$container->prependExtensionConfig('security', [
|
||||
'role_hierarchy' => [
|
||||
PersonDocumentVoter::UPDATE => [PersonDocumentVoter::SEE_DETAILS],
|
||||
PersonDocumentVoter::CREATE => [PersonDocumentVoter::SEE_DETAILS],
|
||||
PersonDocumentVoter::DELETE => [PersonDocumentVoter::SEE_DETAILS],
|
||||
PersonDocumentVoter::SEE_DETAILS => [PersonDocumentVoter::SEE],
|
||||
AccompanyingCourseDocumentVoter::UPDATE => [AccompanyingCourseDocumentVoter::SEE_DETAILS],
|
||||
AccompanyingCourseDocumentVoter::CREATE => [AccompanyingCourseDocumentVoter::SEE_DETAILS],
|
||||
AccompanyingCourseDocumentVoter::DELETE => [AccompanyingCourseDocumentVoter::SEE_DETAILS],
|
||||
AccompanyingCourseDocumentVoter::SEE_DETAILS => [AccompanyingCourseDocumentVoter::SEE],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
protected function prependRoute(ContainerBuilder $container)
|
||||
{
|
||||
//declare routes for task bundle
|
||||
$container->prependExtensionConfig('chill_main', array(
|
||||
'routing' => array(
|
||||
'resources' => array(
|
||||
'@ChillDocStoreBundle/config/routes.yaml',
|
||||
'@ChampsLibresAsyncUploaderBundle/config/routes.yaml'
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
protected function prependAuthorization(ContainerBuilder $container)
|
||||
{
|
||||
$container->prependExtensionConfig('security', array(
|
||||
'role_hierarchy' => array(
|
||||
PersonDocumentVoter::UPDATE => [PersonDocumentVoter::SEE_DETAILS],
|
||||
PersonDocumentVoter::CREATE => [PersonDocumentVoter::SEE_DETAILS],
|
||||
PersonDocumentVoter::DELETE => [PersonDocumentVoter::SEE_DETAILS],
|
||||
PersonDocumentVoter::SEE_DETAILS => [PersonDocumentVoter::SEE],
|
||||
AccompanyingCourseDocumentVoter::UPDATE => [AccompanyingCourseDocumentVoter::SEE_DETAILS],
|
||||
AccompanyingCourseDocumentVoter::CREATE => [AccompanyingCourseDocumentVoter::SEE_DETAILS],
|
||||
AccompanyingCourseDocumentVoter::DELETE => [AccompanyingCourseDocumentVoter::SEE_DETAILS],
|
||||
AccompanyingCourseDocumentVoter::SEE_DETAILS => [AccompanyingCourseDocumentVoter::SEE],
|
||||
)
|
||||
));
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'routing' => [
|
||||
'resources' => [
|
||||
'@ChillDocStoreBundle/config/routes.yaml',
|
||||
'@ChampsLibresAsyncUploaderBundle/config/routes.yaml',
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
protected function prependTwig(ContainerBuilder $container)
|
||||
{
|
||||
$twigConfig = array(
|
||||
'form_themes' => array('@ChillDocStore/Form/fields.html.twig')
|
||||
);
|
||||
$twigConfig = [
|
||||
'form_themes' => ['@ChillDocStore/Form/fields.html.twig'],
|
||||
];
|
||||
$container->prependExtensionConfig('twig', $twigConfig);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user