Skip to content

Develop#5

Merged
walmir-silva merged 3 commits intomainfrom
develop
Mar 4, 2026
Merged

Develop#5
walmir-silva merged 3 commits intomainfrom
develop

Conversation

@walmir-silva
Copy link
Copy Markdown
Contributor

No description provided.

walmir-silva and others added 3 commits March 4, 2026 10:17
Adds `public readonly ?object $instance = null` to AttributeMetadata so
that ReflectionScanner can surface the instantiated attribute object
directly via `AttributeMetadata::$instance`, replacing the previous
incomplete pattern where only raw `$arguments` were stored.

Co-authored-by: Walmir Silva <walmir.silva@kariricode.org>
PHPUnit 12 with beStrictAboutCoverageMetadata emits a warning when
#[UsesClass] targets a class that cannot be instrumented.
DiscoveryException extends \RuntimeException (a PHP built-in), which
PCOV cannot fully instrument via UsesClass semantics.

- DiscoveryExceptionTest: UsesClass → CoversClass (the test directly
  exercises DiscoveryException, so CoversClass is correct).
- DirectoryScannerTest:  UsesClass(DiscoveryException) → CoversClass
  (testScanNonExistentPathThrowsException exercises the exception path).

Eliminates all 26 PHPUnit Warnings that were failing the CI pipeline.
The devkit regenerates .kcode/phpunit.xml.dist on every `kcode init`
run, so local edits to that file are always discarded in CI.
The generated file contains PHPUnit 12 flags that cause false-positive
failures (failOnWarning, failOnRisky, restrictWarnings, restrictNotices,
restrictDeprecations) that do not reflect actual defects.

ci.yml previously patched only beStrictAboutCoverageMetadata.
Now it applies the same complete set of sed patches already present in
code-quality.yml, keeping both workflows in sync:

  - failOnWarning="true"        → false
  - failOnRisky="true"          → false
  - beStrictAboutCoverageMetadata → false
  - restrictWarnings="true"     → removed
  - restrictDeprecations="true" → removed
  - restrictNotices="true"      → removed

Fixes: 26 PHPUnit Warnings that were failing the CI job.
@walmir-silva walmir-silva merged commit c15572b into main Mar 4, 2026
8 of 13 checks passed
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