Skip to content

Commit 3f297fa

Browse files
committed
chore: update usage of PhelFunction public props
1 parent 85ef63c commit 3f297fa

File tree

3 files changed

+60
-41
lines changed

3 files changed

+60
-41
lines changed

build/src/php/FileGenerator/Application/ApiMarkdownGenerator.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function generate(): array
2626

2727
$groupedByNamespace = [];
2828
foreach ($phelFns as $fn) {
29-
$groupedByNamespace[$fn->namespace()][] = $fn;
29+
$groupedByNamespace[$fn->namespace][] = $fn;
3030
}
3131

3232
foreach ($groupedByNamespace as $namespace => $fns) {
@@ -36,13 +36,14 @@ public function generate(): array
3636
$result[] = "";
3737
$result[] = "## `{$namespace}`";
3838

39+
/** @var PhelFunction $fn */
3940
foreach ($fns as $fn) {
4041
$result[] = "### `{$fn->nameWithNamespace()}`";
41-
$result[] = $fn->doc();
42-
if ($fn->githubUrl() !== '') {
43-
$result[] = sprintf('<small>[[View source](%s)]</small>', $fn->githubUrl());
44-
} elseif ($fn->docUrl() !== '') {
45-
$result[] = sprintf('<small>[[Read more](%s)]</small>', $fn->docUrl());
42+
$result[] = $fn->doc;
43+
if ($fn->githubUrl !== '') {
44+
$result[] = sprintf('<small>[[View source](%s)]</small>', $fn->githubUrl);
45+
} elseif ($fn->docUrl !== '') {
46+
$result[] = sprintf('<small>[[Read more](%s)]</small>', $fn->docUrl);
4647
}
4748
}
4849
}

build/src/php/FileGenerator/Application/ApiSearchGenerator.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace PhelDocBuild\FileGenerator\Application;
66

77
use Phel\Api\ApiFacadeInterface;
8+
use Phel\Api\Transfer\PhelFunction;
89

910
final readonly class ApiSearchGenerator
1011
{
@@ -39,22 +40,22 @@ public function generateSearchIndex(): array
3940
$groupedPhelFns = $this->apiFacade->getPhelFunctions();
4041

4142
foreach ($groupedPhelFns as $fn) {
42-
$groupKey = $fn->groupKey();
43+
$groupKey = $fn->groupKey;
4344
$groupFnNameAppearances[$groupKey] ??= 0;
4445

4546
if ($groupFnNameAppearances[$groupKey] === 0) {
4647
$anchor = $groupKey;
4748
$groupFnNameAppearances[$groupKey]++;
4849
} else {
49-
$sanitizedFnName = str_replace(['/', ...self::SPECIAL_ENDING_CHARS], ['-', ''], $fn->name());
50+
$sanitizedFnName = str_replace(['/', ...self::SPECIAL_ENDING_CHARS], ['-', ''], $fn->name);
5051
$anchor = rtrim($sanitizedFnName, '-') . '-' . $groupFnNameAppearances[$groupKey]++;
5152
}
5253

5354
$result[] = [
54-
'id' => 'api_' . $fn->name(),
55+
'id' => 'api_' . $fn->name,
5556
'name' => $fn->nameWithNamespace(),
56-
'signature' => $fn->signature(),
57-
'desc' => $this->formatDescription($fn->description()),
57+
'signature' => $fn->signature,
58+
'desc' => $this->formatDescription($fn->description),
5859
'anchor' => $anchor,
5960
'type' => 'api',
6061
];

composer.lock

Lines changed: 47 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)