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:
parent
2911e027e9
commit
45ab483e66
|
@ -28,9 +28,10 @@ final class TalkExtension extends AbstractExtension
|
||||||
*/
|
*/
|
||||||
public function getLastEventDate($talk): ?string
|
public function getLastEventDate($talk): ?string
|
||||||
{
|
{
|
||||||
$events = new Collection($talk['events']);
|
return Collection::make($talk['events'])
|
||||||
|
->pluck('date')
|
||||||
return $events->pluck('date')->sort()->last();
|
->sort()
|
||||||
|
->last();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue