Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
eloquentize committed Mar 1, 2024
2 parents ba210af + 3032111 commit 2b78710
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Commands/ModelsCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ public function performModelCount(array $models, CarbonPeriod $period, string $e
$label = $model;
if ($scope && $scopeValue) {
$label .= '::'.$scope.'('.$scopeValue.')';
} else if ($scope) {
} elseif ($scope) {
$label .= '::'.$scope;
}



$this->verbose("Counting $label - count: ".$count);
$metrics[] = (object) ['label' => $label, 'count' => $count];

Expand Down
6 changes: 3 additions & 3 deletions tests/commands/RunModelCountWithScopeTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php

use App\Testing\Models\Bill;
use App\Testing\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Http;
use Symfony\Component\Console\Output\BufferedOutput;

it('ensure models-count is callable', function () {
Expand All @@ -22,4 +21,5 @@
})->with([
fn () => Bill::factory()->create(['ref' => 'BILL_0000001', 'price' => 1000]),
fn () => Bill::factory()->create(['ref' => 'BILL_0000002', 'price' => 500]),
]);
]);

0 comments on commit 2b78710

Please sign in to comment.