apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -33,6 +33,7 @@ use Symfony\Component\Security\Core\Security;
/**
* @internal
*
* @coversNothing
*/
class ActivityACLAwareRepositoryTest extends KernelTestCase
@@ -182,7 +183,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
if (null === $person = $this->entityManager->createQueryBuilder()
->select('p')->from(Person::class, 'p')->setMaxResults(1)
->getQuery()->getSingleResult()) {
throw new \RuntimeException("person not found");
throw new \RuntimeException('person not found');
}
/** @var AccompanyingPeriod $period1 */
@@ -193,7 +194,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->setMaxResults(1)
->getQuery()
->getSingleResult()) {
throw new \RuntimeException("no period found");
throw new \RuntimeException('no period found');
}
/** @var AccompanyingPeriod $period2 */
@@ -206,7 +207,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->setMaxResults(1)
->getQuery()
->getSingleResult()) {
throw new \RuntimeException("no second period found");
throw new \RuntimeException('no second period found');
}
// add a period
$period1->addPerson($person);
@@ -222,7 +223,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->setMaxResults(2)
->getQuery()
->getResult()) {
throw new \RuntimeException("no types");
throw new \RuntimeException('no types');
}
if ([] === $jobs = $this->entityManager
@@ -233,7 +234,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->getQuery()
->getResult()
) {
throw new \RuntimeException("no jobs found");
throw new \RuntimeException('no jobs found');
}
if (null === $user = $this->entityManager
@@ -244,19 +245,19 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->getQuery()
->getSingleResult()
) {
throw new \RuntimeException("no user found");
throw new \RuntimeException('no user found');
}
if ([] === $centers = $this->entityManager->createQueryBuilder()
->select('c')->from(Center::class, 'c')->setMaxResults(2)->getQuery()
->getResult()) {
throw new \RuntimeException("no centers found");
throw new \RuntimeException('no centers found');
}
if ([] === $scopes = $this->entityManager->createQueryBuilder()
->select('s')->from(Scope::class, 's')->setMaxResults(2)->getQuery()
->getResult()) {
throw new \RuntimeException("no scopes found");
throw new \RuntimeException('no scopes found');
}
yield [$person, $user, $centers, $scopes, ActivityVoter::SEE, 0, 5, ['date' => 'DESC'], []];
@@ -279,7 +280,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->setMaxResults(1)
->getQuery()
->getSingleResult()) {
throw new \RuntimeException("no period found");
throw new \RuntimeException('no period found');
}
if ([] === $types = $this->entityManager
@@ -289,7 +290,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->setMaxResults(2)
->getQuery()
->getResult()) {
throw new \RuntimeException("no types");
throw new \RuntimeException('no types');
}
if ([] === $jobs = $this->entityManager
@@ -300,7 +301,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->getQuery()
->getResult()
) {
throw new \RuntimeException("no jobs found");
throw new \RuntimeException('no jobs found');
}
if (null === $user = $this->entityManager
@@ -311,7 +312,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase
->getQuery()
->getSingleResult()
) {
throw new \RuntimeException("no user found");
throw new \RuntimeException('no user found');
}
yield [$period, $user, ActivityVoter::SEE, 0, 10, ['date' => 'DESC'], []];

View File

@@ -20,7 +20,6 @@ use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\EntityManagerInterface;
use phpseclib3\Math\BinaryField;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
@@ -28,6 +27,7 @@ use Symfony\Component\Security\Core\Security;
/**
* @internal
*
* @coversNothing
*/
class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
@@ -104,22 +104,22 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
{
$this->setUp();
if (null === $person = $this->entityManager->createQuery("SELECT p FROM " . Person::class . " p WHERE SIZE(p.accompanyingPeriodParticipations) > 0 ")
if (null === $person = $this->entityManager->createQuery('SELECT p FROM '.Person::class.' p WHERE SIZE(p.accompanyingPeriodParticipations) > 0 ')
->setMaxResults(1)
->getSingleResult()) {
throw new \RuntimeException("no person in dtabase");
throw new \RuntimeException('no person in dtabase');
}
if ([] === $scopes = $this->entityManager->createQuery("SELECT s FROM " . Scope::class . " s ")->setMaxResults(5)->getResult()) {
throw new \RuntimeException("no scopes in database");
if ([] === $scopes = $this->entityManager->createQuery('SELECT s FROM '.Scope::class.' s ')->setMaxResults(5)->getResult()) {
throw new \RuntimeException('no scopes in database');
}
yield [$person, [], true, null, null, null];
yield [$person, $scopes, true, null, null, null];
yield [$person, $scopes, true, new \DateTimeImmutable("1 month ago"), null, null];
yield [$person, $scopes, true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), null];
yield [$person, $scopes, true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), "content"];
yield [$person, $scopes, true, null, new \DateTimeImmutable("1 week ago"), "content"];
yield [$person, [], true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), "content"];
yield [$person, $scopes, true, new \DateTimeImmutable('1 month ago'), null, null];
yield [$person, $scopes, true, new \DateTimeImmutable('1 month ago'), new \DateTimeImmutable('1 week ago'), null];
yield [$person, $scopes, true, new \DateTimeImmutable('1 month ago'), new \DateTimeImmutable('1 week ago'), 'content'];
yield [$person, $scopes, true, null, new \DateTimeImmutable('1 week ago'), 'content'];
yield [$person, [], true, new \DateTimeImmutable('1 month ago'), new \DateTimeImmutable('1 week ago'), 'content'];
}
}