Skip to content

Commit

Permalink
#17 Avoid useless variable generations
Browse files Browse the repository at this point in the history
  • Loading branch information
1stthomas committed Oct 5, 2021
1 parent 037c8cc commit 988267b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Widgets/Table/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ class Factory
*/
public static function createSimple(array $body, array $header = [], array $footer = [])
{
$data = [
RowTypes::HEADER => $header,
RowTypes::BODY => $body,
RowTypes::FOOTER => $footer
];

$model = new ModelSimple($data);

return new Controller($model);
return new Controller((new ModelSimple([
RowTypes::HEADER => $header,
RowTypes::BODY => $body,
RowTypes::FOOTER => $footer
])));
}

}

0 comments on commit 988267b

Please sign in to comment.