Skip to content

Commit

Permalink
Merge pull request #272 from driehle/feat/drop-php74
Browse files Browse the repository at this point in the history
Drop PHP 7.4
  • Loading branch information
driehle authored Aug 1, 2023
2 parents ffaef23 + 8ff5fcd commit 00b8241
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 63 deletions.
6 changes: 3 additions & 3 deletions .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"slug": "doctrine-mongo-odm-module",
"versions": [
{
"name": "4.4",
"branchName": "4.4.x",
"slug": "4.4",
"name": "5.0",
"branchName": "5.0.x",
"slug": "5.0",
"aliases": [
"latest"
],
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
dependencies:
- "highest"
include:
- php-version: "7.4"
- php-version: "8.0"
dependencies: "lowest"

services:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"homepage": "https://www.doctrine-project.org/",
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"ext-mongodb": "*",
"doctrine/doctrine-laminas-hydrator": "^3.1.0",
"doctrine/doctrine-module": "^5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: .
dockerfile: docker/Dockerfile
args:
- PHP_VERSION=${PHP_VERSION:-7.4}
- PHP_VERSION=${PHP_VERSION:-8.0}
- XDEBUG=${XDEBUG:-0}
volumes:
- ./:/docker
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PHP_VERSION=7.4
ARG PHP_VERSION=8.0
FROM php:${PHP_VERSION}-alpine

ARG XDEBUG=0
Expand Down
2 changes: 1 addition & 1 deletion docs/en/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To change docker to a different php version

.. code:: bash
docker-compose build --build-arg PHP_VERSION=7.4
docker-compose build --build-arg PHP_VERSION=8.0
then run the unit tests as

Expand Down
4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<arg name="cache" value=".phpcs.cache"/>
<arg name="colors"/>

<!-- set minimal required PHP version (7.4) -->
<config name="php_version" value="70400"/>
<!-- set minimal required PHP version (8.0) -->
<config name="php_version" value="80000"/>

<!-- Include full Doctrine Coding Standard -->
<rule ref="Doctrine">
Expand Down
3 changes: 1 addition & 2 deletions src/Logging/DebugStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class DebugStack implements CommandLoggerInterface
/** @var bool $enabled If Debug Stack is enabled (log queries) or not. */
public bool $enabled = true;

/** @var mixed $currentQuery */
protected $currentQuery = 0;
protected mixed $currentQuery = 0;

public function __construct()
{
Expand Down
5 changes: 2 additions & 3 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputOption;

use function get_class;
use function sprintf;

/**
Expand All @@ -34,7 +33,7 @@ public function init(ModuleManagerInterface $manager): void
throw new InvalidArgumentException(sprintf(
'Expected %s, but received %s.',
ModuleManager::class,
get_class($manager)
$manager::class
));
}

Expand Down Expand Up @@ -75,7 +74,7 @@ public function loadCli(EventInterface $event): void
throw new InvalidArgumentException(sprintf(
'Expected %s as event target, received %s.',
Application::class,
get_class($cli)
$cli::class
));
}

Expand Down
15 changes: 3 additions & 12 deletions src/Options/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ final class DocumentManager extends AbstractOptions
*/
protected string $eventManager = 'odm_default';

/**
* @param mixed $configuration
*/
public function setConfiguration($configuration): self
public function setConfiguration(mixed $configuration): self
{
$this->configuration = (string) $configuration;

Expand All @@ -47,10 +44,7 @@ public function getConfiguration(): string
return 'doctrine.configuration.' . $this->configuration;
}

/**
* @param mixed $connection
*/
public function setConnection($connection): self
public function setConnection(mixed $connection): self
{
$this->connection = (string) $connection;

Expand All @@ -67,10 +61,7 @@ public function getEventManager(): string
return 'doctrine.eventmanager.' . $this->eventManager;
}

/**
* @param mixed $eventManager
*/
public function setEventManager($eventManager): self
public function setEventManager(mixed $eventManager): self
{
$this->eventManager = (string) $eventManager;

Expand Down
6 changes: 2 additions & 4 deletions tests/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@

abstract class AbstractTest extends TestCase
{
/** @var mixed $application */
protected $application;
protected mixed $application;

/** @var mixed $serviceManager */
protected $serviceManager;
protected mixed $serviceManager;

protected function setUp(): void
{
Expand Down
35 changes: 9 additions & 26 deletions tests/Assets/Document/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,23 @@
/** @ODM\Document */
class Simple
{
/**
* @ODM\Id(strategy="UUID")
*
* @var mixed $id
*/
protected $id;

/**
* @ODM\Field(type="string")
*
* @var mixed $name
*/
protected $name;

/**
* @return mixed
*/
public function getId()
/** @ODM\Id(strategy="UUID") */
protected mixed $id;

/** @ODM\Field(type="string") */
protected mixed $name;

public function getId(): mixed
{
return $this->id;
}

/**
* @return mixed
*/
public function getName()
public function getName(): mixed
{
return $this->name;
}

/**
* @param mixed $name
*/
public function setName($name): void
public function setName(mixed $name): void
{
$this->name = (string) $name;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Doctrine/DoctrineObjectHydratorFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class DoctrineObjectHydratorFactoryTest extends TestCase
{
use ProphecyTrait;

/** @var ServiceLocatorInterface|MockObject */
protected $services;
protected ServiceLocatorInterface|MockObject $services;

protected function setUp(): void
{
Expand Down
4 changes: 1 addition & 3 deletions tests/Doctrine/PersistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use DoctrineMongoODMModuleTest\AbstractTest;
use DoctrineMongoODMModuleTest\Assets\Document\Simple;

use function get_class;

class PersistTest extends AbstractTest
{
public function testPersist(): void
Expand All @@ -22,7 +20,7 @@ public function testPersist(): void
$documentManager->flush();
$id = $simple->getId();

$repository = $documentManager->getRepository(get_class($simple));
$repository = $documentManager->getRepository($simple::class);
$simple = $repository->find($id);

$this->assertEquals('lucy', $simple->getName());
Expand Down

0 comments on commit 00b8241

Please sign in to comment.