Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Run PHPStan
run: |
export PHP_VERSION="${{ matrix.PHP_VERSION }}"
docker run -v "$PWD:/app" -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --rm ghcr.io/phpstan/phpstan analyse /app/src --configuration phpstan.neon --error-format=github
docker run -v "$PWD:/app" -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --rm ghcr.io/phpstan/phpstan analyse /app/src --configuration phpstan$([ "$PHP_VERSION" = "71" ] && echo ".71" || echo "").neon --error-format=github

tests:
name: Tests
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FROM php:8.5 AS php85
RUN <<EOF
set -eux
apt-get update
apt-get install -y --no-install-recommends --no-install-suggests git libzip-dev
apt-get install -y --no-install-recommends --no-install-suggests git libzip-dev unzip
docker-php-ext-install zip
rm -rf /var/lib/apt/lists/*
EOF
Expand Down
4 changes: 0 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ services:
volumes:
- "./vendor${PHP_VERSION:-85}:/usr/src/app/vendor"
- .:/usr/src/app

# todo remove
- /Users/md/Documents/development/php--md-html-truncation:/tmp/php--md-html-truncation:ro
extra_hosts:
- "host.docker.internal:host-gateway"
entrypoint: ['sleep', '9000']
13 changes: 13 additions & 0 deletions phpstan-baseline.71.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
ignoreErrors:
-
message: '#^Parameter \#1 \$truncate of class MD\\Bridge\\Twig\\HTML\\Extension\\TruncateExtension constructor expects MD\\HTML\\Action\\TruncateInterface, PHPUnit\\Framework\\MockObject\\MockObject given\.$#'
identifier: argument.type
count: 5
path: tests/Functional/MD/Bridge/Twig/HTML/Extension/TruncateExtensionTest.php

-
message: '#^Parameter \#1 \$truncate of class MD\\Bridge\\Twig\\HTML\\Extension\\TruncateExtension constructor expects MD\\HTML\\Action\\TruncateInterface, PHPUnit\\Framework\\MockObject\\MockObject given\.$#'
identifier: argument.type
count: 3
path: tests/Unit/MD/Bridge/Twig/HTML/Extension/TruncateExtensionTest.php
3 changes: 3 additions & 0 deletions phpstan.71.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
includes:
- phpstan.neon
- phpstan-baseline.71.neon
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
includes:
- phpstan-baseline.neon

parameters:
paths:
- src
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ for PHP_VERSION in '71' '80' '85'; do
docker compose run -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --build --remove-orphans --env-from-file .env -e XDEBUG_MODE=coverage --entrypoint="bash -c 'composer install ; mv composer.lock composer.php$PHP_VERSION.lock'" run-tests
docker compose run -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --build --remove-orphans --env-from-file .env -e XDEBUG_MODE=coverage --entrypoint="/usr/src/app/vendor/bin/phpunit --configuration /usr/src/app/phpunit.php$(( PHP_VERSION == 85 ? 80 : PHP_VERSION )).xml.dist --coverage-text" run-tests
docker run -e "PHP_VERSION=$PHP_VERSION" -v "$PWD:/app" -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --rm -it ghcr.io/danog/psalm:latest /composer/vendor/bin/psalm --no-cache
docker run -e "PHP_VERSION=$PHP_VERSION" -v "$PWD:/app" -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --rm -it ghcr.io/phpstan/phpstan analyse --configuration phpstan.neon
docker run -e "PHP_VERSION=$PHP_VERSION" -v "$PWD:/app" -v "$PWD/vendor${PHP_VERSION}:/app/vendor" --rm -it ghcr.io/phpstan/phpstan analyse --configuration phpstan$([ "$PHP_VERSION" = "71" ] && echo ".71" || echo "").neon
done;
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function testGetFilters(): void # white/positive

# assert
self::assertContainsOnlyInstancesOf(TwigFilter::class, $filters);
/** @var array{0: TwigFilter} $filters */
self::assertCount(1, $filters);
self::assertSame('truncate_html_with_text_length', $filters[0]->getName());
self::assertSame([$truncate, 'withTextLength'], $filters[0]->getCallable());
Expand All @@ -64,6 +65,7 @@ public function testGetFunctions(): void # white/positive

# assert
self::assertContainsOnlyInstancesOf(TwigFunction::class, $functions);
/** @var array{0: TwigFunction} $functions */
self::assertCount(1, $functions);
self::assertSame('truncate_html_with_text_length', $functions[0]->getName());
self::assertSame([$truncate, 'withTextLength'], $functions[0]->getCallable());
Expand Down