refactor: use the Collection::make() method

Use the `Collection::make()` method and move the subsequent methods onto
their own lines for readability.
This commit is contained in:
Oliver Davies 2021-11-09 17:35:29 +00:00
parent 2911e027e9
commit 45ab483e66

View file

@ -28,9 +28,10 @@ final class TalkExtension extends AbstractExtension
*/
public function getLastEventDate($talk): ?string
{
$events = new Collection($talk['events']);
return $events->pluck('date')->sort()->last();
return Collection::make($talk['events'])
->pluck('date')
->sort()
->last();
}
/**