• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / Iznik / 11399

08 May 2026 04:18PM UTC coverage: 72.847% (-0.01%) from 72.861%
11399

push

circleci

web-flow
Merge pull request #404 from Freegle/fix/address-null-island-lat-lng

fix(address): use *float64 for lat/lng to store NULL instead of 0 (Null Island fix)

13763 of 20701 branches covered (66.48%)

Branch coverage included in aggregate %.

101962 of 138160 relevant lines covered (73.8%)

22.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/iznik-batch/app/Console/Commands/User/UpdateEngagementCommand.php
1
<?php
2

3
namespace App\Console\Commands\User;
4

5
use App\Console\Concerns\PreventsOverlapping;
6
use App\Services\EngageUpdateService;
7
use App\Traits\GracefulShutdown;
8
use Illuminate\Console\Command;
9
use Illuminate\Support\Facades\Log;
10

11
class UpdateEngagementCommand extends Command
12
{
13
    use PreventsOverlapping;
14
    use GracefulShutdown;
15

16
    protected $signature = 'users:update-engagement
17
                            {--dry-run : Show what would be updated without making changes}';
18

19
    protected $description = 'Update user engagement classifications based on recent activity';
20

21
    public function handle(EngageUpdateService $service): int
×
22
    {
23
        if (!$this->acquireLock()) {
×
24
            $this->info('Already running, exiting.');
×
25
            return Command::SUCCESS;
×
26
        }
27

28
        try {
29
            $dryRun = (bool) $this->option('dry-run');
×
30

31
            if ($dryRun) {
×
32
                $this->info('Dry run — counting transitions but not writing.');
×
33
            } else {
34
                Log::info('Starting user engagement update');
×
35
            }
36

37
            $stats = $service->updateEngagement($dryRun);
×
38

39
            $verb = $dryRun ? 'Would update' : 'Updated';
×
40
            $this->info("{$verb} {$stats['total']} user(s):");
×
41
            $this->line(sprintf('  NULL → New:                       %d', $stats['null_to_new']));
×
42
            $this->line(sprintf('  NULL → Inactive:                  %d', $stats['null_to_inactive']));
×
43
            $this->line(sprintf('  New/Occasional → Inactive:        %d', $stats['new_or_occasional_to_inactive']));
×
44
            $this->line(sprintf('  * → Dormant (>182d):              %d', $stats['to_dormant']));
×
45
            $this->line(sprintf('  New/Inactive/Dormant → Occasional: %d', $stats['to_occasional']));
×
46
            $this->line(sprintf('  Occasional → Frequent:            %d', $stats['occasional_to_frequent']));
×
47
            $this->line(sprintf('  Frequent → Obsessed:              %d', $stats['frequent_to_obsessed']));
×
48
            $this->line(sprintf('  Obsessed → Frequent:              %d', $stats['obsessed_to_frequent']));
×
49

50
            if (!$dryRun) {
×
51
                Log::info('User engagement update complete', $stats);
×
52
            }
53

54
            return Command::SUCCESS;
×
55
        } finally {
56
            $this->releaseLock();
×
57
        }
58
    }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc