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

Freegle / Iznik / 11342

08 May 2026 02:47PM UTC coverage: 68.97% (-3.8%) from 72.761%
11342

push

circleci

web-flow
Merge pull request #403 from Freegle/feature/exports-migration

feat(batch): migrate exports.php to users:process-exports

9127 of 10554 branches covered (86.48%)

Branch coverage included in aggregate %.

400 of 452 new or added lines in 2 files covered. (88.5%)

12172 existing lines in 167 files now uncovered.

100855 of 148909 relevant lines covered (67.73%)

19.62 hits per line

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

33.33
/iznik-batch/app/Console/Commands/Integrations/SyncLoveJunkCommand.php
1
<?php
2

3
namespace App\Console\Commands\Integrations;
4

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

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

16
    protected $signature = 'integrations:sync-lovejunk
17
                            {--dry-run : Show what would be synced without making changes}';
18

19
    protected $description = 'Sync Freegle offer messages with LoveJunk API';
20

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

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

31
            if ($dryRun) {
1✔
32
                $this->info('Dry run — counting work but not calling LoveJunk API or writing.');
1✔
33
            } else {
34
                Log::info('LoveJunk: Starting sync');
×
35
            }
36

37
            $result = $service->sync($dryRun);
1✔
38

39
            $verb = $dryRun ? 'Would' : '';
×
40
            $this->info(sprintf(
×
41
                '%sSent: %d, %sEdited: %d, %sCompleted/Deleted: %d, Failed: %d',
×
42
                $verb, $result['sent'],
×
43
                $verb, $result['edited'],
×
44
                $verb, $result['completed_or_deleted'],
×
UNCOV
45
                $result['failed']
×
46
            ));
×
47

48
            if (!$dryRun) {
×
UNCOV
49
                Log::info('LoveJunk: Done', $result);
×
50
            }
51

UNCOV
52
            return Command::SUCCESS;
×
53
        } finally {
54
            $this->releaseLock();
1✔
55
        }
56
    }
57
}
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