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

Add nested mapping support via new ObjectMap class #97

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

vjik
Copy link
Member

@vjik vjik commented Oct 5, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fix #63

Comment on lines +73 to +76
'body' => new ObjectMap([
'text' => 'textBody',
'html' => 'htmlBody',
]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about constructor, method calls, immutable objects etc.?

use function array_key_exists;

/**
* Class provides mapping object property names to keys in the data array.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Class provides mapping object property names to keys in the data array.
* Class provides a mapping of object property names to keys in the data array.

}

/**
* @psalm-return string|list<string>|ObjectMap|null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need description.

}

/**
* @return string[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need description.

return array_keys($this->map);
}

public function exists(string $name): bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add nested mapping
3 participants