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

Update to support PHP 8.3 #53

Merged
merged 6 commits into from
Dec 5, 2023
Merged
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: 2 additions & 2 deletions .laminas-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"mongodb"
],
"ignore_php_platform_requirements": {
"8.2": true
"8.3": true
}
}
}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"sort-packages": true,
"platform": {
"php": "8.0.99"
"php": "8.1.99"
}
},
"extra": {
Expand All @@ -32,8 +32,8 @@
}
},
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"laminas/laminas-servicemanager": "^3.3.0",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"laminas/laminas-servicemanager": "^3.21.0",
"laminas/laminas-stdlib": "^3.0",
"psr/log": "^1.1.2"
},
Expand Down
1,130 changes: 662 additions & 468 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/FilterPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Laminas\Log;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Config;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerInterface;

use function is_array;

Expand Down
2 changes: 1 addition & 1 deletion src/FormatterPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Laminas\Log;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Config;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerInterface;

use function is_array;

Expand Down
4 changes: 1 addition & 3 deletions src/LoggerAbstractServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

namespace Laminas\Log;

use Interop\Container\ContainerInterface;
use Interop\Container\Exception\ContainerException;
use Laminas\ServiceManager\AbstractFactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;

/**
Expand Down Expand Up @@ -78,7 +77,6 @@ public function __invoke(ContainerInterface $container, $requestedName, ?array $
* @param string $name
* @param string $requestedName
* @return Logger
* @throws ContainerException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/LoggerServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Laminas\Log;

use ArrayAccess;
use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\Exception\InvalidArgumentException;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;

use function get_class;
Expand Down
2 changes: 1 addition & 1 deletion src/ProcessorPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Laminas\Log;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Config;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerInterface;

use function is_array;

Expand Down
4 changes: 1 addition & 3 deletions src/PsrLoggerAbstractAdapterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

namespace Laminas\Log;

use Interop\Container\ContainerInterface;
use Interop\Container\Exception\ContainerException;
use Laminas\ServiceManager\AbstractFactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;

/**
Expand All @@ -35,7 +34,6 @@ public function __construct()
/**
* @param string $requestedName
* @return PsrLoggerAdapter
* @throws ContainerException
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Writer/Factory/WriterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Laminas\Log\Writer\Factory;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Exception\InvalidServiceException;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerInterface;

use function class_exists;
use function is_array;
Expand Down
2 changes: 1 addition & 1 deletion src/WriterPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Laminas\Log;

use Interop\Container\ContainerInterface;
use Laminas\ServiceManager\Config;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Psr\Container\ContainerInterface;

use function is_array;

Expand Down
2 changes: 2 additions & 0 deletions test/Filter/SuppressFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

class SuppressFilterTest extends TestCase
{
private SuppressFilter $filter;

protected function setUp(): void
{
$this->filter = new SuppressFilter();
Expand Down
3 changes: 2 additions & 1 deletion test/FilterPluginManagerCompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Laminas\Log\Exception\InvalidArgumentException;
use Laminas\Log\Filter;
use Laminas\Log\FilterPluginManager;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\ServiceManager;
use Laminas\ServiceManager\Test\CommonPluginManagerTrait;
use PHPUnit\Framework\TestCase;
Expand All @@ -18,7 +19,7 @@ class FilterPluginManagerCompatibilityTest extends TestCase
use CommonPluginManagerTrait;
use ServicesNotSharedByDefaultTrait;

protected function getPluginManager()
protected static function getPluginManager(): AbstractPluginManager
{
return new FilterPluginManager(new ServiceManager());
}
Expand Down
4 changes: 2 additions & 2 deletions test/FilterPluginManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace LaminasTest\Log;

use Closure;
use Interop\Container\ContainerInterface;
use Laminas\Log\Filter\FilterInterface;
use Laminas\Log\FilterPluginManager;
use Laminas\Log\FilterPluginManagerFactory;
use Laminas\ServiceManager\ServiceLocatorInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;

class FilterPluginManagerFactoryTest extends TestCase
{
Expand All @@ -34,7 +34,7 @@ public function testFactoryReturnsPluginManager(): void
/**
* @depends testFactoryReturnsPluginManager
*/
public function testFactoryConfiguresPluginManagerUnderContainerInterop(): void
public function testFactoryConfiguresPluginManagerUnderContainerPSR(): void
{
$container = $this->prophesize(ContainerInterface::class)->reveal();
$filter = $this->prophesize(FilterInterface::class)->reveal();
Expand Down
3 changes: 2 additions & 1 deletion test/FormatterPluginManagerCompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Laminas\Log\Exception\InvalidArgumentException;
use Laminas\Log\Formatter;
use Laminas\Log\FormatterPluginManager;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\ServiceManager;
use Laminas\ServiceManager\Test\CommonPluginManagerTrait;
use PHPUnit\Framework\TestCase;
Expand All @@ -16,7 +17,7 @@ class FormatterPluginManagerCompatibilityTest extends TestCase
use CommonPluginManagerTrait;
use ServicesNotSharedByDefaultTrait;

protected function getPluginManager()
protected static function getPluginManager(): AbstractPluginManager
{
return new FormatterPluginManager(new ServiceManager());
}
Expand Down
4 changes: 2 additions & 2 deletions test/FormatterPluginManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace LaminasTest\Log;

use Closure;
use Interop\Container\ContainerInterface;
use Laminas\Log\Formatter\FormatterInterface;
use Laminas\Log\FormatterPluginManager;
use Laminas\Log\FormatterPluginManagerFactory;
use Laminas\ServiceManager\ServiceLocatorInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;

class FormatterPluginManagerFactoryTest extends TestCase
{
Expand All @@ -34,7 +34,7 @@ public function testFactoryReturnsPluginManager(): void
/**
* @depends testFactoryReturnsPluginManager
*/
public function testFactoryConfiguresPluginManagerUnderContainerInterop(): void
public function testFactoryConfiguresPluginManagerUnderContainerPSR(): void
{
$container = $this->prophesize(ContainerInterface::class)->reveal();
$formatter = $this->prophesize(FormatterInterface::class)->reveal();
Expand Down
3 changes: 1 addition & 2 deletions test/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@

class LoggerTest extends TestCase
{
/** @var Logger */
private $logger;
private Logger $logger;

protected function setUp(): void
{
Expand Down
3 changes: 2 additions & 1 deletion test/ProcessorPluginManagerCompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Laminas\Log\Exception\InvalidArgumentException;
use Laminas\Log\Processor;
use Laminas\Log\ProcessorPluginManager;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\ServiceManager;
use Laminas\ServiceManager\Test\CommonPluginManagerTrait;
use PHPUnit\Framework\TestCase;
Expand All @@ -16,7 +17,7 @@ class ProcessorPluginManagerCompatibilityTest extends TestCase
use CommonPluginManagerTrait;
use ServicesNotSharedByDefaultTrait;

protected function getPluginManager()
protected static function getPluginManager(): AbstractPluginManager
{
return new ProcessorPluginManager(new ServiceManager());
}
Expand Down
4 changes: 2 additions & 2 deletions test/ProcessorPluginManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace LaminasTest\Log;

use Closure;
use Interop\Container\ContainerInterface;
use Laminas\Log\Processor\ProcessorInterface;
use Laminas\Log\ProcessorPluginManager;
use Laminas\Log\ProcessorPluginManagerFactory;
use Laminas\ServiceManager\ServiceLocatorInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;

class ProcessorPluginManagerFactoryTest extends TestCase
{
Expand All @@ -34,7 +34,7 @@ public function testFactoryReturnsPluginManager(): void
/**
* @depends testFactoryReturnsPluginManager
*/
public function testFactoryConfiguresPluginManagerUnderContainerInterop(): void
public function testFactoryConfiguresPluginManagerUnderContainerPSR(): void
{
$container = $this->prophesize(ContainerInterface::class)->reveal();
$processor = $this->prophesize(ProcessorInterface::class)->reveal();
Expand Down
2 changes: 2 additions & 0 deletions test/PsrLoggerAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*/
class PsrLoggerAdapterTest extends LoggerInterfaceTest
{
private MockWriter $mockWriter;

/** @var array */
protected $psrPriorityMap = [
LogLevel::EMERGENCY => Logger::EMERG,
Expand Down
2 changes: 2 additions & 0 deletions test/TestAsset/MockDbDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class MockDbDriver
{
private array $calls;

public function __call($method, $params)
{
$this->calls[$method][] = $params;
Expand Down
2 changes: 2 additions & 0 deletions test/TestAsset/MockDbPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

class MockDbPlatform
{
private array $calls;

public function __call($method, $params)
{
$this->calls[$method][] = $params;
Expand Down
4 changes: 4 additions & 0 deletions test/Writer/DbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

class DbTest extends TestCase
{
private string $tableName;
private MockDbAdapter $db;
private DbWriter $writer;

protected function setUp(): void
{
$this->tableName = 'db-table-name';
Expand Down
2 changes: 1 addition & 1 deletion test/Writer/Factory/WriterFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace LaminasTest\Log\Writer\Factory;

use Interop\Container\ContainerInterface;
use Laminas\Log\Writer\Factory\WriterFactory;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\Exception\InvalidServiceException;
use Laminas\ServiceManager\ServiceLocatorInterface;
use LaminasTest\Log\Writer\TestAsset\InvokableObject;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;

class WriterFactoryTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions test/Writer/StreamWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Laminas\Log\Formatter\Simple as SimpleFormatter;
use Laminas\Log\Writer\Stream as StreamWriter;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use PHPUnit\Framework\TestCase;

use function fclose;
Expand All @@ -29,6 +30,7 @@ class StreamWriterTest extends TestCase
* Flag used to prevent running tests that require full isolation
*/
private static $ranSuite = false;
private vfsStreamDirectory $root;

protected function setUp(): void
{
Expand Down
3 changes: 2 additions & 1 deletion test/WriterPluginManagerCompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Laminas\Log\Exception\InvalidArgumentException;
use Laminas\Log\Writer;
use Laminas\Log\WriterPluginManager;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\ServiceManager;
use Laminas\ServiceManager\Test\CommonPluginManagerTrait;
use PHPUnit\Framework\TestCase;
Expand All @@ -18,7 +19,7 @@ class WriterPluginManagerCompatibilityTest extends TestCase
use CommonPluginManagerTrait;
use ServicesNotSharedByDefaultTrait;

protected function getPluginManager()
protected static function getPluginManager(): AbstractPluginManager
{
return new WriterPluginManager(new ServiceManager());
}
Expand Down
4 changes: 2 additions & 2 deletions test/WriterPluginManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace LaminasTest\Log;

use Closure;
use Interop\Container\ContainerInterface;
use Laminas\Log\Writer\WriterInterface;
use Laminas\Log\WriterPluginManager;
use Laminas\Log\WriterPluginManagerFactory;
use Laminas\ServiceManager\ServiceLocatorInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Container\ContainerInterface;

class WriterPluginManagerFactoryTest extends TestCase
{
Expand All @@ -34,7 +34,7 @@ public function testFactoryReturnsPluginManager(): void
/**
* @depends testFactoryReturnsPluginManager
*/
public function testFactoryConfiguresPluginManagerUnderContainerInterop(): void
public function testFactoryConfiguresPluginManagerUnderContainerPSR(): void
{
$container = $this->prophesize(ContainerInterface::class)->reveal();
$writer = $this->prophesize(WriterInterface::class)->reveal();
Expand Down
Loading