fix: update url method to check post type visibility - #96
Merged
Conversation
SimonvanWijhe
requested review from
Rovasch,
ShunLuk,
dtakken,
ictbeheer,
mvdhoek1 and
rivanuff
August 3, 2026 14:24
There was a problem hiding this comment.
Pull request overview
Updates PostData::url() to gate URL generation based on post type visibility (instead of per-post public visibility), aligning unit tests with the new behavior and adjusting PHPStan ignores for the current static analysis findings.
Changes:
- Switch
PostData::url()fromis_post_publicly_viewable($id)tois_post_type_viewable($postType). - Update
PostDataTestto mockis_post_type_viewable()and rename the related expectation. - Add a PHPStan
ignoreErrorsentry forfunction.alreadyNarrowedTypeinHasMeta.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/src/PostDataTest.php | Updates mocks/expectations to match the new visibility check used by url(). |
| src/PostData.php | Changes URL visibility gating and refines typing in dataClass() for PHPStan. |
| phpstan.neon.dist | Adds an ignore rule for newly observed PHPStan warnings in HasMeta. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SimonvanWijhe
force-pushed
the
fix/postdata-url
branch
from
August 3, 2026 14:42
d82e19f to
4743811
Compare
|
Coverage report for commit: 90f0803 Summary - Lines: 9.89% | Methods: 7.27%
🤖 comment via lucassabreu/comment-coverage-clover |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SimonvanWijhe
force-pushed
the
fix/postdata-url
branch
from
August 3, 2026 14:46
e07c944 to
fad6ed2
Compare
ictbeheer
approved these changes
Aug 3, 2026
mvdhoek1
approved these changes
Aug 4, 2026
Rovasch
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.