Skip to content

Fix incorrect return type and PHP version in docs - #102

Merged
koriym merged 1 commit into
1.xfrom
codex/manual-review-fixes
Jun 25, 2026
Merged

koriym merged 1 commit into
1.xfrom
codex/manual-review-fixes

Conversation

@koriym

@koriym koriym commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Two factual corrections to the documentation:

  • docs/reference.md — a type: 'row' query returns null when no row matches (SqlQuery::getRow() returns null on an empty result set), so the example return type must be ?array, not array. This also aligns it with the other single-row examples in the same file (item(): User|null, find(): User|null).
  • docs/tutorial/README.ja.md (Ch.6) — readonly classes have been available since PHP 8.2, not 8.4.

Why

The reference example declared a non-nullable array return for a single-row query, which would raise a TypeError at runtime whenever the query matches no row. The tutorial cited the wrong PHP version for readonly classes.

Validation

  • ?array behavior verified against src/SqlQuery.php (getRow() returns null when the result set is empty).
  • readonly class availability confirmed as PHP 8.2.

Notes

Earlier revisions of this PR also changed the --no-dev install flow, autoload registration, extension prerequisites, and run.php output labels. Those were dropped as out-of-scope churn (the original install/autoload wording was already consistent, and the framework's required extensions are enforced by composer install), leaving only the two correctness fixes above.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates the Japanese tutorial wording for installation, autoload, PHP version, and expected-output labels, and clarifies the reference example’s getStats(string $id) return type as ?array when no row matches.

Changes

Documentation updates

Layer / File(s) Summary
Return type note
docs/reference.md
getStats(string $id) is documented as ?array, and the example notes null when no row matches.
Setup guidance
docs/tutorial/README.ja.md
The tutorial changes the install command, autoload example, and PHP version note.
Expected-output labels
docs/tutorial/README.ja.md
The tutorial updates the integrated run.php label text and Chapter 11 expected-output headings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • ray-di/Ray.MediaQuery#98: Updates the same tutorial file’s expected-output wording and “写経 run.php” label framing.

Poem

🐇 I nibble docs with tidy cheer,
?array shines bright and clear.
Install steps hop, labels align,
The run.php trail now reads just fine.
A soft little burrow, neat and near.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main documentation fixes: a return type correction and a PHP version note update.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/manual-review-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@koriym
koriym force-pushed the codex/manual-review-fixes branch from afce3bb to ec8c123 Compare June 25, 2026 07:59
@koriym
koriym marked this pull request as ready for review June 25, 2026 07:59
@koriym

koriym commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current 1.x as a single clean commit. @koriym

The previous branch carried the #99 b7cec4b ("Promote the Feature Reference into a full Manual") commit plus a merge commit; that content is already in 1.x, so I dropped it and re-applied just the documentation fixes on top of today's 1.x tip. git merge-tree is clean and the net diff is exactly the intended 2 files / 12 lines:

  • docs/reference.md: getStats(): ?array (null when no row matches)
  • docs/tutorial/README.ja.md: ext prerequisites, composer install --no-dev, autoload (not autoload-dev), readonly since PHP 8.2, clearer run.php output labels

The web-query pages from #107 are preserved. Ready for review.

@koriym

koriym commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@koriym
koriym force-pushed the codex/manual-review-fixes branch from ec8c123 to 1d3c5f2 Compare June 25, 2026 12:22
- reference.md: a type:'row' query returns null when no row matches
  (SqlQuery::getRow), so the example return type must be ?array, not array
- tutorial Ch.6: readonly classes are available since PHP 8.2, not 8.4
@koriym
koriym force-pushed the codex/manual-review-fixes branch from 1d3c5f2 to 29fc93f Compare June 25, 2026 12:26
@koriym koriym changed the title Fix manual and tutorial documentation Fix incorrect return type and PHP version in docs Jun 25, 2026
@koriym
koriym merged commit 78c2841 into 1.x Jun 25, 2026
28 checks passed
@koriym
koriym deleted the codex/manual-review-fixes branch June 25, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant