DX: fix phpstan errors

This commit is contained in:
2023-02-07 23:49:56 +01:00
parent f57555dab4
commit 8ccce12e54
13 changed files with 21 additions and 201 deletions

View File

@@ -283,8 +283,7 @@ final class ImportPeopleFromCSVCommand extends Command
$openingDateString = trim($row[array_search('opening_date', $headers, true)]);
$openingDate = $this->processDate($openingDateString, $this->input->getOption('opening_date_format'));
// @TODO: Fix the constructor parameter, $openingDate does not exists.
$person = $openingDate instanceof DateTime ? new Person($openingDate) : new Person();
$person = new Person();
// add the center
$center = $this->getCenter($row, $headers);
@@ -377,6 +376,7 @@ final class ImportPeopleFromCSVCommand extends Command
$address->setPostcode($postalCode);
if (in_array('street1', $headers, true)) {
/** @phpstan-ignore-next-line as this command is deprecated */
$address->setStreetAddress1($street1Value);
}
$address->setValidFrom(new DateTime('today'));
@@ -1024,7 +1024,6 @@ final class ImportPeopleFromCSVCommand extends Command
foreach ($possibleFormats as $format) {
$this->logger->debug("Trying format {$format}", [__METHOD__]);
/** @phpstan-ignore-next-line */
$dateR = strptime($value, $format);
if (is_array($dateR) && '' === $dateR['unparsed']) {