Skip to content

Commit b541405

Browse files
authored
Fixed broken documentation building script (#1294)
* Fixed broken documentation building script * Fixed references to non existing matrix values
1 parent 12f63b3 commit b541405

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/docs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,43 @@ jobs:
2828
- name: "Checkout"
2929
uses: "actions/checkout@v4"
3030

31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
tools: composer:v2
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1, post_max_size=32M, upload_max_filesize=32M
37+
extensions: :psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib, curl
38+
39+
- name: "Get Composer Cache Directory"
40+
id: composer-cache
41+
run: |
42+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
43+
44+
- name: "Cache Composer dependencies"
45+
uses: "actions/cache@v4"
46+
with:
47+
path: "${{ steps.composer-cache.outputs.dir }}"
48+
key: "php-8.2-locked-composer-${{ hashFiles('**/composer.lock') }}"
49+
restore-keys: |
50+
php-8.2-locked-composer-
51+
52+
- name: "Install dependencies"
53+
run: "composer install --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Build Docs"
56+
run: "composer build:docs"
57+
58+
- name: Check for uncommitted changes
59+
run: |
60+
if [[ -n "$(git status --porcelain)" ]]; then
61+
echo "Uncommitted changes detected, please run `composer build:docs` and commit the changes."
62+
git status
63+
exit 1
64+
else
65+
echo "No uncommitted changes."
66+
fi
67+
3168
- name: "MD Link Linter"
3269
uses: "docker://norberttech/md-link-linter:latest"
3370
with:

src/tools/documentation/src/Flow/Documentation/FunctionsExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Flow\Documentation;
66

77
use Flow\Documentation\Models\FunctionModel;
8-
use PhpParser\{NodeTraverser, ParserFactory};
8+
use PhpParser\{NodeTraverser, ParserFactory, PhpVersion};
99

1010
final class FunctionsExtractor
1111
{
@@ -20,7 +20,7 @@ public function __construct(
2020
*/
2121
public function extract(array $paths) : \Generator
2222
{
23-
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
23+
$parser = (new ParserFactory())->createForVersion(PhpVersion::fromComponents(8, 2));
2424

2525
$includedFiles = get_included_files();
2626

0 commit comments

Comments
 (0)