From 2dd6d09d5163100aec4794e58cabff0529a0f252 Mon Sep 17 00:00:00 2001 From: Thijn Date: Thu, 17 Oct 2024 13:53:53 +0200 Subject: [PATCH] fixed typo in passThrough --- docs/schema/Mapping.json | 2 +- lib/Db/Mapping.php | 6 +++--- lib/Migration/Version0Date20240826193657.php | 2 +- lib/Service/MappingService.php | 4 ++-- src/entities/mapping/mapping.mock.ts | 4 ++-- src/entities/mapping/mapping.ts | 4 ++-- src/entities/mapping/mapping.types.ts | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/schema/Mapping.json b/docs/schema/Mapping.json index 44a10204..c36ee06a 100644 --- a/docs/schema/Mapping.json +++ b/docs/schema/Mapping.json @@ -39,7 +39,7 @@ "type": ["array", "null"], "description": "The cast of this mapping object." }, - "passTrough": { + "passThrough": { "type": ["boolean", "null"], "default": true, "description": "The passThrough of this mapping object." diff --git a/lib/Db/Mapping.php b/lib/Db/Mapping.php index d32dcfc8..a6bf62b7 100644 --- a/lib/Db/Mapping.php +++ b/lib/Db/Mapping.php @@ -16,7 +16,7 @@ class Mapping extends Entity implements JsonSerializable protected ?array $mapping = null; protected ?array $unset = null; protected ?array $cast = null; - protected ?bool $passTrough = null; + protected ?bool $passThrough = null; protected ?DateTime $dateCreated = null; protected ?DateTime $dateModified = null; @@ -29,7 +29,7 @@ public function __construct() { $this->addType('mapping', 'json'); $this->addType('unset', 'json'); $this->addType('cast', 'json'); - $this->addType('passTrough', 'boolean'); + $this->addType('passThrough', 'boolean'); $this->addType('dateCreated', 'datetime'); $this->addType('dateModified', 'datetime'); } @@ -76,7 +76,7 @@ public function jsonSerialize(): array 'mapping' => $this->mapping, 'unset' => $this->unset, 'cast' => $this->cast, - 'passTrough' => $this->passTrough, + 'passThrough' => $this->passThrough, 'dateCreated' => isset($this->dateCreated) ? $this->dateCreated->format('c') : null, 'dateModified' => isset($this->dateModified) ? $this->dateModified->format('c') : null, ]; diff --git a/lib/Migration/Version0Date20240826193657.php b/lib/Migration/Version0Date20240826193657.php index 752d7282..e9b4b8fe 100644 --- a/lib/Migration/Version0Date20240826193657.php +++ b/lib/Migration/Version0Date20240826193657.php @@ -102,7 +102,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt $table->addColumn('mapping', Types::TEXT, ['notnull' => false]); $table->addColumn('unset', Types::TEXT, ['notnull' => false]); $table->addColumn('cast', Types::TEXT, ['notnull' => false]); - $table->addColumn('pass_trough', Types::BOOLEAN, ['notnull' => false]); + $table->addColumn('pass_through', Types::BOOLEAN, ['notnull' => false]); $table->addColumn('date_created', Types::DATETIME, ['notnull' => true, 'default' => 'CURRENT_TIMESTAMP']); $table->addColumn('date_modified', Types::DATETIME, ['notnull' => true, 'default' => 'CURRENT_TIMESTAMP']); $table->setPrimaryKey(['id']); diff --git a/lib/Service/MappingService.php b/lib/Service/MappingService.php index 42029020..81dfba85 100644 --- a/lib/Service/MappingService.php +++ b/lib/Service/MappingService.php @@ -107,7 +107,7 @@ public function mapping(Mapping $mappingObject, array $input, bool $list = false // Determine pass trough. // Let's get the dot array based on https://github.com/adbario/php-dot-notation. - if ($mappingObject->getPassTrough()) { + if ($mappingObject->getPassThrough()) { $dotArray = new Dot($input); // @todo: error loging // isset($this->style) === true && $this->style->info('Mapping *with* pass trough'); @@ -188,7 +188,7 @@ public function mapping(Mapping $mappingObject, array $input, bool $list = false [ 'input' => $input, 'output' => $output, - 'passTrough' => $mappingObject->getPassTrough(), + 'passThrough' => $mappingObject->getPassThrough(), 'mapping' => $mappingObject->getMapping(), ] ); diff --git a/src/entities/mapping/mapping.mock.ts b/src/entities/mapping/mapping.mock.ts index e6a84982..c9061795 100644 --- a/src/entities/mapping/mapping.mock.ts +++ b/src/entities/mapping/mapping.mock.ts @@ -12,7 +12,7 @@ export const mockMappingData = (): TMapping[] => [ { source: 'lastName', target: 'family_name' }, { source: 'email', target: 'email_address' }, ], - passTrough: true, + passThrough: true, }, { id: '4c3edd34-a90d-4d2a-8894-adb5836ecde8', @@ -24,7 +24,7 @@ export const mockMappingData = (): TMapping[] => [ { source: 'productPrice', target: 'price' }, { source: 'productDescription', target: 'description' }, ], - passTrough: false, + passThrough: false, unset: ['internal_id', 'created_by'], cast: [ { field: 'price', type: 'float' }, diff --git a/src/entities/mapping/mapping.ts b/src/entities/mapping/mapping.ts index 3a27cb3d..8d48ef3f 100644 --- a/src/entities/mapping/mapping.ts +++ b/src/entities/mapping/mapping.ts @@ -12,7 +12,7 @@ export class Mapping implements TMapping { public mapping: any[] public unset: any[] | null public cast: any[] | null - public passTrough: boolean | null + public passThrough: boolean | null public dateCreated: string | null public dateModified: string | null @@ -25,7 +25,7 @@ export class Mapping implements TMapping { this.mapping = mapping.mapping || [] this.unset = mapping.unset || null this.cast = mapping.cast || null - this.passTrough = mapping.passTrough ?? true + this.passThrough = mapping.passThrough ?? true this.dateCreated = mapping.dateCreated || null this.dateModified = mapping.dateModified || null } diff --git a/src/entities/mapping/mapping.types.ts b/src/entities/mapping/mapping.types.ts index 773cf791..9d8ea328 100644 --- a/src/entities/mapping/mapping.types.ts +++ b/src/entities/mapping/mapping.types.ts @@ -8,7 +8,7 @@ export type TMapping = { mapping: any[] unset?: any[] | null cast?: any[] | null - passTrough?: boolean | null + passThrough?: boolean | null dateCreated?: string | null dateModified?: string | null }