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

Update dependency php to ~8.3.1 #337

Merged
merged 4 commits into from
Dec 30, 2023
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/build/
.phpunit.result.cache
/bin/plantuml.jar
node_modules
19 changes: 10 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ FROM composer:2.6.6 AS composer-base-image
FROM node:21.5.0 AS npm-base-image
FROM ubuntu:22.04 AS ubuntu-base-image


FROM npm-base-image AS npm-dependencies

WORKDIR /build
Expand All @@ -28,18 +27,18 @@ RUN \
&& apt-get -y upgrade \
&& apt-get install -y --no-install-recommends software-properties-common gnupg curl \
&& add-apt-repository --yes ppa:ondrej/php \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -sL https://deb.nodesource.com/setup_21.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
binutils \
graphviz \
php8.2-cli \
php8.2-zip \
php8.2-mbstring \
php8.2-xml \
php8.2-curl \
php8.2-gd \
php8.3-cli \
php8.3-zip \
php8.3-mbstring \
php8.3-xml \
php8.3-curl \
php8.3-gd \
nodejs \
openjdk-18-jre \
xfonts-75dpi \
Expand Down Expand Up @@ -90,7 +89,9 @@ COPY --link ./bin ./bin
COPY --link --from=npm-dependencies /build/node_modules node_modules

RUN ln -s /app/node_modules/.bin/marked /usr/local/bin/marked \
&& ln -s /app/node_modules/.bin/redoc-cli /usr/local/bin/redoc-cli
&& marked --version \
&& ln -s /app/node_modules/.bin/redoc-cli /usr/local/bin/redoc-cli \
&& redoc-cli --version

ENV DOCBOOK_TOOL_CONTENT_PATH=/docs-src/book \
DOCBOOK_TOOL_TEMPLATE_PATH=/docs-src/templates \
Expand Down
2 changes: 1 addition & 1 deletion bin/docbook-tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

$pageFormatters = [
new ExtractFrontMatter($logger),
new InlineExternalImages($contentPath, $logger),
new InlineExternalImages($logger),
new RenderPlantUmlDiagramInline($logger),
new MarkdownToHtml($logger),
];
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "~8.2.8",
"php": "~8.3.1",
"ext-gd": "*",
"guzzlehttp/guzzle": "^7.8.1",
"guzzlehttp/psr7": "^2.6.2",
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<testsuites>
<testsuite name="integration">
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="true"
>
<projectFiles>
<directory name="src" />
Expand Down
2 changes: 1 addition & 1 deletion src/Formatter/InlineExternalImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

final class InlineExternalImages implements PageFormatter
{
public function __construct(private readonly string $docbookPath, private readonly LoggerInterface $logger)
public function __construct(private readonly LoggerInterface $logger)
{
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/DocbookToolGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testGeneration(): void
[
new AggregatePageFormatter([
new ExtractFrontMatter($logger),
new InlineExternalImages(self::CONTENT_PATH, $logger),
new InlineExternalImages($logger),
new RenderPlantUmlDiagramInline($logger),
new MarkdownToHtml($logger),
new InlineFeatureFile(self::FEATURES_PATH, $logger),
Expand Down
8 changes: 4 additions & 4 deletions test/unit/Formatter/InlineExternalImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testExternalImagesAreInlined(string $contentPath, string $imageP

$page = DocbookPage::fromSlugAndContent($contentPath . '/faked.md', 'slug', $markdown);

$formattedPage = (new InlineExternalImages($contentPath, new NullLogger()))($page);
$formattedPage = (new InlineExternalImages(new NullLogger()))($page);

$expectedOutput = sprintf(
<<<'MD'
Expand All @@ -100,7 +100,7 @@ public function testExternalPumlIsInlined(): void

$page = DocbookPage::fromSlugAndContent($contentPath . '/faked.md', 'slug', $markdown);

$formattedPage = (new InlineExternalImages($contentPath, new NullLogger()))($page);
$formattedPage = (new InlineExternalImages(new NullLogger()))($page);

self::assertSame(
<<<'MD'
Expand All @@ -120,7 +120,7 @@ public function testImageNotExisting(): void
{
$this->expectException(FilesystemException::class);

(new InlineExternalImages(__DIR__ . '/../../fixture/docbook', new NullLogger()))(
(new InlineExternalImages(new NullLogger()))(
DocbookPage::fromSlugAndContent(__DIR__ . '/faked.md', 'slug', '![the alt text](something-that-should-not-exist.jpg)'),
);
}
Expand All @@ -130,7 +130,7 @@ public function testImageMimeTypeNotDetected(): void
$contentPath = __DIR__ . '/../../fixture/docbook';
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Unable to determine mime type');
(new InlineExternalImages($contentPath, new NullLogger()))(
(new InlineExternalImages(new NullLogger()))(
DocbookPage::fromSlugAndContent($contentPath . '/faked.md', 'slug', '![the alt text](test.md)'),
);
}
Expand Down