DX: fix phpstan issues

This commit is contained in:
2023-03-28 22:32:08 +02:00
parent 331443ae12
commit 48772efd54
27 changed files with 76 additions and 1309 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Export;
use Doctrine\ORM\NativeQuery;
use Doctrine\ORM\QueryBuilder;
/**
@@ -23,6 +24,7 @@ use Doctrine\ORM\QueryBuilder;
* aggregation, use `ListInterface`.
*
* @example Chill\PersonBundle\Export\CountPerson an example of implementation
* @template Q of QueryBuilder|NativeQuery
*/
interface ExportInterface extends ExportElementInterface
{
@@ -84,7 +86,7 @@ interface ExportInterface extends ExportElementInterface
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
* @param mixed $data The data from the export's form (as defined in `buildForm`)
*
* @return pure-callable(null|string|int|float|'_header' $value):string|int|\DateTimeInterface where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
* @return callable(null|string|int|float|'_header' $value): string|int|\DateTimeInterface where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
*/
public function getLabels($key, array $values, $data);
@@ -102,7 +104,7 @@ interface ExportInterface extends ExportElementInterface
/**
* Return the results of the query builder.
*
* @param \Doctrine\ORM\NativeQuery|QueryBuilder $query
* @param Q $query
* @param mixed[] $data the data from the export's fomr (added by self::buildForm)
*
* @return mixed[] an array of results
@@ -132,7 +134,7 @@ interface ExportInterface extends ExportElementInterface
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
* @param array $data the data from the form, if any
*
* @return \Doctrine\ORM\NativeQuery|QueryBuilder the query to execute.
* @return Q the query to execute.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []);