[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types

This commit is contained in:
Hugo Sales 2021-10-10 09:26:18 +01:00 committed by Diogo Peralta Cordeiro
parent 028ea79fff
commit 2694d83ae4
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
5 changed files with 13 additions and 31 deletions

View File

@ -81,6 +81,11 @@ class Security extends Controller
* @param Authenticator $authenticator
*
* @return null|array|Response
* @throws EmailTakenException
* @throws NicknameTakenException
* @throws ServerException
* @throws DuplicateFoundException
* @throws EmailTakenException
* @throws NicknameEmptyException
* @throws NicknameInvalidException
* @throws NicknameNotAllowedException

View File

@ -34,6 +34,7 @@ declare(strict_types = 1);
namespace App\DependencyInjection\Compiler;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver;
use Exception;
use Functional as F;
@ -91,11 +92,9 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface
/**
* Fill in the database $metadata for $class_name
*
* @param string $class_name
* @param ClassMetadataInfo $metadata
* @param ClassMetadataInfo $metadata ClassMetadataInfo is the real type, but we need to override the method
*/
public function loadMetadataForClass($class_name, $metadata)
public function loadMetadataForClass($class_name, ClassMetadata $metadata)
{
$schema = $class_name::schemaDef();
@ -211,12 +210,8 @@ class SchemaDefDriver extends StaticPHPDriver implements CompilerPassInterface
* Override StaticPHPDriver's method,
* we care about classes that have the method `schemaDef`,
* instead of `loadMetadata`.
*
* @param string $class_name
*
* @return bool
*/
public function isTransient($class_name)
public function isTransient($class_name): bool
{
return !method_exists($class_name, 'schemaDef');
}

View File

@ -40,10 +40,6 @@ class ActorArrayTransformer extends ArrayTransformer
{
/**
* Transforms array of Actors into string of nicknames
*
* @param array $a
*
* @return string
*/
public function transform($a)
{
@ -57,10 +53,6 @@ class ActorArrayTransformer extends ArrayTransformer
/**
* Transforms string of nicknames into Actors
*
* @param string $s
*
* @return array
*/
public function reverseTransform($s)
{

View File

@ -40,11 +40,6 @@ class ArrayTransformer implements DataTransformerInterface
{
// Can't use type annotations, to conform to interface
/**
* @param array $a
*
* @return string
*/
public function transform($a)
{
if (!\is_array($a)) {
@ -53,11 +48,6 @@ class ArrayTransformer implements DataTransformerInterface
return Formatting::toString($a, Formatting::SPLIT_BY_SPACE);
}
/**
* @param string $s
*
* @return array
*/
public function reverseTransform($s)
{
if (empty($s)) {