Skip to content

Commit

Permalink
Rewrite for new version of workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
AydinHassan committed May 25, 2024
1 parent 20ffd00 commit b4bd49d
Show file tree
Hide file tree
Showing 68 changed files with 870 additions and 779 deletions.
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

0 comments on commit b4bd49d

Please sign in to comment.