cs: Switch to a stricter way of coding - this might break in a lot of places.

This commit is contained in:
Pol Dellaiera
2021-11-30 13:33:18 +01:00
parent 28d2c42454
commit 47c5855a21
957 changed files with 9025 additions and 568 deletions

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Calculator;
class CalculatorResult

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle;
use Chill\AMLI\BudgetBundle\DependencyInjection\Compiler\CalculatorCompilerPass;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Config;
class ConfigRepository

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\Charge;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Calculator\CalculatorManager;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\Resource;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\DependencyInjection;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Entity;
use Chill\PersonBundle\Entity\Person;
@@ -136,7 +145,7 @@ abstract class AbstractElement
public function isEmpty()
{
return 0 == $this->amount;
return 0 === $this->amount;
}
abstract public function isResource(): bool;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Entity;
use Chill\MainBundle\Entity\HasCenterInterface;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Entity;
use Chill\MainBundle\Entity\HasCenterInterface;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Menu;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Repository;
use Chill\PersonBundle\Entity\Person;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Repository;
use Chill\PersonBundle\Entity\Person;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Security\Authorization;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
@@ -62,8 +71,8 @@ class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierar
protected function supports($attribute, $subject)
{
return (in_array($attribute, self::ROLES) && $subject instanceof AbstractElement)
|| ($subject instanceof Person && in_array($attribute, [self::SHOW, self::CREATE]));
return (in_array($attribute, self::ROLES, true) && $subject instanceof AbstractElement)
|| ($subject instanceof Person && in_array($attribute, [self::SHOW, self::CREATE], true));
}
protected function voteOnAttribute($attribute, $subject, \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token)

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Templating;
use Chill\AMLI\BudgetBundle\Config\ConfigRepository;

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* 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\AMLI\BudgetBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@@ -15,18 +24,18 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal
* @coversNothing
*/
class ElementControllerTest extends WebTestCase
final class ElementControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$client = self::createClient();
$crawler = $client->request('GET', '/index');
}
public function testList()
{
$client = static::createClient();
$client = self::createClient();
$crawler = $client->request('GET', '/list');
}