Reformat code

master
Julien Rosset 1 year ago
parent 0e494bb3f1
commit 412dc1360a

@ -5,7 +5,6 @@ namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class Kernel extends BaseKernel class Kernel extends BaseKernel {
{
use MicroKernelTrait; use MicroKernelTrait;
} }

@ -14,15 +14,12 @@ use Doctrine\Persistence\ManagerRegistry;
* @method Document[] findAll() * @method Document[] findAll()
* @method Document[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @method Document[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/ */
class DocumentRepository extends ServiceEntityRepository class DocumentRepository extends ServiceEntityRepository {
{ public function __construct (ManagerRegistry $registry) {
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Document::class); parent::__construct($registry, Document::class);
} }
public function save(Document $entity, bool $flush = false): void public function save (Document $entity, bool $flush = false): void {
{
$this->getEntityManager()->persist($entity); $this->getEntityManager()->persist($entity);
if ($flush) { if ($flush) {
@ -30,8 +27,7 @@ class DocumentRepository extends ServiceEntityRepository
} }
} }
public function remove(Document $entity, bool $flush = false): void public function remove (Document $entity, bool $flush = false): void {
{
$this->getEntityManager()->remove($entity); $this->getEntityManager()->remove($entity);
if ($flush) { if ($flush) {
@ -39,28 +35,28 @@ class DocumentRepository extends ServiceEntityRepository
} }
} }
// /** // /**
// * @return Document[] Returns an array of Document objects // * @return Document[] Returns an array of Document objects
// */ // */
// public function findByExampleField($value): array // public function findByExampleField($value): array
// { // {
// return $this->createQueryBuilder('d') // return $this->createQueryBuilder('d')
// ->andWhere('d.exampleField = :val') // ->andWhere('d.exampleField = :val')
// ->setParameter('val', $value) // ->setParameter('val', $value)
// ->orderBy('d.id', 'ASC') // ->orderBy('d.id', 'ASC')
// ->setMaxResults(10) // ->setMaxResults(10)
// ->getQuery() // ->getQuery()
// ->getResult() // ->getResult()
// ; // ;
// } // }
// public function findOneBySomeField($value): ?Document // public function findOneBySomeField($value): ?Document
// { // {
// return $this->createQueryBuilder('d') // return $this->createQueryBuilder('d')
// ->andWhere('d.exampleField = :val') // ->andWhere('d.exampleField = :val')
// ->setParameter('val', $value) // ->setParameter('val', $value)
// ->getQuery() // ->getQuery()
// ->getOneOrNullResult() // ->getOneOrNullResult()
// ; // ;
// } // }
} }

@ -14,15 +14,12 @@ use Doctrine\Persistence\ManagerRegistry;
* @method Tag[] findAll() * @method Tag[] findAll()
* @method Tag[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @method Tag[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/ */
class TagRepository extends ServiceEntityRepository class TagRepository extends ServiceEntityRepository {
{ public function __construct (ManagerRegistry $registry) {
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Tag::class); parent::__construct($registry, Tag::class);
} }
public function save(Tag $entity, bool $flush = false): void public function save (Tag $entity, bool $flush = false): void {
{
$this->getEntityManager()->persist($entity); $this->getEntityManager()->persist($entity);
if ($flush) { if ($flush) {
@ -30,8 +27,7 @@ class TagRepository extends ServiceEntityRepository
} }
} }
public function remove(Tag $entity, bool $flush = false): void public function remove (Tag $entity, bool $flush = false): void {
{
$this->getEntityManager()->remove($entity); $this->getEntityManager()->remove($entity);
if ($flush) { if ($flush) {
@ -39,28 +35,28 @@ class TagRepository extends ServiceEntityRepository
} }
} }
// /** // /**
// * @return Tag[] Returns an array of Tag objects // * @return Tag[] Returns an array of Tag objects
// */ // */
// public function findByExampleField($value): array // public function findByExampleField($value): array
// { // {
// return $this->createQueryBuilder('t') // return $this->createQueryBuilder('t')
// ->andWhere('t.exampleField = :val') // ->andWhere('t.exampleField = :val')
// ->setParameter('val', $value) // ->setParameter('val', $value)
// ->orderBy('t.id', 'ASC') // ->orderBy('t.id', 'ASC')
// ->setMaxResults(10) // ->setMaxResults(10)
// ->getQuery() // ->getQuery()
// ->getResult() // ->getResult()
// ; // ;
// } // }
// public function findOneBySomeField($value): ?Tag // public function findOneBySomeField($value): ?Tag
// { // {
// return $this->createQueryBuilder('t') // return $this->createQueryBuilder('t')
// ->andWhere('t.exampleField = :val') // ->andWhere('t.exampleField = :val')
// ->setParameter('val', $value) // ->setParameter('val', $value)
// ->getQuery() // ->getQuery()
// ->getOneOrNullResult() // ->getOneOrNullResult()
// ; // ;
// } // }
} }

@ -17,15 +17,12 @@ use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
* @method User[] findAll() * @method User[] findAll()
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) * @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/ */
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface {
{ public function __construct (ManagerRegistry $registry) {
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, User::class); parent::__construct($registry, User::class);
} }
public function save(User $entity, bool $flush = false): void public function save (User $entity, bool $flush = false): void {
{
$this->getEntityManager()->persist($entity); $this->getEntityManager()->persist($entity);
if ($flush) { if ($flush) {
@ -33,8 +30,7 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
} }
} }
public function remove(User $entity, bool $flush = false): void public function remove (User $entity, bool $flush = false): void {
{
$this->getEntityManager()->remove($entity); $this->getEntityManager()->remove($entity);
if ($flush) { if ($flush) {
@ -45,8 +41,7 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
/** /**
* Used to upgrade (rehash) the user's password automatically over time. * Used to upgrade (rehash) the user's password automatically over time.
*/ */
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void public function upgradePassword (PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void {
{
if (!$user instanceof User) { if (!$user instanceof User) {
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user)));
} }
@ -56,28 +51,28 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
$this->save($user, true); $this->save($user, true);
} }
// /** // /**
// * @return User[] Returns an array of User objects // * @return User[] Returns an array of User objects
// */ // */
// public function findByExampleField($value): array // public function findByExampleField($value): array
// { // {
// return $this->createQueryBuilder('u') // return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val') // ->andWhere('u.exampleField = :val')
// ->setParameter('val', $value) // ->setParameter('val', $value)
// ->orderBy('u.id', 'ASC') // ->orderBy('u.id', 'ASC')
// ->setMaxResults(10) // ->setMaxResults(10)
// ->getQuery() // ->getQuery()
// ->getResult() // ->getResult()
// ; // ;
// } // }
// public function findOneBySomeField($value): ?User // public function findOneBySomeField($value): ?User
// { // {
// return $this->createQueryBuilder('u') // return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val') // ->andWhere('u.exampleField = :val')
// ->setParameter('val', $value) // ->setParameter('val', $value)
// ->getQuery() // ->getQuery()
// ->getOneOrNullResult() // ->getOneOrNullResult()
// ; // ;
// } // }
} }

Loading…
Cancel
Save