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

mimmi20 / monolog-factory / 13100304331

02 Feb 2025 03:53PM UTC coverage: 87.658% (-0.3%) from 87.966%
13100304331

push

github

web-flow
Merge pull request #639 from mimmi20/updates

use laminas/laminas-servicemanager 4.3

13 of 23 new or added lines in 13 files covered. (56.52%)

2 existing lines in 2 files now uncovered.

2500 of 2852 relevant lines covered (87.66%)

34.28 hits per line

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

0.0
/src/ClientPluginManager.php
1
<?php
2

3
/**
4
 * This file is part of the mimmi20/monolog-factory package.
5
 *
6
 * Copyright (c) 2022-2025, Thomas Mueller <mimmi20@live.de>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types = 1);
13

14
namespace Mimmi20\MonologFactory;
15

16
use Elastic\Elasticsearch\Client as V8Client;
17
use Elasticsearch\Client as V7Client;
18
use Laminas\ServiceManager\AbstractPluginManager;
19
use Laminas\ServiceManager\Exception\InvalidServiceException;
20

21
use function get_debug_type;
22
use function sprintf;
23

24
/** @extends AbstractPluginManager<V7Client|V8Client> */
25
final class ClientPluginManager extends AbstractPluginManager
26
{
27
    protected string $instanceOf = V8Client::class;
28

29
    /**
30
     * Allow many processors of the same type (v3)
31
     */
32
    protected bool $sharedByDefault = false;
33

34
    /** @throws InvalidServiceException */
NEW
35
    public function validate(mixed $instance): void
×
36
    {
NEW
37
        if ($instance instanceof V8Client || $instance instanceof V7Client) {
×
NEW
38
            return;
×
39
        }
40

NEW
41
        throw new InvalidServiceException(sprintf(
×
NEW
42
            'Plugin manager "%s" expected an instance of type "%s" or of type "%s", but "%s" was received',
×
NEW
43
            self::class,
×
NEW
44
            V8Client::class,
×
NEW
45
            V7Client::class,
×
NEW
46
            get_debug_type($instance),
×
NEW
47
        ));
×
48
    }
49
}
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