1 | <?php |
||
54 | class PlanFeature extends Model implements Sortable |
||
55 | { |
||
56 | use HasSlug; |
||
57 | use SoftDeletes; |
||
58 | use BelongsToPlan; |
||
59 | use SortableTrait; |
||
60 | use HasTranslations; |
||
61 | use ValidatingTrait; |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | protected $fillable = [ |
||
67 | 'plan_id', |
||
68 | 'slug', |
||
69 | 'name', |
||
70 | 'description', |
||
71 | 'value', |
||
72 | 'resettable_period', |
||
73 | 'resettable_interval', |
||
74 | 'sort_order', |
||
75 | ]; |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | protected $casts = [ |
||
81 | 'plan_id' => 'integer', |
||
82 | 'slug' => 'string', |
||
83 | 'value' => 'string', |
||
84 | 'resettable_period' => 'integer', |
||
85 | 'resettable_interval' => 'string', |
||
86 | 'sort_order' => 'integer', |
||
87 | 'deleted_at' => 'datetime', |
||
88 | ]; |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | protected $observables = [ |
||
94 | 'validating', |
||
95 | 'validated', |
||
96 | ]; |
||
97 | |||
98 | /** |
||
99 | * The attributes that are translatable. |
||
100 | * |
||
101 | * @var array |
||
102 | */ |
||
103 | public $translatable = [ |
||
104 | 'name', |
||
105 | 'description', |
||
106 | ]; |
||
107 | |||
108 | /** |
||
109 | * The sortable settings. |
||
110 | * |
||
111 | * @var array |
||
112 | */ |
||
113 | public $sortable = [ |
||
114 | 'order_column_name' => 'sort_order', |
||
115 | ]; |
||
116 | |||
117 | /** |
||
118 | * The default rules that the model will validate against. |
||
119 | * |
||
120 | * @var array |
||
121 | */ |
||
122 | protected $rules = []; |
||
123 | |||
124 | /** |
||
125 | * Whether the model should throw a |
||
126 | * ValidationException if it fails validation. |
||
127 | * |
||
128 | * @var bool |
||
129 | */ |
||
130 | protected $throwValidationExceptions = true; |
||
131 | |||
132 | /** |
||
133 | * Create a new Eloquent model instance. |
||
134 | * |
||
135 | * @param array $attributes |
||
136 | */ |
||
137 | public function __construct(array $attributes = []) |
||
153 | |||
154 | /** |
||
155 | * Get the options for generating the slug. |
||
156 | * |
||
157 | * @return \Spatie\Sluggable\SlugOptions |
||
158 | */ |
||
159 | public function getSlugOptions(): SlugOptions |
||
166 | |||
167 | /** |
||
168 | * The plan feature may have many subscription usage. |
||
169 | * |
||
170 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
171 | */ |
||
172 | public function usage(): HasMany |
||
176 | |||
177 | /** |
||
178 | * Get feature's reset date. |
||
179 | * |
||
180 | * @param string $dateFrom |
||
|
|||
181 | * |
||
182 | * @return \Carbon\Carbon |
||
183 | */ |
||
184 | public function getResetDate(Carbon $dateFrom): Carbon |
||
190 | } |
||
191 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.