phpstan, rector, cs-fixer

This commit is contained in:
Mathieu Jaumotte 2023-09-25 11:50:54 +02:00
parent fc919e9547
commit 6665a443b9
10 changed files with 62 additions and 4 deletions

View File

@ -279,7 +279,7 @@ class User implements UserInterface, \Stringable
) )
); );
$scopes = $this->scopeHistories->matching($criteria); $scopes = $this->scopeHistories->matching($criteria)->getIterator();
if ($scopes->count() > 0) { if ($scopes->count() > 0) {
return $scopes->first()->getScope(); return $scopes->first()->getScope();
@ -328,7 +328,7 @@ class User implements UserInterface, \Stringable
) )
); );
$jobs = $this->jobHistories->matching($criteria); $jobs = $this->jobHistories->matching($criteria)->getIterator();
if ($jobs->count() > 0) { if ($jobs->count() > 0) {
return $jobs->first()->getJob(); return $jobs->first()->getJob();

View File

@ -11,7 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Repository\User; namespace Chill\MainBundle\Repository\User;
use App\Entity\UserJobHistory; use Chill\MainBundle\Entity\User\UserJobHistory;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException; use Doctrine\ORM\ORMException;

View File

@ -11,7 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Repository\User; namespace Chill\MainBundle\Repository\User;
use App\Entity\UserScopeHistory; use Chill\MainBundle\Entity\User\UserScopeHistory;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException; use Doctrine\ORM\ORMException;

View File

@ -17,6 +17,10 @@ use Chill\MainBundle\Entity\UserJob;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\PhpUnit\ProphecyTrait;
/**
* @internal
* @coversNothing
*/
class UserTest extends TestCase class UserTest extends TestCase
{ {
use ProphecyTrait; use ProphecyTrait;

View File

@ -1,5 +1,14 @@
<?php <?php
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 App; namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;

View File

@ -1,5 +1,14 @@
<?php <?php
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.
*/
use Symfony\Component\Dotenv\Dotenv; use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/../../vendor/autoload.php'; require dirname(__DIR__).'/../../vendor/autoload.php';

View File

@ -1,5 +1,14 @@
<?php <?php
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.
*/
return [ return [
ChampsLibres\AsyncUploaderBundle\ChampsLibresAsyncUploaderBundle::class => ['all' => true], ChampsLibres\AsyncUploaderBundle\ChampsLibresAsyncUploaderBundle::class => ['all' => true],
Chill\ActivityBundle\ChillActivityBundle::class => ['all' => true], Chill\ActivityBundle\ChillActivityBundle::class => ['all' => true],

View File

@ -1,5 +1,14 @@
<?php <?php
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.
*/
if (file_exists(dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php')) { if (file_exists(dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php'; require dirname(__DIR__).'/var/cache/prod/srcApp_KernelProdContainer.preload.php';
} }

View File

@ -1,5 +1,14 @@
<?php <?php
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.
*/
use Symfony\Component\Dotenv\Dotenv; use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/vendor/autoload.php'; require dirname(__DIR__).'/vendor/autoload.php';

View File

@ -1,5 +1,14 @@
<?php <?php
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.
*/
use App\Kernel; use App\Kernel;
require __DIR__ . '/bootstrap.php'; require __DIR__ . '/bootstrap.php';