Skip to content

Commit 0df3e80

Browse files
authored
Feature: PHP 8.5 upgrade (#1208)
1 parent fd91f90 commit 0df3e80

13 files changed

Lines changed: 68 additions & 59 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Setup PHP
3434
uses: shivammathur/setup-php@v2
3535
with:
36-
php-version: 8.3
36+
php-version: 8.5
3737
tools: composer:v2
3838
coverage: none
3939

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
php-versions: ['8.3', '8.4']
20+
php-versions: ['8.3', '8.4', '8.5']
2121

2222
services:
2323
# Postgres is started for the Feature suite. The Unit suite does not need
@@ -55,7 +55,7 @@ jobs:
5555
uses: shivammathur/setup-php@v2
5656
with:
5757
php-version: ${{ matrix.php-versions }}
58-
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, pdo_pgsql, pgsql, tokenizer
58+
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, pdo_pgsql, pgsql, tokenizer, gd
5959
ini-values: post_max_size=256M, upload_max_filesize=256M
6060
coverage: none
6161

Dockerfile.all-in-one

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ COPY ./VERSION /app/VERSION
1515
RUN yarn install --network-timeout 600000 --frozen-lockfile && yarn build
1616

1717
# Use stable multi-arch serversideup/php image
18-
FROM serversideup/php:8.3-fpm-alpine
18+
FROM serversideup/php:8.5-fpm-alpine
1919

2020
ENV PHP_OPCACHE_ENABLE=1
2121

2222
# Switch to root for installing extensions and packages
2323
USER root
2424

25-
RUN install-php-extensions intl
25+
RUN install-php-extensions intl gd
2626

2727
RUN apk add --no-cache nodejs yarn nginx supervisor dos2unix
2828

backend/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM serversideup/php:8.4-fpm-nginx-alpine
1+
FROM serversideup/php:8.5-fpm-nginx-alpine
22

33
ENV PHP_OPCACHE_ENABLE=1
44

@@ -9,7 +9,7 @@ RUN echo "" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf && \
99
echo "user = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf && \
1010
echo "group = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf
1111

12-
RUN install-php-extensions intl imagick
12+
RUN install-php-extensions intl imagick gd
1313

1414
COPY --chown=www-data:www-data . .
1515

backend/Dockerfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM serversideup/php:8.4-fpm-nginx-alpine
1+
FROM serversideup/php:8.5-fpm-nginx-alpine
22

33
ENV PHP_OPCACHE_ENABLE=1
44
ENV NGINX_WEBROOT=/var/www/html/public
@@ -12,7 +12,7 @@ COPY --chown=www-data:www-data . /var/www/html
1212

1313
# Switch to root user to install PHP extensions
1414
USER root
15-
RUN install-php-extensions intl imagick
15+
RUN install-php-extensions intl imagick gd
1616
USER www-data
1717

1818
RUN chmod -R 755 /var/www/html/storage \

backend/app/Exports/AffiliatesExport.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
use Carbon\Carbon;
66
use HiEvents\DomainObjects\AffiliateDomainObject;
7-
use HiEvents\Resources\Affiliate\AffiliateResource;
8-
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
97
use Illuminate\Pagination\LengthAwarePaginator;
8+
use Illuminate\Support\Collection;
109
use Maatwebsite\Excel\Concerns\FromCollection;
1110
use Maatwebsite\Excel\Concerns\WithHeadings;
1211
use Maatwebsite\Excel\Concerns\WithMapping;
@@ -23,9 +22,9 @@ public function withData(LengthAwarePaginator $affiliates): AffiliatesExport
2322
return $this;
2423
}
2524

26-
public function collection(): AnonymousResourceCollection
25+
public function collection(): Collection
2726
{
28-
return AffiliateResource::collection($this->affiliates);
27+
return collect($this->affiliates->items());
2928
}
3029

3130
public function headings(): array

backend/app/Exports/AttendeesExport.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
use HiEvents\DomainObjects\ProductDomainObject;
1111
use HiEvents\DomainObjects\ProductPriceDomainObject;
1212
use HiEvents\DomainObjects\QuestionDomainObject;
13-
use HiEvents\Resources\Attendee\AttendeeResource;
1413
use HiEvents\Services\Domain\Question\QuestionAnswerFormatter;
1514
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
16-
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
1715
use Illuminate\Support\Collection;
1816
use Maatwebsite\Excel\Concerns\FromCollection;
1917
use Maatwebsite\Excel\Concerns\WithHeadings;
@@ -39,9 +37,11 @@ public function withData(LengthAwarePaginator|Collection $data, Collection $prod
3937
return $this;
4038
}
4139

42-
public function collection(): AnonymousResourceCollection
40+
public function collection(): Collection
4341
{
44-
return AttendeeResource::collection($this->data);
42+
return $this->data instanceof Collection
43+
? $this->data
44+
: collect($this->data->items());
4545
}
4646

4747
public function headings(): array

backend/app/Exports/OrdersExport.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
use HiEvents\DomainObjects\OrderDomainObject;
99
use HiEvents\DomainObjects\OrderItemDomainObject;
1010
use HiEvents\DomainObjects\QuestionDomainObject;
11-
use HiEvents\Resources\Order\OrderResource;
1211
use HiEvents\Services\Domain\Question\QuestionAnswerFormatter;
13-
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
1412
use Illuminate\Pagination\LengthAwarePaginator;
1513
use Illuminate\Support\Collection;
1614
use Maatwebsite\Excel\Concerns\FromCollection;
@@ -35,9 +33,9 @@ public function withData(LengthAwarePaginator $orders, Collection $questions): O
3533
return $this;
3634
}
3735

38-
public function collection(): AnonymousResourceCollection
36+
public function collection(): Collection
3937
{
40-
return OrderResource::collection($this->orders);
38+
return collect($this->orders->items());
4139
}
4240

4341
public function headings(): array

backend/app/Exports/PromoCodesExport.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace HiEvents\Exports;
44

5-
use HiEvents\Resources\PromoCode\PromoCodeResource;
5+
use Illuminate\Support\Collection;
66
use Maatwebsite\Excel\Concerns\FromCollection;
77
use Maatwebsite\Excel\Concerns\WithHeadings;
88
use Maatwebsite\Excel\Concerns\WithMapping;
@@ -19,9 +19,11 @@ public function withData($data): PromoCodesExport
1919
return $this;
2020
}
2121

22-
public function collection()
22+
public function collection(): Collection
2323
{
24-
return PromoCodeResource::collection($this->data);
24+
return $this->data instanceof Collection
25+
? $this->data
26+
: collect(is_array($this->data) ? $this->data : $this->data->items());
2527
}
2628

2729
public function headings(): array

backend/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"laravel/vapor-core": "^2.37",
2222
"league/flysystem-aws-s3-v3": "^3.0",
2323
"liquid/liquid": "^1.4",
24-
"maatwebsite/excel": "^3.1",
24+
"maatwebsite/excel": "4.x-dev",
2525
"nette/php-generator": "^4.0",
2626
"php-open-source-saver/jwt-auth": "^2.1",
2727
"sentry/sentry-laravel": "^4.13",
@@ -90,7 +90,7 @@
9090
"php-http/discovery": true
9191
}
9292
},
93-
"minimum-stability": "stable",
93+
"minimum-stability": "dev",
9494
"prefer-stable": true,
9595
"repositories": [
9696
{

0 commit comments

Comments
 (0)