change namespaces, removing AMLI

This commit is contained in:
Julie Lenaerts 2022-02-23 11:24:24 +01:00
parent 8f597eb254
commit 35aa05fb97
35 changed files with 89 additions and 89 deletions

View File

@ -9,9 +9,9 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Calculator;
namespace Chill\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
use Chill\BudgetBundle\Entity\AbstractElement;
interface CalculatorInterface
{

View File

@ -9,9 +9,9 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Calculator;
namespace Chill\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
use Chill\BudgetBundle\Entity\AbstractElement;
use OutOfBoundsException;
use function array_key_exists;

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Calculator;
namespace Chill\BudgetBundle\Calculator;
class CalculatorResult
{

View File

@ -9,12 +9,12 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle;
namespace Chill\BudgetBundle;
use Chill\AMLI\BudgetBundle\DependencyInjection\Compiler\CalculatorCompilerPass;
use Chill\BudgetBundle\DependencyInjection\Compiler\CalculatorCompilerPass;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillAMLIBudgetBundle extends Bundle
class ChillBudgetBundle extends Bundle
{
public function build(\Symfony\Component\DependencyInjection\ContainerBuilder $container)
{

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Config;
namespace Chill\BudgetBundle\Config;
class ConfigRepository
{

View File

@ -9,10 +9,10 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Controller;
namespace Chill\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\BudgetBundle\Entity\AbstractElement;
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
@ -139,7 +139,7 @@ abstract class AbstractElementController extends Controller
*/
protected function _new(Person $person, Request $request, $template, $flashMessageOnSuccess)
{
/** @var \Chill\AMLI\BudgetBundle\Entity\AbstractElement $element */
/** @var \Chill\BudgetBundle\Entity\AbstractElement $element */
$element = $this->createNewElement()
->setPerson($person);

View File

@ -9,10 +9,10 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Controller;
namespace Chill\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\Charge;
use Chill\AMLI\BudgetBundle\Form\ChargeType;
use Chill\BudgetBundle\Entity\Charge;
use Chill\BudgetBundle\Form\ChargeType;
use Chill\PersonBundle\Entity\Person;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
@ -32,7 +32,7 @@ class ChargeController extends AbstractElementController
return $this->_delete(
$charge,
$request,
'@ChillAMLIBudget/Charge/confirm_delete.html.twig',
'@ChillBudget/Charge/confirm_delete.html.twig',
'Charge deleted'
);
}
@ -50,7 +50,7 @@ class ChargeController extends AbstractElementController
return $this->_edit(
$charge,
$request,
'@ChillAMLIBudget/Charge/edit.html.twig',
'@ChillBudget/Charge/edit.html.twig',
'Charge updated'
);
}
@ -68,7 +68,7 @@ class ChargeController extends AbstractElementController
return $this->_new(
$person,
$request,
'@ChillAMLIBudget/Charge/new.html.twig',
'@ChillBudget/Charge/new.html.twig',
'Charge created'
);
}
@ -83,7 +83,7 @@ class ChargeController extends AbstractElementController
*/
public function viewAction(Charge $charge)
{
return $this->_view($charge, '@ChillAMLIBudget/Charge/view.html.twig');
return $this->_view($charge, '@ChillBudget/Charge/view.html.twig');
}
protected function createNewElement()

View File

@ -9,12 +9,12 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Controller;
namespace Chill\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Calculator\CalculatorManager;
use Chill\AMLI\BudgetBundle\Entity\Charge;
use Chill\AMLI\BudgetBundle\Entity\Resource;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\BudgetBundle\Calculator\CalculatorManager;
use Chill\BudgetBundle\Entity\Charge;
use Chill\BudgetBundle\Entity\Resource;
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\PersonBundle\Entity\Person;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
@ -92,7 +92,7 @@ class ElementController extends Controller
$results = $this->calculator->calculateDefault($elements);
}
return $this->render('ChillAMLIBudgetBundle:Element:index.html.twig', [
return $this->render('ChillBudgetBundle:Element:index.html.twig', [
'person' => $person,
'charges' => $charges,
'resources' => $ressources,

View File

@ -9,10 +9,10 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Controller;
namespace Chill\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\Resource;
use Chill\AMLI\BudgetBundle\Form\ResourceType;
use Chill\BudgetBundle\Entity\Resource;
use Chill\BudgetBundle\Form\ResourceType;
use Chill\PersonBundle\Entity\Person;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
@ -32,7 +32,7 @@ class ResourceController extends AbstractElementController
return $this->_delete(
$resource,
$request,
'@ChillAMLIBudget/Resource/confirm_delete.html.twig',
'@ChillBudget/Resource/confirm_delete.html.twig',
'Resource deleted'
);
}
@ -50,7 +50,7 @@ class ResourceController extends AbstractElementController
return $this->_edit(
$resource,
$request,
'@ChillAMLIBudget/Resource/edit.html.twig',
'@ChillBudget/Resource/edit.html.twig',
'Resource updated'
);
}
@ -68,7 +68,7 @@ class ResourceController extends AbstractElementController
return $this->_new(
$person,
$request,
'@ChillAMLIBudget/Resource/new.html.twig',
'@ChillBudget/Resource/new.html.twig',
'Resource created'
);
}
@ -83,7 +83,7 @@ class ResourceController extends AbstractElementController
*/
public function viewAction(Resource $resource)
{
return $this->_view($resource, '@ChillAMLIBudget/Resource/view.html.twig');
return $this->_view($resource, '@ChillBudget/Resource/view.html.twig');
}
protected function createNewElement()

View File

@ -9,9 +9,9 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\DependencyInjection;
namespace Chill\BudgetBundle\DependencyInjection;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
@ -23,11 +23,11 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
*/
class ChillAMLIBudgetExtension extends Extension implements PrependExtensionInterface
class ChillBudgetExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
@ -58,7 +58,7 @@ class ChillAMLIBudgetExtension extends Extension implements PrependExtensionInte
$container->prependExtensionConfig('chill_main', [
'routing' => [
'resources' => [
'@ChillAMLIBudgetBundle/config/routing.yaml',
'@ChillBudgetBundle/config/routing.yaml',
],
],
]);

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\DependencyInjection\Compiler;
namespace Chill\BudgetBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -19,7 +19,7 @@ class CalculatorCompilerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
$manager = $container->getDefinition('Chill\AMLI\BudgetBundle\Calculator\CalculatorManager');
$manager = $container->getDefinition('Chill\BudgetBundle\Calculator\CalculatorManager');
foreach ($container->findTaggedServiceIds('chill_budget.calculator') as $id => $tags) {
foreach ($tags as $tag) {

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\DependencyInjection;
namespace Chill\BudgetBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
@ -23,8 +23,8 @@ class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('chill_amli_budget');
$rootNode = $treeBuilder->getRootNode('chill_amli_budget');
$treeBuilder = new TreeBuilder('chill_budget');
$rootNode = $treeBuilder->getRootNode('chill_budget');
$rootNode
->children()

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Entity;
namespace Chill\BudgetBundle\Entity;
use Chill\PersonBundle\Entity\Person;
use DateTime;

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Entity;
namespace Chill\BudgetBundle\Entity;
use Chill\MainBundle\Entity\HasCenterInterface;
use DateTimeImmutable;
@ -19,7 +19,7 @@ use Doctrine\ORM\Mapping as ORM;
* Charge.
*
* @ORM\Table(name="chill_budget.charge")
* @ORM\Entity(repositoryClass="Chill\AMLI\BudgetBundle\Repository\ChargeRepository")
* @ORM\Entity(repositoryClass="Chill\BudgetBundle\Repository\ChargeRepository")
*/
class Charge extends AbstractElement implements HasCenterInterface
{

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Entity;
namespace Chill\BudgetBundle\Entity;
use Chill\MainBundle\Entity\HasCenterInterface;
use DateTimeImmutable;
@ -19,7 +19,7 @@ use Doctrine\ORM\Mapping as ORM;
* Resource.
*
* @ORM\Table(name="chill_budget.resource")
* @ORM\Entity(repositoryClass="Chill\AMLI\BudgetBundle\Repository\ResourceRepository")
* @ORM\Entity(repositoryClass="Chill\BudgetBundle\Repository\ResourceRepository")
*/
class Resource extends AbstractElement implements HasCenterInterface
{

View File

@ -9,10 +9,10 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Form;
namespace Chill\BudgetBundle\Form;
use Chill\AMLI\BudgetBundle\Config\ConfigRepository;
use Chill\AMLI\BudgetBundle\Entity\Charge;
use Chill\BudgetBundle\Config\ConfigRepository;
use Chill\BudgetBundle\Entity\Charge;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Symfony\Component\Form\AbstractType;
@ -96,7 +96,7 @@ class ChargeType extends AbstractType
public function getBlockPrefix()
{
return 'chill_amli_budgetbundle_charge';
return 'chill_budgetbundle_charge';
}
private function getTypes()

View File

@ -9,10 +9,10 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Form;
namespace Chill\BudgetBundle\Form;
use Chill\AMLI\BudgetBundle\Config\ConfigRepository;
use Chill\AMLI\BudgetBundle\Entity\Resource;
use Chill\BudgetBundle\Config\ConfigRepository;
use Chill\BudgetBundle\Entity\Resource;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Symfony\Component\Form\AbstractType;
@ -80,7 +80,7 @@ class ResourceType extends AbstractType
public function getBlockPrefix()
{
return 'chill_amli_budgetbundle_resource';
return 'chill_budgetbundle_resource';
}
private function getTypes()

View File

@ -9,9 +9,9 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Menu;
namespace Chill\BudgetBundle\Menu;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Repository;
namespace Chill\BudgetBundle\Repository;
use Chill\PersonBundle\Entity\Person;
use DateTime;

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Repository;
namespace Chill\BudgetBundle\Repository;
use Chill\PersonBundle\Entity\Person;
use DateTime;

View File

@ -43,7 +43,7 @@
{{ 'Back to the list'|trans }}
</a>
</li>
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
<li>
<a href="{{ path('chill_budget_charge_edit', { 'id': element.id } ) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
</li>

View File

@ -66,17 +66,17 @@
</td>
<td>
<ul class="record_actions">
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::SHOW'), f) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::SHOW'), f) %}
<li>
<a href="{{ path('chill_budget_' ~ family ~ '_view', { 'id': f.id } ) }}" class="btn btn-show"></a>
</li>
{% endif %}
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), f) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), f) %}
<li>
<a href="{{ path('chill_budget_' ~ family ~'_edit', { 'id': f.id } ) }}" class="btn btn-edit"></a>
</li>
{% endif %}
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::DELETE'), f) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::DELETE'), f) %}
<li>
<a href="{{ path('chill_budget_' ~ family ~ '_delete', { 'id': f.id } ) }}" class="btn btn-delete"></a>
</li>
@ -112,9 +112,9 @@
<tr>
<td>{{ result.label }}</td>
<td>
{% if result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_CURRENCY') %}
{% if result.type == constant('CHILL\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_CURRENCY') %}
{{ result.result|format_currency('EUR') }}
{% elseif result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_PERCENTAGE') %}
{% elseif result.type == constant('CHILL\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_PERCENTAGE') %}
{{ result.result|round(2, 'ceil') ~ '%' }}
{% else %}
{{ result.result|round(2, 'common') }}
@ -158,7 +158,7 @@
{{ m.table_results(results) }}
{% endif %}
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
<ul class="record_actions">
<li>
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
@ -212,7 +212,7 @@
{% endif %}
{% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %}
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
<ul class="record_actions">
<li>
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>

View File

@ -43,7 +43,7 @@
{{ 'Back to the list'|trans }}
</a>
</li>
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
<li>
<a href="{{ path('chill_budget_resource_edit', { 'id': element.id } ) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
</li>

View File

@ -9,9 +9,9 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Security\Authorization;
namespace Chill\BudgetBundle\Security\Authorization;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
use Chill\BudgetBundle\Entity\AbstractElement;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;

View File

@ -9,9 +9,9 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Templating;
namespace Chill\BudgetBundle\Templating;
use Chill\AMLI\BudgetBundle\Config\ConfigRepository;
use Chill\BudgetBundle\Config\ConfigRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\AMLI\BudgetBundle\Tests\Controller;
namespace Chill\BudgetBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

View File

@ -6,7 +6,7 @@
"keywords" : ["chill", "social work"],
"homepage" : "https://framagit.org/Chill-project/BudgetBundle",
"autoload": {
"psr-4": { "Chill\\AMLI\\BudgetBundle\\": "" }
"psr-4": { "Chill\\BudgetBundle\\": "" }
},
"autoload-dev": {
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]

View File

@ -1,3 +1,3 @@
chill_amli_budget_controllers:
resource: "@ChillAMLIBudgetBundle/Controller"
chill_budget_controllers:
resource: "@ChillBudgetBundle/Controller"
type: annotation

View File

@ -1,2 +1,2 @@
services:
Chill\AMLI\BudgetBundle\Calculator\CalculatorManager: ~
Chill\BudgetBundle\Calculator\CalculatorManager: ~

View File

@ -1,5 +1,5 @@
services:
Chill\AMLI\BudgetBundle\Config\ConfigRepository:
Chill\BudgetBundle\Config\ConfigRepository:
arguments:
$resources: '%chill_budget.resources%'
$charges: '%chill_budget.charges%'

View File

@ -1,5 +1,5 @@
services:
Chill\AMLI\BudgetBundle\Controller\:
Chill\BudgetBundle\Controller\:
autowire: true
resource: '../../Controller'
tags: ['controller.service_arguments']

View File

@ -1,14 +1,14 @@
services:
Chill\AMLI\BudgetBundle\Form\ResourceType:
Chill\BudgetBundle\Form\ResourceType:
arguments:
$configRepository: '@Chill\AMLI\BudgetBundle\Config\ConfigRepository'
$configRepository: '@Chill\BudgetBundle\Config\ConfigRepository'
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
tags:
- { name: 'form.type' }
Chill\AMLI\BudgetBundle\Form\ChargeType:
Chill\BudgetBundle\Form\ChargeType:
arguments:
$configRepository: '@Chill\AMLI\BudgetBundle\Config\ConfigRepository'
$configRepository: '@Chill\BudgetBundle\Config\ConfigRepository'
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
tags:
- { name: 'form.type' }

View File

@ -1,5 +1,5 @@
services:
Chill\AMLI\BudgetBundle\Menu\UserMenuBuilder:
Chill\BudgetBundle\Menu\UserMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'

View File

@ -1,5 +1,5 @@
services:
Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter:
Chill\BudgetBundle\Security\Authorization\BudgetElementVoter:
arguments:
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
tags:

View File

@ -1,7 +1,7 @@
services:
Chill\AMLI\BudgetBundle\Templating\Twig:
Chill\BudgetBundle\Templating\Twig:
arguments:
$configRepository: '@Chill\AMLI\BudgetBundle\Config\ConfigRepository'
$configRepository: '@Chill\BudgetBundle\Config\ConfigRepository'
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
tags:
- { name: 'twig.extension' }