-
-
Notifications
You must be signed in to change notification settings - Fork 406
/
Attribute.stub
53 lines (47 loc) · 1.09 KB
/
Attribute.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Illuminate\Database\Eloquent\Casts;
/**
* @template TGet
* @template TSet
*/
class Attribute
{
/**
* The attribute accessor.
*
* @var callable(): TGet
*/
public $get;
/**
* The attribute mutator.
*
* @var callable(TSet): mixed
*/
public $set;
/**
* Create a new attribute accessor / mutator.
*
* @template TMakeGet
* @template TMakeSet
* @param (callable(mixed, mixed): TMakeGet)|null $get
* @param (callable(TMakeSet, mixed=): mixed)|null $set
* @return Attribute<TMakeGet, TMakeSet>
*/
public static function make(callable $get = null, callable $set = null);
/**
* Create a new attribute accessor.
*
* @template T
* @param callable(mixed, mixed=): T $get
* @return Attribute<T, never>
*/
public static function get(callable $get);
/**
* Create a new attribute mutator.
*
* @template T
* @param callable(T, mixed=): mixed $set
* @return Attribute<never, T>
*/
public static function set(callable $set);
}