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

Table must be specified with table key in defaults #819

Merged
merged 6 commits into from
Dec 29, 2020
Merged
Changes from 1 commit
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
13 changes: 2 additions & 11 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ class Model implements \IteratorAggregate
* - type hinting will work;
* - you can specify string for a table
*
* @param Persistence|array $persistence
* @param string|array $defaults
* @param Persistence|array $persistence
* @param array<string, mixed> $defaults
*/
public function __construct($persistence = null, $defaults = [])
{
Expand All @@ -336,15 +336,6 @@ public function __construct($persistence = null, $defaults = [])
$persistence = null;
}

if (is_string($defaults)) {
$defaults = ['table' => $defaults];
}

if (isset($defaults[0])) {
$defaults['table'] = $defaults[0];
unset($defaults[0]);
}

$this->setDefaults($defaults);

if ($persistence) {
Expand Down