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

LeTraceurSnorkLibrary / MessSaga / 23852870478

01 Apr 2026 02:06PM UTC coverage: 31.268% (-0.4%) from 31.674%
23852870478

Pull #15

github

web-flow
Merge 57d62f151 into a7d6f3637
Pull Request #15: feat: add s3 as storage

14 of 43 new or added lines in 8 files covered. (32.56%)

2 existing lines in 2 files now uncovered.

439 of 1404 relevant lines covered (31.27%)

0.73 hits per line

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

0.0
/app/Providers/AppServiceProvider.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\Providers;
6

7
use App\Services\Import\Archives\RarImportArchiveExtractor;
8
use App\Services\Import\Archives\ZipImportArchiveExtractor;
9
use App\Services\Import\Export\Factories\ExportArchiveLocatorFactory;
10
use App\Services\Import\Export\Locators\Archive\TelegramExportArchiveLocator;
11
use App\Services\Import\Export\Locators\Archive\WhatsAppExportArchiveLocator;
12
use App\Services\Import\Factories\ImportArchiveExtractorFactory;
13
use App\Services\Media\Storage\LaravelMediaStorage;
14
use App\Services\Media\Storage\MediaStorageInterface;
15
use App\Services\Parsers\ParserRegistry;
16
use App\Services\Parsers\TelegramParser;
17
use App\Services\Parsers\WhatsAppParser;
18
use Exception;
19
use Illuminate\Support\Facades\Storage;
20
use Illuminate\Support\Facades\Validator;
21
use Illuminate\Support\Facades\Vite;
22
use Illuminate\Support\ServiceProvider;
23
use Propaganistas\LaravelPhone\PhoneNumber;
24

25
class AppServiceProvider extends ServiceProvider
26
{
27
    /**
28
     * Register any application services.
29
     */
30
    public function register(): void
31
    {
32
        $this->app->singleton(ParserRegistry::class, function ($app) {
×
33
            $registry = new ParserRegistry();
×
34
            $registry->register('telegram', $app->make(TelegramParser::class));
×
35
            $registry->register('whatsapp', $app->make(WhatsAppParser::class));
×
36

37
            return $registry;
×
38
        });
×
39

40
        $this->app->singleton(ExportArchiveLocatorFactory::class, function ($app) {
×
41
            return new ExportArchiveLocatorFactory()
×
42
                ->register('telegram', $app->make(TelegramExportArchiveLocator::class))
×
43
                ->register('whatsapp', $app->make(WhatsAppExportArchiveLocator::class));
×
44
        });
×
45

46
        $this->app->singleton(ImportArchiveExtractorFactory::class, function ($app) {
×
47
            return new ImportArchiveExtractorFactory()
×
48
                ->register($app->make(ZipImportArchiveExtractor::class))
×
49
                ->register($app->make(RarImportArchiveExtractor::class));
×
50
        });
×
51

NEW
52
        $this->app->singleton(MediaStorageInterface::class, function () {
×
NEW
53
            $mediaDisk = (string)config('filesystems.media_disk', config('filesystems.default'));
×
54

NEW
55
            return new LaravelMediaStorage(Storage::disk($mediaDisk));
×
NEW
56
        });
×
57
    }
58

59
    /**
60
     * Bootstrap any application services.
61
     */
62
    public function boot(): void
63
    {
64
        Vite::prefetch(concurrency: 3);
×
65

66
        Validator::extend('phone', function ($attribute, $value, $parameters, $validator) {
×
67
            try {
68
                return new PhoneNumber(
×
69
                    (string)$value,
×
70
                    $parameters
×
71
                        ?: ['RU']
×
72
                )->isValid();
×
73
            } catch (Exception $e) {
×
74
                return false;
×
75
            }
76
        });
×
77
    }
78
}
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