Skip to content

Commit dab1fc6

Browse files
committed
fix php cs
1 parent cfa2180 commit dab1fc6

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

src/Translatable/Translatable.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,30 @@ public function fill(array $attributes)
119119
$this->fill($values);
120120

121121
unset($attributes[$key]);
122+
122123
continue;
123124
}
125+
124126
if (
125127
$this->getLocalesHelper()->has($key)
126128
&& is_array($values)
127129
) {
128130
$this->getTranslationOrNew($key)->fill($values);
131+
129132
unset($attributes[$key]);
130-
} else {
131-
[$attribute, $locale] = $this->getAttributeAndLocale($key);
132133

133-
if (
134-
$this->getLocalesHelper()->has($locale)
135-
&& $this->isTranslationAttribute($attribute)
136-
) {
137-
$this->getTranslationOrNew($locale)->fill([$attribute => $values]);
138-
unset($attributes[$key]);
139-
}
134+
continue;
135+
}
136+
137+
[$attribute, $locale] = $this->getAttributeAndLocale($key);
138+
139+
if (
140+
$this->getLocalesHelper()->has($locale)
141+
&& $this->isTranslationAttribute($attribute)
142+
) {
143+
$this->getTranslationOrNew($locale)->fill([$attribute => $values]);
144+
145+
unset($attributes[$key]);
140146
}
141147
}
142148

tests/TranslatableTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ public function it_creates_translations_using_wrapped_mass_assignment_and_locale
265265

266266
Vegetable::reguard();
267267

268-
self::assertEquals(5, $vegetable->quantity);
269-
self::assertEquals('Peas', $vegetable->translate('en')->name);
270-
self::assertEquals('Pois', $vegetable->translate('fr')->name);
268+
Assert::assertSame(5, $vegetable->quantity);
269+
Assert::assertSame('Peas', $vegetable->translate('en')->name);
270+
Assert::assertSame('Pois', $vegetable->translate('fr')->name);
271271

272272
$vegetable = Vegetable::first();
273-
self::assertEquals('Peas', $vegetable->translate('en')->name);
274-
self::assertEquals('Pois', $vegetable->translate('fr')->name);
273+
Assert::assertSame('Peas', $vegetable->translate('en')->name);
274+
Assert::assertSame('Pois', $vegetable->translate('fr')->name);
275275
}
276276

277277
#[Test]

0 commit comments

Comments
 (0)