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

API Stop using deprecated API #74

Merged
Merged
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
8 changes: 8 additions & 0 deletions src/Collections/MemoryConfigCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,16 @@ public function update($class, $name, $value)
return $this;
}

/**
* @param string $class
* @param string $name
* @param array $value - non-array values are @deprecated 1.12.0
*/
public function merge($class, $name, $value)
{
if (!is_array($value)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I've added this to validate work where config calls to deprecated ->update() was changed to ->set() (non-array values) and ->merge() (array values). It makes sense add a strong typing to merge() in CMS5

Deprecation::notice('1.12.0', 'Use set() if $value is not an array instead');
}
// Detect mergeable config
$existing = $this->get($class, $name, true);
if (is_array($value) && is_array($existing)) {
Expand Down