Skip to content

Commit

Permalink
Merge pull request #4 from utopia-php/feat-php82
Browse files Browse the repository at this point in the history
Tests for PHP 8.2
  • Loading branch information
eldadfux authored Nov 2, 2023
2 parents 6c272da + 60ddab8 commit c11f37a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
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

0 comments on commit c11f37a

Please sign in to comment.