Skip to content

Commit d5fd17d

Browse files
authored
Merge pull request #1 from Micro-PHP/release-0.2
v0.2 - release
2 parents c57bc3d + 2b3a876 commit d5fd17d

13 files changed

+54
-6
lines changed

.gitignore

100644100755
File mode changed.

LICENSE

100644100755
File mode changed.

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Micro Framework - The minimum kernel for application initialization.
2+
3+
### Requirements
4+
5+
PHP >= 8.0.0
6+
7+
### How to use the library
8+
9+
Add the latest version of micro/kernel into your project by using Composer or manually:
10+
11+
__Using Composer (Recommended)__
12+
13+
Or require the package inside the composer.json of your project:
14+
```
15+
"require": {
16+
"micro/kernel": "^1"
17+
},
18+
```
19+
20+
### Example
21+
22+
After adding the library to your project, include the file autoload.php found in root of the library.
23+
```html
24+
include 'vendor/autoload.php';
25+
```
26+
27+
#### Configuration
28+
29+
30+
31+
#### Simple usage:
32+
33+
```php
34+
35+
$plugins = [
36+
\Micro\Plugin\Logger\LoggerPlugin::class,
37+
];
38+
```
39+
40+
## License
41+
42+
[MIT](LICENSE)

composer.json

100644100755
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "micro/plugin-logger-core",
33
"description": "Micro Framework: Logger plugin",
44
"type": "library",
5-
"version": "0.1",
5+
"version": "0.2",
66
"license": "MIT",
77
"autoload": {
88
"psr-4": {
@@ -16,6 +16,7 @@
1616
}
1717
],
1818
"require": {
19+
"micro/kernel": "^1",
1920
"php": ">=8.0",
2021
"psr/log": "^1|^2|^3"
2122
}

phpcs.xml

100644100755
File mode changed.

src/Business/Factory/LoggerFactoryInterface.php

100644100755
File mode changed.

src/Business/Provider/LoggerProvider.php

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class LoggerProvider implements LoggerProviderInterface
1515
/**
1616
* @param LoggerFactoryInterface $loggerFactory
1717
*/
18-
public function __construct(private LoggerFactoryInterface $loggerFactory)
18+
public function __construct(private readonly LoggerFactoryInterface $loggerFactory)
1919
{
2020
$this->loggerCollection = [];
2121
}

src/Business/Provider/LoggerProviderInterface.php

100644100755
File mode changed.

src/LoggerFacade.php

100644100755
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ public function __construct(private LoggerProviderInterface $loggerProvider)
1515
}
1616

1717
/**
18-
* @param string $logger
18+
* @param null|string $logger
1919
*
2020
* @return LoggerInterface
2121
*/
22-
public function getLogger(string $logger = self::LOGGER_DEFAULT): LoggerInterface
22+
public function getLogger(?string $logger = self::LOGGER_DEFAULT): LoggerInterface
2323
{
24+
if($logger === null) {
25+
$logger = self::LOGGER_DEFAULT;
26+
}
27+
2428
return $this->loggerProvider->getLogger($logger);
2529
}
2630
}

src/LoggerFacadeInterface.php

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ interface LoggerFacadeInterface
99
public const LOGGER_DEFAULT = 'default';
1010

1111
/**
12-
* @param string $logger
12+
* @param string|null $logger
13+
*
1314
* @return LoggerInterface
1415
*/
15-
public function getLogger(string $logger = self::LOGGER_DEFAULT): LoggerInterface;
16+
public function getLogger(?string $logger = self::LOGGER_DEFAULT): LoggerInterface;
1617
}

0 commit comments

Comments
 (0)