Skip to content

Commit 2209dd1

Browse files
committed
Migrate to PHP 8.1
1 parent 1c8d730 commit 2209dd1

File tree

6 files changed

+33
-68
lines changed

6 files changed

+33
-68
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php-versions: [ '8.0', '8.1' ]
11+
php-versions: [ '8.1', '8.2' ]
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
FROM php:8.0-cli-alpine
1+
FROM php:8.1-cli-alpine
22

33
RUN curl -Ss https://getcomposer.org/installer | php && \
44
mv composer.phar /usr/bin/composer
55

6+
RUN apk add --update linux-headers
67
RUN apk add --no-cache $PHPIZE_DEPS && \
78
pecl install xdebug && \
89
docker-php-ext-enable xdebug && \
910
echo "xdebug.enable=1" >> /usr/local/etc/php/php.ini && \
1011
echo "xdebug.mode=debug" >> /usr/local/etc/php/php.ini && \
11-
echo "xdebug.client_host=\"10.20.30.40\"" >> /usr/local/etc/php/php.ini && \
12-
echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/php.ini
12+
echo "xdebug.discover_client_host = yes" >> /usr/local/etc/php/php.ini && \
13+
echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/php.ini && \
14+
echo "xdebug.log_level = 0" >> /usr/local/etc/php/php.ini && \
15+
echo "xdebug.start_with_request = yes" >> /usr/local/etc/php/php.ini
1316

1417
RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/php.ini && \
1518
echo "display_errors = On" >> /usr/local/etc/php/php.ini && \

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
],
1414
"require": {
1515
"php": "^8.0",
16-
"illuminate/support": "^v9.11"
16+
"illuminate/support": "^v10.13"
1717
},
1818
"require-dev": {
19-
"laravel/framework": "^v9.11",
20-
"laravel/lumen-framework": "^9.0",
21-
"phpunit/phpunit": "^9.5",
22-
"orchestra/testbench": "^v7.4",
23-
"nunomaduro/larastan": "^2.1",
24-
"phpstan/phpstan-phpunit": "^1.1"
19+
"laravel/framework": "^v10.13",
20+
"laravel/lumen-framework": "^10.0",
21+
"phpunit/phpunit": "^10.2",
22+
"orchestra/testbench": "^v8.5",
23+
"nunomaduro/larastan": "^2.6",
24+
"phpstan/phpstan-phpunit": "^1.3"
2525
},
2626
"autoload": {
2727
"psr-4": {

phpunit.xml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="phpunit.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnError="false"
11-
stopOnFailure="false"
12-
verbose="true"
13-
>
14-
<testsuites>
15-
<testsuite name="Database Connection String Parser Test Suite">
16-
<directory>./tests/</directory>
17-
</testsuite>
18-
</testsuites>
19-
<filter>
20-
<whitelist>
21-
<directory>./src</directory>
22-
</whitelist>
23-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="phpunit.php" colors="true" processIsolation="false" stopOnError="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage/>
4+
<testsuites>
5+
<testsuite name="Database Connection String Parser Test Suite">
6+
<directory>./tests/</directory>
7+
</testsuite>
8+
</testsuites>
9+
<source>
10+
<include>
11+
<directory>./src</directory>
12+
</include>
13+
</source>
2414
</phpunit>

src/ValueObjects/Connection.php

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,12 @@
44

55
class Connection
66
{
7-
/**
8-
* @var string
9-
*/
10-
private $scheme;
11-
/**
12-
* @var string
13-
*/
14-
private $username;
15-
/**
16-
* @var string
17-
*/
18-
private $password;
19-
/**
20-
* @var string
21-
*/
22-
private $host;
23-
/**
24-
* @var int
25-
*/
26-
private $port;
27-
/**
28-
* @var string
29-
*/
30-
private $database;
7+
private string $scheme;
8+
private string $username;
9+
private string $password;
10+
private string $host;
11+
private int $port;
12+
private string $database;
3113

3214
public function __construct()
3315
{

tests/ConnectionStringParserTest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,7 @@ public function getConnectionStringParserFromContainer(): void
2424
$this->assertInstanceOf(ConnectionStringParser::class, $this->parser);
2525
}
2626

27-
/**
28-
* @test
29-
*/
30-
public function parseReturnWithAConnectionObject(): void
31-
{
32-
$connection = $this->parser->parse('postgres://username:password@host:5432/database');
33-
34-
$this->assertInstanceOf(Connection::class, $connection);
35-
}
36-
37-
public function connectionStringProvider(): array
27+
public static function connectionStringProvider(): array
3828
{
3929
return [
4030
[

0 commit comments

Comments
 (0)