adrema/tests/Lib/MergesAttributes.php

20 lines
362 B
PHP
Raw Permalink Normal View History

2022-08-12 22:07:59 +02:00
<?php
namespace Tests\Lib;
trait MergesAttributes
{
abstract public function defaults();
public function attributes(?array $overwrites = []): array
{
$defaults = collect($this->defaults());
foreach ($overwrites as $key => $value) {
$defaults->put($key, $value);
}
return $defaults->toArray();
}
}