[TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types
This commit is contained in:
parent
028ea79fff
commit
2694d83ae4
@ -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
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user