Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite for new version of workshop #117

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .docker/runtime/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM php:8.3-alpine as build

RUN apk add --no-cache $PHPIZE_DEPS && \
apk add --no-cache linux-headers

RUN docker-php-ext-install sockets

FROM php:8.3-alpine as final

COPY --from=build /usr/local/lib/php /usr/local/lib/php
COPY --from=build /usr/local/etc/php /usr/local/etc/php

RUN apk add git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
14 changes: 14 additions & 0 deletions .docker/runtime/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
runtime:
image: php8appreciate-runtime
build:
context: .
dockerfile: Dockerfile

user: ${UID}:${GID}

volumes:
- type: bind
source: ${SOLUTION}
target: '/solution'

5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:
- name: Run phpunit tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml

PROCESS_FACTORY=host vendor/bin/phpunit
PROCESS_FACTORY=docker vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml

- name: Run phpcs
run: composer cs

Expand Down
7 changes: 3 additions & 4 deletions app/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,21 @@
HelloWorld::class => create(HelloWorld::class),
HttpJsonApi::class => create(HttpJsonApi::class),
MyFirstIo::class => factory(function (ContainerInterface $c) {
return new MyFirstIo($c->get(Filesystem::class), FakerFactory::create());
return new MyFirstIo(FakerFactory::create());
}),
FilteredLs::class => factory(function (ContainerInterface $c) {
return new FilteredLs($c->get(Filesystem::class));
}),
ConcernedAboutSeparation::class => factory(function (ContainerInterface $c) {
return new ConcernedAboutSeparation(
$c->get(Filesystem::class),
$c->get(Parser::class)
);
}),
ArrayWeGo::class => factory(function (ContainerInterface $c) {
return new ArrayWeGo($c->get(Filesystem::class), FakerFactory::create());
return new ArrayWeGo(FakerFactory::create());
}),
ExceptionalCoding::class => factory(function (ContainerInterface $c) {
return new ExceptionalCoding($c->get(Filesystem::class), FakerFactory::create());
return new ExceptionalCoding(FakerFactory::create());
}),
DatabaseRead::class => factory(function (ContainerInterface $c) {
return new DatabaseRead(FakerFactory::create());
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
],
"require" : {
"php" : ">=8.0",
"ext-pdo": "*",
"ext-pdo_sqlite": "*",
"php-school/php-workshop": "dev-master",
"php-school/php-workshop": "dev-docker-fixes",
"ext-sockets": "*"
},
"require-dev": {
Expand Down
Loading
Loading