Skip to content

Commit aa6f2d4

Browse files
committed
fix(ci): add null to optional arguments
1 parent 397444c commit aa6f2d4

File tree

10 files changed

+59
-15
lines changed

10 files changed

+59
-15
lines changed

.docker/base/php84/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM php:8.4-fpm
2+
3+
USER root
4+
5+
# install system packages
6+
RUN apt-get update \
7+
&& apt-get -y install git wget \
8+
&& apt-get install -qqy libzip-dev libpng-dev libjpeg-dev libfreetype6-dev \
9+
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
10+
11+
# configure php packages
12+
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
13+
14+
# install php requirements
15+
RUN docker-php-ext-install zip iconv gd
16+
17+
# install xdebug
18+
RUN pecl install xdebug \
19+
&& docker-php-ext-enable xdebug
20+
21+
COPY --from=composer:2.8 /usr/bin/composer /usr/local/bin/composer

.docker/development/php84/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM pugx/poser:php84
2+
3+
USER root
4+
5+
WORKDIR "/application"

.github/workflows/php.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,33 @@ on:
88

99
jobs:
1010
cs-fix:
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
name: PHP-CS-Fixer
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616
- name: Fix CS
1717
uses: docker://oskarstark/php-cs-fixer-ga
18+
with:
19+
args: --diff --dry-run
1820

1921
build:
2022

2123
strategy:
2224
matrix:
2325
container: [ "php81", "php82", "php83" ]
2426

25-
runs-on: ubuntu-latest
27+
runs-on: ubuntu-24.04
2628
container: pugx/poser:${{ matrix.container }}
2729
steps:
28-
- uses: actions/checkout@v3
30+
- uses: actions/checkout@v4
2931

3032
- name: Validate composer.json
3133
run: composer validate
3234

3335
- name: Cache Composer packages
3436
id: composer-cache
35-
uses: actions/cache@v3
37+
uses: actions/cache@v4
3638
with:
3739
path: vendor
3840
key: ${{ runner.os }}-php-${{ matrix.container }}-${{ hashFiles('**/composer.lock') }}

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,13 @@ $ docker buildx build \
7474
.
7575
```
7676

77+
## Build a new PHP image on Linux
78+
79+
* create a new PHP conf, e.g. `.docker/base/php84/Dockerfile` and `.docker/development/php84/Dockerfile `
80+
* `docker build -t poser-php84 --pull=false .docker/base/php84`
81+
* `docker login`
82+
* `docker tag poser-php84 pugx/poser:php84`
83+
* `docker push pugx/poser:php84`
84+
85+
7786
## ENJOY

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"repositories": [
2929
{
3030
"type": "vcs",
31-
"url": "https://github.com/JellyBellyDev/phpspec-data-provider-extension"
31+
"url": "https://github.com/madisoft/phpspec-data-provider-extension"
3232
}
3333
],
3434
"require": {
@@ -41,10 +41,10 @@
4141
},
4242
"require-dev": {
4343
"behat/behat": "^3.13",
44-
"phpspec/phpspec": "^7.4",
4544
"friends-of-phpspec/phpspec-code-coverage": "^6.3",
4645
"friendsofphp/php-cs-fixer": "^3.41",
47-
"moave/phpspec-data-provider-extension": "dev-feat/add-compatibility-to-php80",
46+
"moave/phpspec-data-provider-extension": "dev-master",
47+
"phpspec/phpspec": "^7.4 || ^8.0",
4848
"vimeo/psalm": "^4.30"
4949
},
5050
"config": {

docker-compose.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3.7'
21
services:
32

43
php81:
@@ -24,3 +23,11 @@ services:
2423
stdin_open: true
2524
volumes:
2625
- .:/application:cached
26+
27+
php84:
28+
build:
29+
context: .docker/development/php84
30+
working_dir: /application
31+
stdin_open: true
32+
volumes:
33+
- .:/application:cached

src/Render/LocalSvgRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class LocalSvgRenderer implements RenderInterface
2929
private TextSizeCalculatorInterface $textSizeCalculator;
3030
private string $templatesDirectory;
3131

32-
public function __construct(TextSizeCalculatorInterface $textSizeCalculator = null, string $templatesDirectory = null)
32+
public function __construct(?TextSizeCalculatorInterface $textSizeCalculator = null, ?string $templatesDirectory = null)
3333
{
3434
$this->textSizeCalculator = $textSizeCalculator ?? new GDTextSizeCalculator();
3535
$this->templatesDirectory = $templatesDirectory ?? (__DIR__ . '/../Resources/templates');

src/Render/SvgForTheBadgeRenderer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class SvgForTheBadgeRenderer extends LocalSvgRenderer
2626
private \EasySVG $easy;
2727

2828
public function __construct(
29-
\EasySVG $easySVG = null,
30-
TextSizeCalculatorInterface $textSizeCalculator = null,
31-
string $templatesDirectory = null
29+
?\EasySVG $easySVG = null,
30+
?TextSizeCalculatorInterface $textSizeCalculator = null,
31+
?string $templatesDirectory = null
3232
) {
3333
parent::__construct($textSizeCalculator, $templatesDirectory);
3434

src/UI/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Command extends BaseCommand
2929

3030
protected string $header;
3131

32-
public function __construct(string $name = null)
32+
public function __construct(?string $name = null)
3333
{
3434
parent::__construct($name);
3535

src/ValueObject/InputRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function createFromInput(InputInterface $input): self
5353
}
5454

5555
if (!\is_string($format)) {
56-
$format = BADGE::DEFAULT_FORMAT;
56+
$format = Badge::DEFAULT_FORMAT;
5757
}
5858

5959
return new self($subject, $status, $color, $style, $format);

0 commit comments

Comments
 (0)