Commit 2391b82a authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Passage à unicaen/db-import 7.1.0

parent b4010ca6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11527,11 +11527,11 @@
        },
        {
            "name": "unicaen/db-import",
            "version": "7.0.0",
            "version": "7.1.0",
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/db-import.git",
                "reference": "8f568b023e50145be5e1ad372e4b1780d37c1c90"
                "reference": "68705cbf0f6df4e9f9660835864a7f9cece5d4a2"
            },
            "require": {
                "beberlei/assert": "^3.3",
@@ -11565,7 +11565,7 @@
                }
            },
            "description": "Module d'import entre bases de données",
            "time": "2023-03-17T14:34:52+00:00"
            "time": "2024-12-04T12:45:30+00:00"
        },
        {
            "name": "unicaen/etat",
+12 −6
Original line number Diff line number Diff line
@@ -50,10 +50,17 @@ class PrefixEtabColumnValueFilter extends AbstractColumnValueFilter
        parent::setParams($params);
    }

    public function filter($value)
    public function filter($value): array
    {
        if ($value === null) {
            return null;
        if (!is_array($value)) {
            throw new InvalidArgumentException("Les données reçues ne sont pas un tableau");
        }
        if (!array_key_exists($this->column, $value)) {
            throw new InvalidArgumentException("La colonne '$this->column' est introuvable dans les données reçues");
        }

        if ($value[$this->column] === null) {
            return $value;
        }

        if ($this->codeEtablissement === null) {
@@ -63,9 +70,8 @@ class PrefixEtabColumnValueFilter extends AbstractColumnValueFilter
            ));
        }

        if (in_array($this->columnName, $this->columns)) {
            $value = $this->sourceCodeStringHelper->addPrefixTo($value, $this->codeEtablissement);
        }
        $value[$this->column] =
            $this->sourceCodeStringHelper->addPrefixTo($value[$this->column], $this->codeEtablissement);

        return $value;
    }