Skip to content

Commit b4bd49d

Browse files
committed
Rewrite for new version of workshop
1 parent 20ffd00 commit b4bd49d

File tree

68 files changed

+870
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+870
-779
lines changed

.docker/runtime/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM php:8.3-alpine as build
2+
3+
RUN apk add --no-cache $PHPIZE_DEPS && \
4+
apk add --no-cache linux-headers
5+
6+
RUN docker-php-ext-install sockets
7+
8+
FROM php:8.3-alpine as final
9+
10+
COPY --from=build /usr/local/lib/php /usr/local/lib/php
11+
COPY --from=build /usr/local/etc/php /usr/local/etc/php
12+
13+
RUN apk add git
14+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer

.docker/runtime/docker-compose.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
runtime:
3+
image: php8appreciate-runtime
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
8+
user: ${UID}:${GID}
9+
10+
volumes:
11+
- type: bind
12+
source: ${SOLUTION}
13+
target: '/solution'
14+

.github/workflows/build.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ jobs:
3232
- name: Run phpunit tests
3333
run: |
3434
mkdir -p build/logs
35-
vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
36-
35+
PROCESS_FACTORY=host vendor/bin/phpunit
36+
PROCESS_FACTORY=docker vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
37+
3738
- name: Run phpcs
3839
run: composer cs
3940

app/config.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,21 @@
2828
HelloWorld::class => create(HelloWorld::class),
2929
HttpJsonApi::class => create(HttpJsonApi::class),
3030
MyFirstIo::class => factory(function (ContainerInterface $c) {
31-
return new MyFirstIo($c->get(Filesystem::class), FakerFactory::create());
31+
return new MyFirstIo(FakerFactory::create());
3232
}),
3333
FilteredLs::class => factory(function (ContainerInterface $c) {
3434
return new FilteredLs($c->get(Filesystem::class));
3535
}),
3636
ConcernedAboutSeparation::class => factory(function (ContainerInterface $c) {
3737
return new ConcernedAboutSeparation(
38-
$c->get(Filesystem::class),
3938
$c->get(Parser::class)
4039
);
4140
}),
4241
ArrayWeGo::class => factory(function (ContainerInterface $c) {
43-
return new ArrayWeGo($c->get(Filesystem::class), FakerFactory::create());
42+
return new ArrayWeGo(FakerFactory::create());
4443
}),
4544
ExceptionalCoding::class => factory(function (ContainerInterface $c) {
46-
return new ExceptionalCoding($c->get(Filesystem::class), FakerFactory::create());
45+
return new ExceptionalCoding(FakerFactory::create());
4746
}),
4847
DatabaseRead::class => factory(function (ContainerInterface $c) {
4948
return new DatabaseRead(FakerFactory::create());

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
],
1414
"require" : {
1515
"php" : ">=8.0",
16+
"ext-pdo": "*",
1617
"ext-pdo_sqlite": "*",
17-
"php-school/php-workshop": "dev-master",
18+
"php-school/php-workshop": "dev-docker-fixes",
1819
"ext-sockets": "*"
1920
},
2021
"require-dev": {

0 commit comments

Comments
 (0)