diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 318c7b6..e75d363 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: env: COMPOSER_FLAGS: "--prefer-lowest" - php: '8.2' + - php: '8.3' env: COMPOSER_FLAGS: ${{ matrix.env.COMPOSER_FLAGS }} @@ -32,7 +33,7 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install composer dependencies run: | @@ -44,4 +45,4 @@ jobs: vendor/bin/phpunit - name: composer audit - run: composer audit \ No newline at end of file + run: composer audit diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d604ef8..6347699 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,8 +1,10 @@ -name: deploy documentation +name: documentation on: push: - branches: [master] + branches: + - master + pull_request: jobs: build: @@ -18,14 +20,16 @@ jobs: php-version: '8.1' - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Prepate documentation with doctum + - name: Prepare documentation with doctum run: ./scripts/prepare_doctum_docs_on_github.sh - name: build doctum docs uses: sudo-bot/action-doctum@v5 env: + # the GITHUB_BASE_REF is only set in pull requests but not in pushes to the master branch, so this should work as expected in doctum-config.php + _DOCTUM_BRANCH: ${{ github.GITHUB_BASE_REF }} _DOCTUM_TEMPLATE_DIR: ./template/ with: config-file: ./scripts/doctum-config.php @@ -35,6 +39,7 @@ jobs: cli-args: "--output-format=github --no-ansi --no-progress -v" - name: Deploy + if: github.ref == 'refs/head/master' uses: reggionick/s3-deploy@v3 with: folder: doctum-output/build/ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ac72d71..a461c77 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,11 +24,11 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install composer dependencies run: | composer update --prefer-dist --no-interaction --no-progress --no-ansi ${COMPOSER_FLAGS} - name: PHP CS Fixer Tests - run: composer lint \ No newline at end of file + run: composer lint diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 03fbdfe..90953e1 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -28,7 +28,7 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install composer dependencies run: | diff --git a/src/Core/UriComponents.php b/src/Core/UriComponents.php index 8280bd0..317ca27 100644 --- a/src/Core/UriComponents.php +++ b/src/Core/UriComponents.php @@ -50,7 +50,7 @@ public function __construct($stack, $hash = null, $format = null, $filename = nu /** * Creates a UriComponent object from an array with 'stack', 'hash', 'format', 'filename' and 'stack' as keys. * - * @param array{stack: string, hash?: ?string, format?: ?string, filename?: ?string} $config + * @param array $config array shape array{stack: string, hash?: ?string, format?: ?string, filename?: ?string} (not yet supported by doctum) * * @since 1.2.0 */ diff --git a/src/Image.php b/src/Image.php index 1d3ad6f..ae93541 100644 --- a/src/Image.php +++ b/src/Image.php @@ -766,10 +766,10 @@ public function addAutolabels($hash, $organization = null): SourceImage } /** - * @param string[] $languages - * @param string $hash - * @param string|null $organization - * @param array{force?: bool} $options if force is true, the description is generated again even if it already exists + * @param string[] $languages + * @param string $hash + * @param string|null $organization + * @param array $options if force is true, the description is generated again even if it already exists. array shape array{force?: bool} (not yet supported by doctum) */ public function addAutodescription($languages, $hash, $organization = null, array $options = []): SourceImage { diff --git a/src/UriHelper.php b/src/UriHelper.php index f545652..4b03104 100644 --- a/src/UriHelper.php +++ b/src/UriHelper.php @@ -102,15 +102,13 @@ public static function addOptionsToUri(UriInterface $uri, $options, $shortNames * ] * ``` * - * @since 1.2.0 - * - * @param array{stack: string, hash?: ?string, format?: ?string, filename?: ?string}|UriComponents $components - * @param UriInterface $uri If this is provided, it will change the path for that object and return - * @param bool $shortNames if short names (like o for option or v for variables) should be used - * - * @throws \RuntimeException + * @param array|UriComponents $components array shape is array{stack: string, hash?: ?string, format?: ?string, filename?: ?string} (not yet supported by doctum) + * @param UriInterface|null $uri If this is provided, it will change the path for that object and return + * @param bool $shortNames if short names (like o for option or v for variables) should be used * * @return UriInterface + * + * @since 1.2.0 */ public static function composeUri($components, ?UriInterface $uri = null, $shortNames = true) { @@ -168,7 +166,6 @@ public static function decomposeUri(UriInterface $uri) // remote_path without seo-filename || preg_match('#^/'.$stackPattern.'/'.$pathPattern.'.'.$formatPattern.'$#', $path, $matches) ) { - // @phpstan-ignore-next-line argument.type $uriComponents = UriComponents::createFromArray($matches); $inQuery = Query::parse($uri->getQuery());