Skip to content

Commit

Permalink
Fix magic access property (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Apr 3, 2024
1 parent 1b2bdaa commit 59a4a24
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeception.yml
Expand Up @@ -40,9 +40,9 @@ jobs:
matrix:
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
pimcore: [ ~11.2.0 ]
include:
- pimcore: ~11.0.0
- pimcore: ~11.2.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ecs.yml
Expand Up @@ -39,9 +39,9 @@ jobs:
matrix:
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
pimcore: [ ~11.2.0 ]
include:
- pimcore: ~11.0.0
- pimcore: ~11.2.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/php-stan.yml
Expand Up @@ -39,9 +39,9 @@ jobs:
matrix:
php: [ 8.2 ]
symfony: [ ^6.2 ]
pimcore: [ ~11.0.0 ]
pimcore: [ ~11.2.0 ]
include:
- pimcore: ~11.0.0
- pimcore: ~11.2.0
template_tag: v11.0.0
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions UPGRADE.md
@@ -1,5 +1,8 @@
# Upgrade Notes

## 5.0.6
- Fix magic property access [#442](https://github.com/dachcom-digital/pimcore-formbuilder/issues/442)

## 5.0.5
- Sort chunked uploaded files before merging

Expand Down
13 changes: 3 additions & 10 deletions src/Form/Data/FormData.php
Expand Up @@ -47,11 +47,8 @@ public function addAttachment(File $attachmentFile): void
public function getFieldValue(string $name): mixed
{
$array = $this->getData();
if (isset($array[$name])) {
return $array[$name];
}

return null;
return $array[$name] ?? null;
}

public function setFieldValue(string $name, $value): void
Expand All @@ -66,13 +63,9 @@ public function __set(string $name, mixed $value)

public function __isset(string $name): bool
{
if (!is_string($name)) {
return false;
}

$data = $this->getData();
$reflectionClass = new \ReflectionClass($this);

return isset($data[$name]);
return !$reflectionClass->hasProperty($name);
}

public function __get(string $name): mixed
Expand Down

0 comments on commit 59a4a24

Please sign in to comment.