Skip to content

Commit c5a1b16

Browse files
Bump php from 8.0-alpine to 8.1.0-alpine (#75)
1 parent b717273 commit c5a1b16

File tree

13 files changed

+52
-25
lines changed

13 files changed

+52
-25
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Image page: <https://hub.docker.com/_/php>
2-
FROM php:8.0-alpine
2+
FROM php:8.1.0-alpine
33

44
ENV COMPOSER_HOME="/tmp/composer"
55

66
# Image page: <https://hub.docker.com/_/composer>
7-
COPY --from=composer:2.1.3 /usr/bin/composer /usr/bin/composer
7+
COPY --from=composer:2.1.14 /usr/bin/composer /usr/bin/composer
88

99
# Image page: <https://hub.docker.com/r/spiralscout/roadrunner>
10-
COPY --from=spiralscout/roadrunner:2.3.1 /usr/bin/rr /usr/bin/rr
10+
COPY --from=spiralscout/roadrunner:2.6.1 /usr/bin/rr /usr/bin/rr
1111

1212
RUN set -x \
1313
&& apk add --no-cache binutils git \
1414
&& apk add --no-cache --virtual .build-deps autoconf pkgconf make g++ gcc 1>/dev/null \
1515
# install xdebug (for testing with code coverage), but do not enable it
16-
&& pecl install xdebug-3.0.4 1>/dev/null \
16+
&& pecl install xdebug-3.1.2 1>/dev/null \
1717
&& docker-php-ext-install sockets pcntl \
1818
&& apk del .build-deps \
1919
&& mkdir --parents --mode=777 /src ${COMPOSER_HOME}/cache/repo ${COMPOSER_HOME}/cache/files \

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"laravel/socialite": "^5.0",
5050
"laravel/telescope": "^4.5",
5151
"mockery/mockery": "^1.3.2",
52-
"phpstan/phpstan": "~0.12.80",
52+
"phpstan/phpstan": "~1.2",
5353
"phpunit/phpunit": "^8.0 || ^9.3",
5454
"livewire/livewire": "^2.7"
5555
},

helpers/helpers.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Container\Container;
88
use Spiral\RoadRunner\Http\PSR7Worker;
99
use Spiral\RoadRunnerLaravel\Dumper\Dumper;
10+
use Illuminate\Contracts\Container\BindingResolutionException;
1011

1112
if (!\function_exists('\\rr\\dump')) {
1213
/**
@@ -59,10 +60,16 @@ function dd(...$vars): void
5960
*
6061
* @return PSR7Worker
6162
*
62-
* @throws \Illuminate\Contracts\Container\BindingResolutionException If called outside of RR worker context
63+
* @throws BindingResolutionException If called outside of RR worker context
6364
*/
6465
function worker(): PSR7Worker
6566
{
66-
return Container::getInstance()->make(PSR7Worker::class);
67+
$worker = Container::getInstance()->make(PSR7Worker::class);
68+
69+
if ($worker instanceof PSR7Worker) {
70+
return $worker;
71+
}
72+
73+
throw new BindingResolutionException;
6774
}
6875
}

src/Console/Commands/StartCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class StartCommand extends \Symfony\Component\Console\Command\Command
3030

3131
/**
3232
* Create a new command instance.
33-
*
34-
* @var string|null $laravel_base_path
3533
*/
3634
public function __construct(?string $laravel_base_path = null)
3735
{

src/Dumper/Exceptions/DumperException.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,21 @@ public function render(?Request $request = null): Response
8282

8383
if ($this->stack->count() > 0) {
8484
foreach ($this->stack->all() as $item) {
85-
/* @var \Symfony\Component\VarDumper\Cloner\Data $item */
86-
$content = $this->renderer->dump($item, true) . \PHP_EOL . $content;
85+
if ($item instanceof \Symfony\Component\VarDumper\Cloner\Data) {
86+
$content = $this->renderer->dump($item, true) . \PHP_EOL . $content;
87+
}
8788
}
8889
} else {
8990
$content .= '(╯°□°)╯︵ ┻━┻';
9091
}
9192

92-
return new Response($this->generateView($content), $this->getCode());
93+
$code = Response::HTTP_INTERNAL_SERVER_ERROR;
94+
95+
if (\is_int($current_code = $this->getCode())) {
96+
$code = $current_code;
97+
}
98+
99+
return new Response($this->generateView($content), $code);
93100
}
94101

95102
/**

src/Dumper/Middleware.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ public function handle(Request $request, Closure $next)
4848
$dumped = '';
4949

5050
foreach ($this->stack->all() as $item) {
51-
/* @var \Symfony\Component\VarDumper\Cloner\Data $item */
52-
$dumped = $this->renderer->dump($item, true) . \PHP_EOL . $dumped;
51+
if ($item instanceof \Symfony\Component\VarDumper\Cloner\Data) {
52+
$dumped = $this->renderer->dump($item, true) . \PHP_EOL . $dumped;
53+
}
5354
}
5455

5556
$response->setContent($dumped . $response->getContent());

src/Listeners/ClearInstancesListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public function handle($event): void
2424

2525
if ($app instanceof Container) {
2626
/** @var ConfigRepository $config */
27-
$config = $app->make(ConfigRepository::class);
27+
$config = $app->make(ConfigRepository::class);
28+
29+
/** @var array<string> $abstracts */
2830
$abstracts = (array) $config->get(ServiceProvider::getConfigRootKey() . '.clear', []);
2931

3032
foreach ($abstracts as $abstract) {

src/Listeners/CloneConfigListener.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ public function handle($event): void
2020
if ($event instanceof WithApplication) {
2121
$app = $event->application();
2222

23-
$app->instance('config', clone $app->make(ConfigRepository::class));
23+
/** @var ConfigRepository $config */
24+
$config = $app->make(ConfigRepository::class);
25+
26+
$app->instance('config', clone $config);
2427
}
2528
}
2629
}

src/Listeners/FlushArrayCacheListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public function handle($event): void
3131
/** @var CacheManager $cache_manager */
3232
$cache_manager = $app->make($cache_abstract);
3333

34-
foreach ($config->get('cache.stores') as $name => $options) {
35-
if (($options['driver'] ?? '') === 'array') {
34+
foreach ((array) $config->get('cache.stores') as $name => $options) {
35+
if (\is_array($options) && ($options['driver'] ?? '') === 'array') {
3636
$cache_manager->store($name)->getStore()->flush();
3737
}
3838
}

src/Listeners/RebindMailManagerListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function handle($event): void
3131
return;
3232
}
3333

34-
/* @var MailManager $mail_manager */
34+
/** @var MailManager $mail_manager */
3535
$mail_manager = $app->make($mail_manager_abstract);
3636

3737
/**

0 commit comments

Comments
 (0)