Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for monolog v3 and php 8.1 and 8.2 #72

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "locked"
- name: "Allow infection extension installer"
run: "composer config --no-plugins allow-plugins.infection/extension-installer true"
- name: "Install Infection"
run: "composer require --dev infection/infection"
run: "composer require --dev --with-all-dependencies infection/infection"
- name: "Mutation Tests"
run: "composer test:mutations"
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- "lowest"
- "highest"
php-version:
- "8.2"
- "8.1"
- "8.0"
- "7.4"
- "7.3"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require": {
"php": "^7.1 || ^8.0",
"container-interop/container-interop": "^1.0",
"monolog/monolog": "^1.3 || ^2.0",
"monolog/monolog": "^1.6 || ^2.0 || ^3.0",
"laminas/laminas-stdlib": "^3",
"laminas/laminas-servicemanager": "^3"
},
Expand Down
51 changes: 30 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 88 additions & 35 deletions test/unit/Service/HandlerMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,108 @@

use Monolog\Formatter\FormatterInterface;
use Monolog\Handler\HandlerInterface;
use Monolog\LogRecord;

if (interface_exists(HandlerInterface::class)) {
class HandlerMock implements HandlerInterface
{
if (\Monolog\Logger::API === 2) {
class HandlerMock implements HandlerInterface
{

protected $path;
protected $path;

public function __construct($path)
{
$this->path = $path;
}
public function __construct($path)
{
$this->path = $path;
}

public function getPath()
{
return $this->path;
}
public function getPath()
{
return $this->path;
}

public function isHandling(array $record): bool
{
return true;
}
public function isHandling(array $record): bool
{
return true;
}

public function handle(array $record): bool
{
return true;
}
public function handle(array $record): bool
{
return true;
}

public function handleBatch(array $records): void
{
}
public function handleBatch(array $records): void
{
}

public function pushProcessor($callback)
{
}
public function pushProcessor($callback)
{
}

public function popProcessor()
{
}
public function popProcessor()
{
}

public function setFormatter(FormatterInterface $formatter)
{
}
public function setFormatter(FormatterInterface $formatter)
{
}

public function getFormatter()
{
}
public function getFormatter()
{
}

public function close(): void
public function close(): void
{
}
}
} else {
class HandlerMock implements HandlerInterface
{

protected $path;

public function __construct($path)
{
$this->path = $path;
}

public function getPath()
{
return $this->path;
}

public function isHandling(LogRecord $record): bool
{
return true;
}

public function handle(LogRecord $record): bool
{
return true;
}

public function handleBatch(LogRecord $records): void
{
}

public function pushProcessor($callback)
{
}

public function popProcessor()
{
}

public function setFormatter(FormatterInterface $formatter)
{
}

public function getFormatter()
{
}

public function close(): void
{
}
}
}
} else {
Expand Down