Skip to content

Commit

Permalink
Merge pull request #125 from coopTilleuls/fix/cs
Browse files Browse the repository at this point in the history
Fix: CS
  • Loading branch information
vincentchalamon committed Jun 7, 2023
2 parents 5aed784 + 40b3e19 commit 8f780f5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Manager/Bridge/DoctrineManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public function findOneBy($class, array $criteria)

public function persist($object): void
{
$manager = $this->registry->getManagerForClass(\get_class($object));
$manager = $this->registry->getManagerForClass($object::class);
$manager->persist($object);
$manager->flush();
}

public function remove($object): void
{
$manager = $this->registry->getManagerForClass(\get_class($object));
$manager = $this->registry->getManagerForClass($object::class);
$manager->remove($object);
$manager->flush();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Manager/ForgotPasswordManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(
$this->providerChain = $providerChain;
}

public function resetPassword($propertyName, $value, ?ProviderInterface $provider = null): void
public function resetPassword($propertyName, $value, ProviderInterface $provider = null): void
{
/* @var null|Provider $provider */
if (!$provider) {
Expand Down Expand Up @@ -88,7 +88,7 @@ public function resetPassword($propertyName, $value, ?ProviderInterface $provide
*
* @return bool
*/
public function updatePassword(AbstractPasswordToken $passwordToken, $password, ?ProviderInterface $provider = null)
public function updatePassword(AbstractPasswordToken $passwordToken, $password, ProviderInterface $provider = null)
{
/* @var null|Provider $provider */
if (!$provider) {
Expand Down
6 changes: 3 additions & 3 deletions src/Manager/PasswordTokenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(ProviderChainInterface $providerChain)
/**
* @return AbstractPasswordToken
*/
public function createPasswordToken($user, \DateTime $expiresAt = null, ?ProviderInterface $provider = null)
public function createPasswordToken($user, \DateTime $expiresAt = null, ProviderInterface $provider = null)
{
/* @var Provider $provider */
if (!$provider) {
Expand Down Expand Up @@ -76,7 +76,7 @@ public function createPasswordToken($user, \DateTime $expiresAt = null, ?Provide
*
* @return AbstractPasswordToken
*/
public function findOneByToken($token, ?ProviderInterface $provider = null)
public function findOneByToken($token, ProviderInterface $provider = null)
{
/* @var null|Provider $provider */
if (!$provider) {
Expand All @@ -90,7 +90,7 @@ public function findOneByToken($token, ?ProviderInterface $provider = null)
/**
* @return AbstractPasswordToken
*/
public function findOneByUser($user, ?ProviderInterface $provider = null)
public function findOneByUser($user, ProviderInterface $provider = null)
{
/* @var null|Provider $provider */
if (!$provider) {
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/ProviderChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(iterable $providers)
/**
* Returns a provider by its name, without name the default provider is returned.
*/
public function get(?string $name = null): ProviderInterface
public function get(string $name = null): ProviderInterface
{
if (null === $name) {
return $this->getDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/ProviderChainInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

interface ProviderChainInterface
{
public function get(?string $name = null): ProviderInterface;
public function get(string $name = null): ProviderInterface;

/**
* @return array<string, ProviderInterface>
Expand Down
8 changes: 4 additions & 4 deletions tests/EventListener/ExceptionEventListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ public function testOnKernelException(): void
$eventMock->setResponse(
Argument::that(
function ($response) {
return $response instanceof JsonResponse &&
json_encode(
return $response instanceof JsonResponse
&& json_encode(
['message' => 'Parameter "foo" is missing.'],
15
) === $response->getContent() &&
400 === $response->getStatusCode();
) === $response->getContent()
&& 400 === $response->getStatusCode();
}
)
)->shouldBeCalledOnce();
Expand Down
2 changes: 1 addition & 1 deletion tests/ProphecyTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ trait ProphecyTrait
*
* @psalm-param class-string|null $classOrInterface
*/
protected function prophesize(?string $classOrInterface = null): ObjectProphecy
protected function prophesize(string $classOrInterface = null): ObjectProphecy
{
if (\is_string($classOrInterface)) {
\assert($this instanceof TestCase);
Expand Down

0 comments on commit 8f780f5

Please sign in to comment.