mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: SA: Fix "...Instantiated class not found..." rules.
SA stands for Static Analysis.
This commit is contained in:
parent
8879734ea2
commit
68a21fcc0a
@ -80,26 +80,11 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
||||
|
||||
-
|
||||
message: "#^Instantiated class Chill\\\\PersonBundle\\\\Controller\\\\BadRequestExceptions not found\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
|
||||
|
||||
-
|
||||
message: "#^Variable method call on mixed\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
|
||||
|
||||
-
|
||||
message: "#^Caught class Chill\\\\PersonBundle\\\\DataFixtures\\\\ORM\\\\Throwable not found\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php
|
||||
|
||||
-
|
||||
message: "#^Instantiated class Chill\\\\PersonBundle\\\\DataFixtures\\\\ORM\\\\Exception not found\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php
|
||||
|
||||
-
|
||||
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
|
||||
count: 1
|
||||
|
@ -105,7 +105,7 @@ class HouseholdMemberController extends ApiController
|
||||
$ids = $request->query->get('persons', []);
|
||||
|
||||
if (0 === count($ids)) {
|
||||
throw new BadRequestExceptions("parameters persons in query ".
|
||||
throw new BadRequestException("parameters persons in query ".
|
||||
"is not an array or empty");
|
||||
}
|
||||
|
||||
|
@ -1,32 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\DataFixtures\ORM;
|
||||
|
||||
use Chill\PersonBundle\Service\Import\SocialWorkMetadata;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use League\Csv\Reader;
|
||||
|
||||
class LoadSocialWorkMetadata extends \Doctrine\Bundle\FixturesBundle\Fixture implements \Doctrine\Common\DataFixtures\OrderedFixtureInterface
|
||||
class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface
|
||||
{
|
||||
private SocialWorkMetadata $importer;
|
||||
|
||||
/**
|
||||
* @param SocialWorkMetadata $importer
|
||||
*/
|
||||
public function __construct(SocialWorkMetadata $importer)
|
||||
{
|
||||
$this->importer = $importer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
try {
|
||||
$csv = Reader::createFromPath(__DIR__.'/data/social_work_metadata.csv');
|
||||
} catch (Throwable $e) {
|
||||
throw new Exception('Error while loading CSV.',0, $e);
|
||||
} catch (\Throwable $e) {
|
||||
throw new \Exception('Error while loading CSV.',0, $e);
|
||||
}
|
||||
|
||||
$csv->setDelimiter(";");
|
||||
@ -34,9 +32,6 @@ class LoadSocialWorkMetadata extends \Doctrine\Bundle\FixturesBundle\Fixture imp
|
||||
$this->importer->import($csv);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getOrder()
|
||||
{
|
||||
return 9500;
|
||||
|
Loading…
x
Reference in New Issue
Block a user