Skip to content

Instantly share code, notes, and snippets.

@scmrus
Created February 11, 2020 17:00
Show Gist options
  • Save scmrus/c4d597bee0e1a7952e2432236a98d4fb to your computer and use it in GitHub Desktop.
Save scmrus/c4d597bee0e1a7952e2432236a98d4fb to your computer and use it in GitHub Desktop.
<?php
/**
* @mixin \Illuminate\Support\Collection
*
* @psalm-suppress UndefinedMethod
* @psalm-suppress UndefinedThisPropertyFetch
* @psalm-suppress UndefinedThisPropertyAssignment
*/
class CollectionMixin
{
public function fill()
{
return function ($value) {
/** @var \Illuminate\Support\Collection $this */
return $this->map(fn () => $value);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment