merge add-module-emploi into testing

This commit is contained in:
2024-05-15 15:19:24 +02:00
1392 changed files with 21326 additions and 12043 deletions

View File

@@ -17,16 +17,15 @@ use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Export\ListInterface;
use PhpParser\Node;
use Rector\Core\Rector\AbstractRector;
use Rector\Rector\AbstractRector;
use Rector\Symfony\NodeAnalyzer\ClassAnalyzer;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends AbstractRector
final class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends AbstractRector
{
public function __construct(
private readonly ClassAnalyzer $classAnalyzer,
) {
}
private ClassAnalyzer $classAnalyzer,
) {}
public function getRuleDefinition(): RuleDefinition
{

View File

@@ -0,0 +1,96 @@
<?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 Chill\Utils\Rector\Rector;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Chill\Utils\Rector\Tests\ChillBundleMakeDataProviderStaticForAbstractFilterTest\ChillBundleMakeDataProviderStaticForAbstractFilterTestRectorTest;
use PhpParser\Node;
use Rector\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see ChillBundleMakeDataProviderStaticForAbstractFilterTestRectorTest
*/
final class ChillBundleMakeDataProviderStaticForAbstractAggregatorTestRector extends AbstractRector
{
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Make static each method which provide data on AbstractAggregatorTest',
[
new CodeSample('', ''),
]
);
}
public function getNodeTypes(): array
{
return [Node\Stmt\Class_::class];
}
public function refactor(Node $node)
{
if (!$node instanceof Node\Stmt\Class_) {
return null;
}
if (null === $node->extends) {
return null;
}
if (AbstractAggregatorTest::class !== $node->extends->toString()) {
return null;
}
$new = [];
$matched = false;
foreach ($node->stmts as $k => $stmt) {
if (!$stmt instanceof Node\Stmt\ClassMethod) {
$new[] = $stmt;
continue;
}
if ('getFormData' === $stmt->name->name || 'getQueryBuilders' === $stmt->name->name) {
if ($stmt->isStatic()) {
$new[] = $stmt;
continue;
}
$matched = true;
$method = new Node\Stmt\ClassMethod($stmt->name->name);
$method->flags = Node\Stmt\Class_::MODIFIER_PUBLIC | Node\Stmt\Class_::MODIFIER_STATIC;
$method->returnType = match ($stmt->name->name) {
'getFormData' => new Node\Identifier('array'),
'getQueryBuilders' => new Node\Identifier('iterable'),
};
foreach ($stmt->getStmts() as $s) {
$method->stmts[] = $s;
}
$new[] = $method;
} else {
$new[] = $stmt;
}
}
if (!$matched) {
return null;
}
$node->stmts = $new;
return $node;
}
}

View File

@@ -0,0 +1,100 @@
<?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 Chill\Utils\Rector\Rector;
use Chill\MainBundle\Test\Export\AbstractExportTest;
use Chill\Utils\Rector\Tests\ChillBundleMakeDataProviderStaticForAbstractExportTestRectorTest\ChillBundleMakeDataProviderStaticForAbstractExportTestRectorTest;
use PhpParser\Node;
use Rector\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* Class ChillBundleMakeDataProviderStaticForAbstractExportTestRector.
*
* This class is responsible for making each method that provides data on AbstractExportTest static.
*
* @see ChillBundleMakeDataProviderStaticForAbstractExportTestRectorTest for testing
*/
final class ChillBundleMakeDataProviderStaticForAbstractExportTestRector extends AbstractRector
{
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Make static each method which provide data on AbstractExportTest',
[
new CodeSample('', ''),
]
);
}
public function getNodeTypes(): array
{
return [Node\Stmt\Class_::class];
}
public function refactor(Node $node)
{
if (!$node instanceof Node\Stmt\Class_) {
return null;
}
if (null === $node->extends) {
return null;
}
if (AbstractExportTest::class !== $node->extends->toString()) {
return null;
}
$new = [];
$matched = false;
foreach ($node->stmts as $k => $stmt) {
if (!$stmt instanceof Node\Stmt\ClassMethod) {
$new[] = $stmt;
continue;
}
if ('getFormData' === $stmt->name->name || 'getModifiersCombination' === $stmt->name->name) {
if ($stmt->isStatic()) {
$new[] = $stmt;
continue;
}
$matched = true;
$method = new Node\Stmt\ClassMethod($stmt->name->name);
$method->flags = Node\Stmt\Class_::MODIFIER_PUBLIC | Node\Stmt\Class_::MODIFIER_STATIC;
$method->returnType = match ($stmt->name->name) {
'getFormData' => new Node\Identifier('array'),
'getModifiersCombination' => new Node\Identifier('array'),
};
foreach ($stmt->getStmts() as $s) {
$method->stmts[] = $s;
}
$new[] = $method;
} else {
$new[] = $stmt;
}
}
if (!$matched) {
return null;
}
$node->stmts = $new;
return $node;
}
}

View File

@@ -0,0 +1,96 @@
<?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 Chill\Utils\Rector\Rector;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\Utils\Rector\Tests\ChillBundleMakeDataProviderStaticForAbstractFilterTest\ChillBundleMakeDataProviderStaticForAbstractFilterTestRectorTest;
use PhpParser\Node;
use Rector\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see ChillBundleMakeDataProviderStaticForAbstractFilterTestRectorTest
*/
final class ChillBundleMakeDataProviderStaticForAbstractFilterTestRector extends AbstractRector
{
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Make static each method which provide data',
[
new CodeSample('', ''),
]
);
}
public function getNodeTypes(): array
{
return [Node\Stmt\Class_::class];
}
public function refactor(Node $node)
{
if (!$node instanceof Node\Stmt\Class_) {
return null;
}
if (null === $node->extends) {
return null;
}
if (AbstractFilterTest::class !== $node->extends->toString()) {
return null;
}
$new = [];
$matched = false;
foreach ($node->stmts as $k => $stmt) {
if (!$stmt instanceof Node\Stmt\ClassMethod) {
$new[] = $stmt;
continue;
}
if ('getFormData' === $stmt->name->name || 'getQueryBuilders' === $stmt->name->name) {
if ($stmt->isStatic()) {
$new[] = $stmt;
continue;
}
$matched = true;
$method = new Node\Stmt\ClassMethod($stmt->name->name);
$method->flags = Node\Stmt\Class_::MODIFIER_PUBLIC | Node\Stmt\Class_::MODIFIER_STATIC;
$method->returnType = match ($stmt->name->name) {
'getFormData' => new Node\Identifier('array'),
'getQueryBuilders' => new Node\Identifier('iterable'),
};
foreach ($stmt->getStmts() as $s) {
$method->stmts[] = $s;
}
$new[] = $method;
} else {
$new[] = $stmt;
}
}
if (!$matched) {
return null;
}
$node->stmts = $new;
return $node;
}
}

View File

@@ -28,7 +28,7 @@ class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRectorTest extends Ab
$this->doTestFile($file);
}
public function provideData(): \Iterator
public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__.'/Fixture');
}

View File

@@ -0,0 +1,40 @@
<?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 Chill\Utils\Rector\Tests\ChillBundleMakeDataProviderStaticForAbstractAggregatorTestRectorTest;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @internal
*
* @coversNothing
*/
class ChillBundleMakeDataProviderStaticForAbstractAggregatorTestRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData
*/
public function test(string $file): void
{
$this->doTestFile($file);
}
public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__.'/Fixture');
}
public function provideConfigFilePath(): string
{
return __DIR__.'/config/config.php';
}
}

View File

@@ -0,0 +1,54 @@
<?php
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ClosingDateAggregator;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
*
* @coversNothing
*/
class ClosingDateAggregatorTest extends AbstractAggregatorTest
{
private static ClosingDateAggregator $closingDateAggregator;
private static EntityManagerInterface $entityManager;
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::bootKernel();
self::$closingDateAggregator = self::getContainer()->get(ClosingDateAggregator::class);
self::$entityManager = self::getContainer()->get(EntityManagerInterface::class);
}
public function getAggregator()
{
return self::$closingDateAggregator;
}
public static function getFormData(): array
{
yield ['frequency' => 'YYYY'];
yield ['frequency' => 'YYYY-MM'];
yield ['frequency' => 'YYYY-IV'];
}
public static function getQueryBuilders(): iterable
{
self::bootKernel();
self::$entityManager = self::getContainer()->get(EntityManagerInterface::class);
$data = [
self::$entityManager->createQueryBuilder()
->select('count(acp.id)')
->from(AccompanyingPeriod::class, 'acp'),
];
self::ensureKernelShutdown();
return $data;
}
}

View File

@@ -0,0 +1,112 @@
<?php
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ClosingDateAggregator;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
*
* @coversNothing
*/
class ClosingDateAggregatorTest extends AbstractAggregatorTest
{
private static ClosingDateAggregator $closingDateAggregator;
private static EntityManagerInterface $entityManager;
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::bootKernel();
self::$closingDateAggregator = self::getContainer()->get(ClosingDateAggregator::class);
self::$entityManager = self::getContainer()->get(EntityManagerInterface::class);
}
public function getAggregator()
{
return self::$closingDateAggregator;
}
public function getFormData()
{
yield ['frequency' => 'YYYY'];
yield ['frequency' => 'YYYY-MM'];
yield ['frequency' => 'YYYY-IV'];
}
public function getQueryBuilders()
{
self::bootKernel();
self::$entityManager = self::getContainer()->get(EntityManagerInterface::class);
$data = [
self::$entityManager->createQueryBuilder()
->select('count(acp.id)')
->from(AccompanyingPeriod::class, 'acp'),
];
self::ensureKernelShutdown();
return $data;
}
}
-----
<?php
namespace Chill\PersonBundle\Tests\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators\ClosingDateAggregator;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
*
* @coversNothing
*/
class ClosingDateAggregatorTest extends AbstractAggregatorTest
{
private static ClosingDateAggregator $closingDateAggregator;
private static EntityManagerInterface $entityManager;
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();
self::bootKernel();
self::$closingDateAggregator = self::getContainer()->get(ClosingDateAggregator::class);
self::$entityManager = self::getContainer()->get(EntityManagerInterface::class);
}
public function getAggregator()
{
return self::$closingDateAggregator;
}
public static function getFormData(): array
{
yield ['frequency' => 'YYYY'];
yield ['frequency' => 'YYYY-MM'];
yield ['frequency' => 'YYYY-IV'];
}
public static function getQueryBuilders(): iterable
{
self::bootKernel();
self::$entityManager = self::getContainer()->get(EntityManagerInterface::class);
$data = [
self::$entityManager->createQueryBuilder()
->select('count(acp.id)')
->from(AccompanyingPeriod::class, 'acp'),
];
self::ensureKernelShutdown();
return $data;
}
}

View File

@@ -0,0 +1,5 @@
<?php
class MyException extends \RuntimeException
{
}

View File

@@ -0,0 +1,14 @@
<?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 static function (Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->rule(Chill\Utils\Rector\Rector\ChillBundleMakeDataProviderStaticForAbstractAggregatorTestRector::class);
};

View File

@@ -0,0 +1,40 @@
<?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 Chill\Utils\Rector\Tests\ChillBundleMakeDataProviderStaticForAbstractExportTestRectorTest;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @internal
*
* @coversNothing
*/
class ChillBundleMakeDataProviderStaticForAbstractExportTestRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData
*/
public function test(string $file): void
{
$this->doTestFile($file);
}
public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__.'/Fixture');
}
public function provideConfigFilePath(): string
{
return __DIR__.'/config/config.php';
}
}

View File

@@ -0,0 +1,51 @@
<?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 Chill\PersonBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest;
use Chill\PersonBundle\Export\Export\CountPerson;
use Chill\PersonBundle\Repository\PersonRepository;
/**
* Test CountPerson export.
*
* @internal
*
* @coversNothing
*/
final class CountPersonTest extends AbstractExportTest
{
protected function setUp(): void
{
self::bootKernel();
}
public function getExport()
{
$personRepository = self::getContainer()->get(PersonRepository::class);
yield new CountPerson($personRepository, $this->getParameters(true));
yield new CountPerson($personRepository, $this->getParameters(false));
}
public static function getFormData(): array
{
return [
[],
];
}
public static function getModifiersCombination(): array
{
return [['person']];
}
}

View File

@@ -0,0 +1,103 @@
<?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 Chill\PersonBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest;
use Chill\PersonBundle\Export\Export\CountPerson;
use Chill\PersonBundle\Repository\PersonRepository;
/**
* Test CountPerson export.
*
* @internal
*
* @coversNothing
*/
final class CountPersonTest extends AbstractExportTest
{
protected function setUp(): void
{
self::bootKernel();
}
public function getExport()
{
$personRepository = self::getContainer()->get(PersonRepository::class);
yield new CountPerson($personRepository, $this->getParameters(true));
yield new CountPerson($personRepository, $this->getParameters(false));
}
public function getFormData()
{
return [
[],
];
}
public function getModifiersCombination()
{
return [['person']];
}
}
-----
<?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 Chill\PersonBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest;
use Chill\PersonBundle\Export\Export\CountPerson;
use Chill\PersonBundle\Repository\PersonRepository;
/**
* Test CountPerson export.
*
* @internal
*
* @coversNothing
*/
final class CountPersonTest extends AbstractExportTest
{
protected function setUp(): void
{
self::bootKernel();
}
public function getExport()
{
$personRepository = self::getContainer()->get(PersonRepository::class);
yield new CountPerson($personRepository, $this->getParameters(true));
yield new CountPerson($personRepository, $this->getParameters(false));
}
public static function getFormData(): array
{
return [
[],
];
}
public static function getModifiersCombination(): array
{
return [['person']];
}
}

View File

@@ -0,0 +1,5 @@
<?php
class MyException extends \RuntimeException
{
}

View File

@@ -0,0 +1,5 @@
<?php
final readonly class MyClass {
}

View File

@@ -0,0 +1,14 @@
<?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 static function (Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->rule(Chill\Utils\Rector\Rector\ChillBundleMakeDataProviderStaticForAbstractExportTestRector::class);
};

View File

@@ -0,0 +1,40 @@
<?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 Chill\Utils\Rector\Tests\ChillBundleMakeDataProviderStaticForAbstractFilterTest;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
/**
* @internal
*
* @coversNothing
*/
class ChillBundleMakeDataProviderStaticForAbstractFilterTestRectorTest extends AbstractRectorTestCase
{
/**
* @dataProvider provideData
*/
public function test(string $file): void
{
$this->doTestFile($file);
}
public static function provideData(): \Iterator
{
return self::yieldFilesFromDirectory(__DIR__.'/Fixture');
}
public function provideConfigFilePath(): string
{
return __DIR__.'/config/config.php';
}
}

View File

@@ -0,0 +1,132 @@
<?php
declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Filter\AccompanyingCourseFilters;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\ReferrerFilter;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
*
* @coversNothing
*/
final class ReferrerFilterTest extends AbstractFilterTest
{
private string $property;
public function getFilter()
{
return $this->filter;
}
public function getFormData(): array
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(User::class, 'u')
->select('u')
->getQuery()
->setMaxResults(1)
->getResult();
$data = [];
foreach ($array as $u) {
$data[] = ['accepted_referrers' => $u, 'date_calc' => new RollingDate(RollingDate::T_TODAY)];
}
return $data;
}
public function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->from(AccompanyingPeriod::class, 'acp')
->select('acp.id');
$qb = $em->createQueryBuilder();
$qb
->from(AccompanyingPeriod\AccompanyingPeriodWork::class, 'acpw')
->join('acpw.accompanyingPeriod', 'acp')
->join('acp.participations', 'acppart')
->join('acppart.person', 'person');
$qb->select('COUNT(DISTINCT acpw.id) as export_result');
yield $qb;
}
}
-----
<?php
declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Filter\AccompanyingCourseFilters;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\ReferrerFilter;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
*
* @coversNothing
*/
final class ReferrerFilterTest extends AbstractFilterTest
{
private string $property;
public function getFilter()
{
return $this->filter;
}
public static function getFormData(): array
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(User::class, 'u')
->select('u')
->getQuery()
->setMaxResults(1)
->getResult();
$data = [];
foreach ($array as $u) {
$data[] = ['accepted_referrers' => $u, 'date_calc' => new RollingDate(RollingDate::T_TODAY)];
}
return $data;
}
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->from(AccompanyingPeriod::class, 'acp')
->select('acp.id');
$qb = $em->createQueryBuilder();
$qb
->from(AccompanyingPeriod\AccompanyingPeriodWork::class, 'acpw')
->join('acpw.accompanyingPeriod', 'acp')
->join('acp.participations', 'acppart')
->join('acppart.person', 'person');
$qb->select('COUNT(DISTINCT acpw.id) as export_result');
yield $qb;
}
}

View File

@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
namespace Chill\PersonBundle\Tests\Export\Filter\AccompanyingCourseFilters;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters\ReferrerFilter;
use Doctrine\ORM\EntityManagerInterface;
/**
* @internal
*
* @coversNothing
*/
final class ReferrerFilterTest extends AbstractFilterTest
{
public function getFilter()
{
return $this->filter;
}
public static function getFormData(): array
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder()
->from(User::class, 'u')
->select('u')
->getQuery()
->setMaxResults(1)
->getResult();
$data = [];
foreach ($array as $u) {
$data[] = ['accepted_referrers' => $u, 'date_calc' => new RollingDate(RollingDate::T_TODAY)];
}
return $data;
}
public static function getQueryBuilders(): iterable
{
self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
yield $em->createQueryBuilder()
->from(AccompanyingPeriod::class, 'acp')
->select('acp.id');
$qb = $em->createQueryBuilder();
$qb
->from(AccompanyingPeriod\AccompanyingPeriodWork::class, 'acpw')
->join('acpw.accompanyingPeriod', 'acp')
->join('acp.participations', 'acppart')
->join('acppart.person', 'person');
$qb->select('COUNT(DISTINCT acpw.id) as export_result');
yield $qb;
}
}

View File

@@ -0,0 +1,5 @@
<?php
class MyException extends \RuntimeException
{
}

View File

@@ -0,0 +1,5 @@
<?php
final readonly class MyClass {
}

View File

@@ -0,0 +1,14 @@
<?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 static function (Rector\Config\RectorConfig $rectorConfig): void {
$rectorConfig->rule(Chill\Utils\Rector\Rector\ChillBundleMakeDataProviderStaticForAbstractFilterTestRector::class);
};