Skip to content

Commit

Permalink
DoctrineMiddleware tweaks
Browse files Browse the repository at this point in the history
add php8.4 to github actions
  • Loading branch information
bkdotcom committed Oct 14, 2024
1 parent ab109a3 commit 674d444
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
matrix:
# windows-latest, macOS-latest
operating-system: [ubuntu-latest]
php-version: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-version: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
name: PHP ${{ matrix.php-version }} Test on ${{ matrix.operating-system }}
# services:
# mysql:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Browser/javascript like console class for PHP

## Installation

This library supports PHP 5.4 - 8.3
This library supports PHP 5.4 - 8.4

It is installable and autoloadable via [Composer](https://getcomposer.org/) as [bdk/debug](https://packagist.org/packages/bdk/debug).

Expand Down Expand Up @@ -102,7 +102,7 @@ $monolog->critical('all your base are belong to them');

## Tests / Quality

![Supported PHP versions](https://img.shields.io/static/v1?label=PHP&message=5.4%20-%208.3&color=blue)
![Supported PHP versions](https://img.shields.io/static/v1?label=PHP&message=5.4%20-%208.4&color=blue)
![Build Status](https://img.shields.io/github/actions/workflow/status/bkdotcom/PHPDebugConsole/phpunit.yml.svg?branch=master&logo=github)
[![Codacy Score](https://img.shields.io/codacy/grade/e950849edfd9463b993386080d39875e/master.svg?logo=codacy)](https://app.codacy.com/gh/bkdotcom/PHPDebugConsole/dashboard)
[![Maintainability](https://img.shields.io/codeclimate/maintainability/bkdotcom/PHPDebugConsole.svg?logo=codeclimate)](https://codeclimate.com/github/bkdotcom/PHPDebugConsole)
Expand Down
5 changes: 3 additions & 2 deletions src/Debug/Collector/Doctrine/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private function buildDsn()
$params = \array_merge(array(
'dbname' => null,
'driver' => null,
'host' => null,
'host' => 'localhost',
'memory' => false,
'password' => null,
'user' => null,
Expand All @@ -147,7 +147,8 @@ private function buildDsn()
$keysNew = \array_values(\array_intersect_key($map, $rename));
$renamed = \array_combine($keysNew, \array_values($rename));
$parts = \array_merge($renamed, $params);
if ($params['memory']) {
if ($params['memory'] || $params['dbname'] === ':memory:') {
$params['memory'] = true;
$parts['path'] = ':memory:';
}
$parts['scheme'] = \str_replace('_', '-', $parts['scheme']);
Expand Down
4 changes: 2 additions & 2 deletions src/Debug/Collector/Doctrine/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class Statement extends AbstractStatementMiddleware
private $sql;

/** @var array<int,mixed>|array<string,mixed> */
private array $params = [];
private $params = [];

/** @var array<int,ParameterType>|array<string,ParameterType> */
private array $types = [];
private $types = [];

/**
* Constructor
Expand Down
7 changes: 4 additions & 3 deletions tests/Debug/Collector/DoctrineMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ public function getConnection()
return false;
}

$dsnParser = new \Doctrine\DBAL\Tools\DsnParser();
$params = $dsnParser->parse('pdo-sqlite:///:memory:');
$conn = DriverManager::getConnection(
$params,
array(
'dbname' => ':memory:',
'driver' => 'pdo_sqlite',
),
(new \Doctrine\DBAL\Configuration())->setMiddlewares([
new DoctrineMiddleware(),
])
Expand Down

0 comments on commit 674d444

Please sign in to comment.