Skip to content

Commit

Permalink
fixed typo in passThrough
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudo-Thijn committed Oct 17, 2024
1 parent 315296c commit 2dd6d09
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/schema/Mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
6 changes: 3 additions & 3 deletions lib/Db/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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');
}
Expand Down Expand Up @@ -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,
];
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version0Date20240826193657.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/MappingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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(),
]
);
Expand Down
4 changes: 2 additions & 2 deletions src/entities/mapping/mapping.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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' },
Expand Down
4 changes: 2 additions & 2 deletions src/entities/mapping/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/entities/mapping/mapping.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 2dd6d09

Please sign in to comment.