Skip to content

Commit

Permalink
[MetricsPower] Added unit and feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalzombie committed Mar 29, 2024
1 parent 0d57ace commit 15c13d1
Show file tree
Hide file tree
Showing 12 changed files with 252 additions and 393 deletions.
6 changes: 1 addition & 5 deletions Logger/ContextExtractorLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@

namespace FRZB\Component\MetricsPower\Logger;

use Fp\Collections\HashMap;
use FRZB\Component\DependencyInjection\Attribute\AsService;
use FRZB\Component\MetricsPower\Logger\ContextExtractor\ContextExtractorInterface;
use FRZB\Component\MetricsPower\Logger\ContextExtractor\DefaultContextExtractor;
use FRZB\Component\MetricsPower\Logger\Exception\ContextExtractorLocatorException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
use Symfony\Component\DependencyInjection\Attribute\TaggedLocator;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Contracts\Service\ServiceProviderInterface;

#[AsService]
Expand All @@ -33,8 +30,7 @@
public function __construct(
#[TaggedLocator(ContextExtractorInterface::class, defaultIndexMethod: 'getType')]
private ServiceProviderInterface $serviceProvider,
) {
}
) {}

public function get(object|string $target): ContextExtractorInterface
{
Expand Down
15 changes: 12 additions & 3 deletions Logger/Exception/ContextExtractorLocatorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

declare(strict_types=1);

/**
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
* Copyright (c) 2024 Mykhailo Shtanko fractalzombie@gmail.com
*
* For the full copyright and license information, please view the LICENSE.MD
* file that was distributed with this source code.
*/

namespace FRZB\Component\MetricsPower\Logger\Exception;

use FRZB\Component\MetricsPower\Exception\MetricsPowerException;

final class ContextExtractorLocatorException extends MetricsPowerException
{
}
final class ContextExtractorLocatorException extends MetricsPowerException {}
1 change: 0 additions & 1 deletion Logger/MetricsPowerLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
namespace FRZB\Component\MetricsPower\Logger;

use FRZB\Component\DependencyInjection\Attribute\AsService;
use FRZB\Component\MetricsPower\Attribute\OptionsInterface;
use Psr\Log\LoggerInterface;

#[AsService]
Expand Down
1 change: 0 additions & 1 deletion Logger/MetricsPowerLoggerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace FRZB\Component\MetricsPower\Logger;

use FRZB\Component\DependencyInjection\Attribute\AsAlias;
use FRZB\Component\MetricsPower\Attribute\OptionsInterface;

/**
* @template TTarget of object
Expand Down
108 changes: 0 additions & 108 deletions Tests/Dump/AttributeHelperTest.php

This file was deleted.

201 changes: 0 additions & 201 deletions Tests/Dump/ClassHelperTest.php

This file was deleted.

0 comments on commit 15c13d1

Please sign in to comment.