Skip to content

Commit

Permalink
doctum does not yet support array shapes code-lts/doctum#56
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Jun 5, 2024
1 parent 79aa5e5 commit f006d72
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
env:
COMPOSER_FLAGS: "--prefer-lowest"
- php: '8.2'
- php: '8.3'

env:
COMPOSER_FLAGS: ${{ matrix.env.COMPOSER_FLAGS }}
Expand All @@ -32,7 +33,7 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install composer dependencies
run: |
Expand All @@ -44,4 +45,4 @@ jobs:
vendor/bin/phpunit
- name: composer audit
run: composer audit
run: composer audit
13 changes: 9 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: deploy documentation
name: documentation

on:
push:
branches: [master]
branches:
- master
pull_request:

jobs:
build:
Expand All @@ -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_BASE_REF }}
_DOCTUM_TEMPLATE_DIR: ./template/
with:
config-file: ./scripts/doctum-config.php
Expand All @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: composer lint
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install composer dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/Core/UriComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
13 changes: 5 additions & 8 deletions src/UriHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit f006d72

Please sign in to comment.