diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 4fe2036..b2b86c8 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -11,7 +11,7 @@ ARG USER_GID=${USER_UID} RUN groupadd --gid ${USER_GID} ${USERNAME} && \ useradd -s /bin/bash --uid ${USER_UID} --gid ${USERNAME} -m ${USERNAME} -COPY --from=composer:2.9 /usr/bin/composer /usr/bin/composer +COPY --from=composer:2.10 /usr/bin/composer /usr/bin/composer RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && \ bash /tmp/library-scripts/dev.sh "${USERNAME}" diff --git a/src/TestCase/Example.php b/src/TestCase/Example.php index e5eb9b8..4a72c5d 100755 --- a/src/TestCase/Example.php +++ b/src/TestCase/Example.php @@ -43,7 +43,7 @@ public function expectedOutput(): string foreach (\explode(PHP_EOL, $this->code) as $line) { \preg_match("/\/\/\s*@prints\s*(?[^\s].*)$/", $line, $matches); - if (\array_key_exists("text", $matches)) { + if ($matches !== []) { $expectedOutput[] = $matches["text"]; } } @@ -81,7 +81,7 @@ private static function expectedFailureFromLine(string $line): ?ExpectedFailure { \preg_match("/\/\/\s*@throws\s*(?[^ ]+)\s+(?[^\s].*[^\s])\s*/", $line, $matches); - if (!\array_key_exists("class", $matches) || !\array_key_exists("message", $matches)) { + if ($matches === []) { return null; }