@@ -11,7 +11,7 @@ class ModelHelper
11
11
private $ models = [];
12
12
13
13
/**
14
- * @param \Illuminate\Database\Eloquent\Model|string $model
14
+ * @param \Illuminate\Database\Eloquent\Model|string $model
15
15
*
16
16
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
17
17
*
@@ -25,11 +25,9 @@ public function connection($model): ?string
25
25
}
26
26
27
27
/**
28
- * @param \Illuminate\Database\Eloquent\Model|string $model
28
+ * @param \Illuminate\Database\Eloquent\Model|string $model
29
29
*
30
30
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
31
- *
32
- * @return string
33
31
*/
34
32
public function table ($ model ): string
35
33
{
@@ -39,11 +37,9 @@ public function table($model): string
39
37
}
40
38
41
39
/**
42
- * @param \Illuminate\Database\Eloquent\Model|string $model
40
+ * @param \Illuminate\Database\Eloquent\Model|string $model
43
41
*
44
42
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
45
- *
46
- * @return string
47
43
*/
48
44
public function tableWithConnection ($ model ): string
49
45
{
@@ -56,11 +52,9 @@ public function tableWithConnection($model): string
56
52
}
57
53
58
54
/**
59
- * @param \Illuminate\Database\Eloquent\Model|string $model
55
+ * @param \Illuminate\Database\Eloquent\Model|string $model
60
56
*
61
57
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
62
- *
63
- * @return string
64
58
*/
65
59
public function primaryKey ($ model ): string
66
60
{
@@ -70,11 +64,9 @@ public function primaryKey($model): string
70
64
}
71
65
72
66
/**
73
- * @param \Illuminate\Database\Eloquent\Model|string $model
67
+ * @param \Illuminate\Database\Eloquent\Model|string $model
74
68
*
75
69
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
76
- *
77
- * @return string
78
70
*/
79
71
public function primaryKeyType ($ model ): string
80
72
{
@@ -84,11 +76,9 @@ public function primaryKeyType($model): string
84
76
}
85
77
86
78
/**
87
- * @param \Illuminate\Database\Eloquent\Model|string $model
79
+ * @param \Illuminate\Database\Eloquent\Model|string $model
88
80
*
89
81
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
90
- *
91
- * @return \Illuminate\Database\Eloquent\Builder
92
82
*/
93
83
public function query ($ model ): Builder
94
84
{
@@ -98,21 +88,17 @@ public function query($model): Builder
98
88
}
99
89
100
90
/**
101
- * @param \Illuminate\Database\Eloquent\Model|string $model
102
- *
103
- * @return string
91
+ * @param \Illuminate\Database\Eloquent\Model|string $model
104
92
*/
105
93
public function className ($ model ): string
106
94
{
107
95
return is_string ($ model ) ? $ model : get_class ($ model );
108
96
}
109
97
110
98
/**
111
- * @param \Illuminate\Database\Eloquent\Model|string $model
99
+ * @param \Illuminate\Database\Eloquent\Model|string $model
112
100
*
113
101
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
114
- *
115
- * @return array
116
102
*/
117
103
public function fillable ($ model ): array
118
104
{
@@ -122,12 +108,10 @@ public function fillable($model): array
122
108
}
123
109
124
110
/**
125
- * @param \Illuminate\Database\Eloquent\Model|string $model
126
- * @param \Illuminate\Http\Request $request
111
+ * @param \Illuminate\Database\Eloquent\Model|string $model
112
+ * @param \Illuminate\Http\Request $request
127
113
*
128
114
* @throws \DragonCode\LaravelSupport\Exceptions\IncorrectModelException
129
- *
130
- * @return array
131
115
*/
132
116
public function onlyFillable ($ model , $ request ): array
133
117
{
@@ -137,20 +121,18 @@ public function onlyFillable($model, $request): array
137
121
}
138
122
139
123
/**
140
- * @param \Illuminate\Database\Eloquent\Model|string $model
141
- * @param string[] ...$except
124
+ * @param \Illuminate\Database\Eloquent\Model|string $model
125
+ * @param array< string> ...$except
142
126
*
143
127
* @throws IncorrectModelException
144
- *
145
- * @return array
146
128
*/
147
129
public function exceptFillable ($ model , ...$ except ): array
148
130
{
149
131
return array_diff ($ this ->fillable ($ model ), (array ) $ except );
150
132
}
151
133
152
134
/**
153
- * @param \Illuminate\Database\Eloquent\Model|string $model
135
+ * @param \Illuminate\Database\Eloquent\Model|string $model
154
136
*
155
137
* @throws IncorrectModelException
156
138
*
0 commit comments