Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symfony 7.0 DataTransformerInterface typing support DataTransformers #192

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Form/DataTransformer/EntitiesToPropertyTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(ObjectManager $em, $class, $textProperty = null, $pr
* @param mixed $entities
* @return array
*/
public function transform($entities)
public function transform(mixed $entities): mixed
{
if (empty($entities)) {
return array();
Expand Down Expand Up @@ -87,7 +87,7 @@ public function transform($entities)
* @param array $values
* @return array
*/
public function reverseTransform($values)
public function reverseTransform(mixed $values): mixed
{
if (!is_array($values) || empty($values)) {
return array();
Expand Down
4 changes: 2 additions & 2 deletions Form/DataTransformer/EntityToPropertyTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(ObjectManager $em, $class, $textProperty = null, $pr
* @param mixed $entity
* @return array
*/
public function transform($entity)
public function transform(mixed $entity): mixed
{
$data = array();
if (empty($entity)) {
Expand Down Expand Up @@ -85,7 +85,7 @@ public function transform($entity)
* @param string $value
* @return mixed|null|object
*/
public function reverseTransform($value)
public function reverseTransform(mixed $value): mixed
{
if (empty($value)) {
return null;
Expand Down