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

doctum does not yet support array shapes #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should build the doc on pull requests too. just not deploy it - see the if statement in the deploy step

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.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,11 +50,11 @@
/**
* 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
*/
public static function createFromArray($config): self

Check failure on line 57 in src/Core/UriComponents.php

View workflow job for this annotation

GitHub Actions / build

Invalid @param tag on "createFromArray": "array{stack: string, hash?: ?string, format?: ?string, filename?: ?string} $config" on "Rokka\Client\Core\UriComponents::createFromArray"

Check failure on line 57 in src/Core/UriComponents.php

View workflow job for this annotation

GitHub Actions / build

The "config" parameter of the method "createFromArray" is missing a @param tag on "Rokka\Client\Core\UriComponents::createFromArray"

Check failure on line 57 in src/Core/UriComponents.php

View workflow job for this annotation

GitHub Actions / build

The method "createFromArray" has "1" invalid @param tags. on "Rokka\Client\Core\UriComponents::createFromArray"
{
if (!isset($config['stack'])) {
throw new \RuntimeException('Stack has to be set');
Expand Down
8 changes: 4 additions & 4 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,12 @@
}

/**
* @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

Check failure on line 774 in src/Image.php

View workflow job for this annotation

GitHub Actions / build

Invalid @param tag on "addAutodescription": "array{force?: bool} $options if force is true, the description is generated again even if it already exists" on "Rokka\Client\Image::addAutodescription"

Check failure on line 774 in src/Image.php

View workflow job for this annotation

GitHub Actions / build

The method "addAutodescription" has "1" invalid @param tags. on "Rokka\Client\Image::addAutodescription"
{
$path = implode('/', [
self::SOURCEIMAGE_RESOURCE,
Expand Down
13 changes: 5 additions & 8 deletions src/UriHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,17 @@
* ]
* ```
*
* @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)
{
if (\is_array($components)) {

Check failure on line 115 in src/UriHelper.php

View workflow job for this annotation

GitHub Actions / build

Invalid @param tag on "composeUri": "array{stack: string, hash?: ?string, format?: ?string, filename?: ?string}|UriComponents $components" on "Rokka\Client\UriHelper::composeUri"

Check failure on line 115 in src/UriHelper.php

View workflow job for this annotation

GitHub Actions / build

The "components" parameter of the method "composeUri" is missing a @param tag on "Rokka\Client\UriHelper::composeUri"

Check failure on line 115 in src/UriHelper.php

View workflow job for this annotation

GitHub Actions / build

The method "composeUri" has "1" invalid @param tags. on "Rokka\Client\UriHelper::composeUri"
$components = UriComponents::createFromArray($components);
}
$stack = $components->getStack();
Expand Down Expand Up @@ -168,7 +166,6 @@
// 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