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

umbrellio / php-table-sync / 4530357316

pending completion
4530357316

push

github

GitHub
 Added support for Laravel 10 (#19)

17 of 32 new or added lines in 12 files covered. (53.13%)

5 existing lines in 5 files now uncovered.

252 of 660 relevant lines covered (38.18%)

16.45 hits per line

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

0.0
/src/Monolog/Handler/InfluxDBHandler.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Umbrellio\TableSync\Monolog\Handler;
6

7
use InfluxDB\Database;
8
use InvalidArgumentException;
9
use Monolog\Formatter\FormatterInterface;
10
use Monolog\Handler\AbstractProcessingHandler;
11
use Monolog\Handler\HandlerInterface;
12
use Monolog\Level;
13
use Monolog\LogRecord;
14
use Umbrellio\TableSync\Monolog\Formatter\InfluxDBFormatter;
15
use Umbrellio\TableSync\Monolog\Formatter\TableSyncFormatter;
16

17
class InfluxDBHandler extends AbstractProcessingHandler
18
{
19
    public function __construct(
20
        private readonly Database $database,
21
        private readonly string $measurement = 'table_sync',
NEW
22
        int|string|Level $level = Level::Info,
×
23
        bool $bubble = true
24
    ) {
25
        parent::__construct($level, $bubble);
×
26
    }
27

28
    public function setFormatter(FormatterInterface $formatter): HandlerInterface
29
    {
30
        if ($formatter instanceof TableSyncFormatter) {
×
31
            return parent::setFormatter($formatter);
×
32
        }
33

34
        throw new InvalidArgumentException('InfluxDBHandler is only compatible with TableSyncFormatter');
×
35
    }
36

37
    protected function write(LogRecord $record): void
38
    {
NEW
39
        $this->database->writePoints($record->formatted);
×
40
    }
41

42
    protected function getDefaultFormatter(): FormatterInterface
43
    {
44
        return new InfluxDBFormatter($this->measurement);
×
45
    }
46
}
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