Skip to content

Commit

Permalink
Create instance of ArrayParser directly (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Jan 9, 2024
1 parent d590faa commit 02a2a87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Bug #316, #6: Support table view constraints (@Tigrov)
- Enh #324: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
- Enh #303: Support composite types (@Tigrov)
- Enh #330: Create instance of `ArrayParser` directly (@Tigrov)

## 1.2.0 November 12, 2023

Expand Down
10 changes: 1 addition & 9 deletions src/ColumnSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function phpTypecast(mixed $value): mixed
{
if ($this->dimension > 0) {
if (is_string($value)) {
$value = $this->getArrayParser()->parse($value);
$value = (new ArrayParser())->parse($value);
}

if (!is_array($value)) {
Expand Down Expand Up @@ -239,14 +239,6 @@ private function phpTypecastComposite(mixed $value): array|null
return $fields;
}

/**
* Creates instance of ArrayParser.
*/
private function getArrayParser(): ArrayParser
{
return new ArrayParser();
}

/**
* @return int Get the dimension of the array.
*
Expand Down

0 comments on commit 02a2a87

Please sign in to comment.