Skip to content

Commit 659fbfc

Browse files
authored
Merge pull request #2 from Micro-PHP/rename-package-core
Rename package core
2 parents e100671 + 6bae493 commit 659fbfc

24 files changed

+156
-42
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"micro/http-core": "^1",
13+
"micro/plugin-http-core": "^1",
1414
"micro/plugin-logger-core": "^1"
1515
},
1616
"require-dev": {

phpunit.xml.dist

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@
1616
<directory>tests/Unit</directory>
1717
</testsuite>
1818
</testsuites>
19-
<filter>
20-
<whitelist>
21-
<directory suffix=".php">src/</directory>
22-
<exclude>
23-
<directory>src/Exception</directory>
24-
<file>src/HttpCorePlugin.php</file>
25-
</exclude>
26-
</whitelist>
27-
</filter>
2819
<coverage>
2920
<include>
3021
<directory suffix=".php">src</directory>

src/Business/Executor/HttpExecutorLoggerAwareDecoratorFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use Micro\Plugin\Http\Business\Logger\Formatter\LogFormatterFactoryInterface;
1717
use Micro\Plugin\Http\HttpLoggerPluginConfigurationInterface;
18-
use Micro\Plugin\Logger\LoggerFacadeInterface;
18+
use Micro\Plugin\Logger\Facade\LoggerFacadeInterface;
1919

2020
/**
2121
* @author Stanislau Komar <kost@micro-php.net>

src/Business/Logger/Formatter/Format/AbstractFormat.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
/**
2121
* @author Stanislau Komar <kost@micro-php.net>
22+
*
23+
* @codeCoverageIgnore
2224
*/
2325
abstract class AbstractFormat implements LogFormatterInterface
2426
{

src/HttpLoggerPlugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
use Micro\Plugin\Http\Business\Logger\Formatter\LogFormatterFactoryInterface;
2525
use Micro\Plugin\Http\Decorator\HttpFacadeLoggerDecorator;
2626
use Micro\Plugin\Http\Facade\HttpFacadeInterface;
27-
use Micro\Plugin\Logger\LoggerFacadeInterface;
27+
use Micro\Plugin\Logger\Facade\LoggerFacadeInterface;
2828
use Micro\Plugin\Logger\LoggerPlugin;
2929

3030
/**
3131
* @author Stanislau Komar <kost@micro-php.net>
3232
*
3333
* @method HttpLoggerPluginConfigurationInterface configuration()
34+
*
35+
* @codeCoverageIgnore
3436
*/
3537
class HttpLoggerPlugin implements DependencyProviderInterface, PluginDependedInterface, ConfigurableInterface
3638
{

src/HttpLoggerPluginConfiguration.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace Micro\Plugin\Http;
1515

1616
use Micro\Framework\Kernel\Configuration\PluginConfiguration;
17+
use Micro\Plugin\Logger\LoggerPluginConfiguration;
1718

1819
/**
1920
* @author Stanislau Komar <kost@micro-php.net>
@@ -31,14 +32,14 @@ class HttpLoggerPluginConfiguration extends PluginConfiguration implements HttpL
3132

3233
public const DECORATION_DEFAULT = 10;
3334

34-
public function getAccessLoggerName(): string|null
35+
public function getAccessLoggerName(): string
3536
{
36-
return $this->configuration->get(self::CFG_LOGGER_ACCESS);
37+
return (string) $this->configuration->get(self::CFG_LOGGER_ACCESS, LoggerPluginConfiguration::LOGGER_NAME_DEFAULT);
3738
}
3839

39-
public function getErrorLoggerName(): string|null
40+
public function getErrorLoggerName(): string
4041
{
41-
return $this->configuration->get(self::CFG_LOGGER_ERROR);
42+
return (string) $this->configuration->get(self::CFG_LOGGER_ERROR, LoggerPluginConfiguration::LOGGER_NAME_DEFAULT);
4243
}
4344

4445
public function getWeight(): int

src/HttpLoggerPluginConfigurationInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
*/
1919
interface HttpLoggerPluginConfigurationInterface
2020
{
21-
public function getAccessLoggerName(): string|null;
21+
public function getAccessLoggerName(): string;
2222

23-
public function getErrorLoggerName(): string|null;
23+
public function getErrorLoggerName(): string;
2424

2525
public function getErrorLogFormat(): string;
2626

tests/Unit/Micro/Plugin/Http/Business/Executor/HttpExecutorLoggerAwareDecoratorFactoryTest.php renamed to tests/Unit/Business/Executor/HttpExecutorLoggerAwareDecoratorFactoryTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Micro\Plugin\Http\Business\Executor;
12+
namespace Micro\Plugin\Http\Test\Unit\Business\Executor;
1313

14+
use Micro\Plugin\Http\Business\Executor\HttpExecutorLoggerAwareDecoratorFactory;
15+
use Micro\Plugin\Http\Business\Executor\RouteExecutorInterface;
1416
use Micro\Plugin\Http\Business\Logger\Formatter\LogFormatterFactoryInterface;
1517
use Micro\Plugin\Http\Facade\HttpFacadeInterface;
1618
use Micro\Plugin\Http\HttpLoggerPluginConfigurationInterface;
17-
use Micro\Plugin\Logger\LoggerFacadeInterface;
19+
use Micro\Plugin\Logger\Facade\LoggerFacadeInterface;
1820
use PHPUnit\Framework\TestCase;
1921

2022
class HttpExecutorLoggerAwareDecoratorFactoryTest extends TestCase

tests/Unit/Micro/Plugin/Http/Business/Executor/HttpExecutorLoggerAwareDecoratorTest.php renamed to tests/Unit/Business/Executor/HttpExecutorLoggerAwareDecoratorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Micro\Plugin\Http\Business\Executor;
12+
namespace Micro\Plugin\Http\Test\Unit\Business\Executor;
1313

14+
use Micro\Plugin\Http\Business\Executor\HttpExecutorLoggerAwareDecorator;
1415
use Micro\Plugin\Http\Business\Logger\Formatter\LogFormatterInterface;
1516
use Micro\Plugin\Http\Exception\HttpException;
1617
use Micro\Plugin\Http\Facade\HttpFacadeInterface;

tests/Unit/Micro/Plugin/Http/Business/Logger/Formatter/Format/AbstractFormatTest.php renamed to tests/Unit/Business/Logger/Formatter/Format/AbstractFormatTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* file that was distributed with this source code.
1212
*/
1313

14-
namespace Micro\Plugin\Http\Business\Logger\Formatter\Format;
14+
namespace Micro\Plugin\Http\Test\Unit\Business\Logger\Formatter\Format;
1515

1616
use Micro\Plugin\Http\Business\Logger\Formatter\LogFormatterInterface;
1717
use Micro\Plugin\Http\Exception\HttpException;
@@ -31,7 +31,8 @@ public function testFormat(bool $hasResponse, \Throwable|null $throwable)
3131
{
3232
$object = $this->createTestObject();
3333

34-
$this->assertIsString(
34+
$this->assertResult(
35+
$object,
3536
$object->format(
3637
$this->createRequest(),
3738
$this->createResponse($hasResponse),
@@ -52,6 +53,14 @@ public function dataProvider()
5253
];
5354
}
5455

56+
protected function assertResult(mixed $object, mixed $result)
57+
{
58+
$this->assertEquals(
59+
$this->getVariable(),
60+
$result
61+
);
62+
}
63+
5564
public function createThrowable(\Throwable|null $throwable): \Throwable|null
5665
{
5766
return $throwable;

0 commit comments

Comments
 (0)