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

Tests for PHP 8.2 #4

Merged
merged 6 commits into from
Nov 2, 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
18 changes: 13 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ on: [pull_request]

jobs:
lint:
name: Run Linter
name: Run Linter on PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
matrix:
php: ['8.0', '8.1', '8.2']

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: ${{ matrix.php }}

- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -26,14 +30,18 @@ jobs:
- run: composer lint

tests:
name: Run Unit Tests
name: Run Unit Tests on PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
matrix:
php: ['8.0', '8.1', '8.2']

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: ${{ matrix.php }}

- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -45,4 +53,4 @@ jobs:
- name: Install dependencies
run: composer update --ignore-platform-reqs --optimize-autoloader --no-plugins --no-scripts --prefer-dist

- run: composer test
- run: composer test
4 changes: 2 additions & 2 deletions src/DSN/DSN.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function __construct(string $dsn)
$this->scheme = $parts['scheme'] ?? null;
$this->user = isset($parts['user']) ? \urldecode($parts['user']) : null;
$this->password = isset($parts['pass']) ? \urldecode($parts['pass']) : null;
$this->host = $parts['host'] ?? null;
$this->host = $parts['host'] ?? '';
$this->port = $parts['port'] ?? null;
$this->path = isset($parts['path']) ? ltrim($parts['path'], '/') : null;
$this->path = isset($parts['path']) ? ltrim((string) $parts['path'], '/') : '';
$this->query = $parts['query'] ?? null;
}

Expand Down