@@ -128,7 +128,7 @@ public function __construct($model, ?array $formatters = null, ?string $locale =
128128
129129 // Determine eligible date fields
130130 foreach (['createdField ' , 'updatedField ' , 'deletedField ' ] as $ field ) {
131- if (! empty ($ this ->model ->{$ field })) {
131+ if (isset ($ this ->model ->{$ field })) {
132132 $ this ->dateFields [] = $ this ->model ->{$ field };
133133 }
134134 }
@@ -152,7 +152,7 @@ public static function resetCounts()
152152 */
153153 public static function getCount (string $ table ): int
154154 {
155- return empty (self ::$ tableCounts [$ table ]) ? 0 : self ::$ tableCounts [$ table ];
155+ return ! isset (self ::$ tableCounts [$ table ]) ? 0 : self ::$ tableCounts [$ table ];
156156 }
157157
158158 /**
@@ -282,7 +282,7 @@ protected function detectFormatters(): self
282282 {
283283 $ this ->formatters = [];
284284
285- if (! empty ($ this ->model ->allowedFields )) {
285+ if (isset ($ this ->model ->allowedFields )) {
286286 foreach ($ this ->model ->allowedFields as $ field ) {
287287 $ this ->formatters [$ field ] = $ this ->guessFormatter ($ field );
288288 }
@@ -513,12 +513,12 @@ protected function createMock(?int $count = null)
513513 // Determine which fields we will need
514514 $ fields = [];
515515
516- if (! empty ( $ this ->model ->useTimestamps ) ) {
516+ if ($ this ->model ->useTimestamps ) {
517517 $ fields [$ this ->model ->createdField ] = $ datetime ;
518518 $ fields [$ this ->model ->updatedField ] = $ datetime ;
519519 }
520520
521- if (! empty ( $ this ->model ->useSoftDeletes ) ) {
521+ if ($ this ->model ->useSoftDeletes ) {
522522 $ fields [$ this ->model ->deletedField ] = null ;
523523 }
524524
0 commit comments