Skip to content

Commit

Permalink
fix sintattici
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed Nov 22, 2023
1 parent 9f7e6e5 commit fcb01c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/app/AggregateBooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function getPrintableUpdaterAttribute()
}

if ($last_updater) {
return _i('Ultima Modifica: <br class="d-block d-md-none">%s - %s', $last_update->format('d/m/Y'), $last_updater->printableName());
return _i('Ultima Modifica: <br class="d-block d-md-none">%s - %s', [$last_update->format('d/m/Y'), $last_updater->printableName()]);
}
else {
return '';
Expand Down
6 changes: 3 additions & 3 deletions code/app/Models/Concerns/TracksUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function updater(): BelongsTo
public function getPrintableUpdaterAttribute(): string
{
if ($this->updater) {
return _i('Ultima Modifica: <br class="d-block d-md-none">%s - %s', $this->updated_at->format('d/m/Y'), $this->updater->printableName());
return _i('Ultima Modifica: <br class="d-block d-md-none">%s - %s', [$this->updated_at->format('d/m/Y'), $this->updater->printableName()]);
}
else {
return '';
Expand All @@ -36,7 +36,7 @@ private static function updateUser($model): void

protected static function initTrackingEvents(): void
{
static::creating(fn($model) => static::updateUser($model));
static::updating(fn($model) => static::updateUser($model));
static::creating(fn($model) => self::updateUser($model));
static::updating(fn($model) => self::updateUser($model));
}
}
8 changes: 5 additions & 3 deletions code/tests/Services/ModifiersServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ public function testThresholdUnitPrice()
$thresholds = [20, 10, 0];
$threshold_prices = [0.9, 0.92, 0.94];

foreach ($modifiers as $mod) {
if ($mod->id == 'sconto') {
$mod = $product->modifiers()->where('modifier_type_id', $mod->id)->first();
foreach ($modifiers as $modifier_type) {
if ($modifier_type->id == 'sconto') {
$mod = $product->modifiers()->where('modifier_type_id', $modifier_type->id)->first();
$this->services['modifiers']->update($mod->id, [
'value' => 'price',
'arithmetic' => 'apply',
Expand All @@ -129,6 +129,8 @@ public function testThresholdUnitPrice()
'amount' => $threshold_prices,
]);

$this->assertNotNull($modifier_type->modifiers->firstWhere('id', $mod->id));

break;
}
}
Expand Down

0 comments on commit fcb01c1

Please sign in to comment.