Skip to content

Releases: suzumaze/bear-phpactor-extension

v0.3.8

Choose a tag to compare

@suzumaze suzumaze released this 03 Nov 11:03
97915f8
  • Response body names are found in methods that return early. An if without else whose
    block ends in return $this; (optionally after assigning one literal-key body) no longer makes
    the method unsupported; names describe the path that reaches the end, and earlyExits lists
    each guard with its line and the body there. A $this helper call inside the right-hand side of
    the full $this->body = [...] assignment is also accepted, since it runs before the body is
    written. Contract comparison and its diagnostics now cover these methods.

  • Diagnostics report a full $this->body = ... assignment in a method with #[Embed], which drops
    the embedded keys: embed_body_replaced_on_early_exit inside a block that leaves the method with
    return or throw (usually an intentional error body), embed_body_replaced everywhere else.
    Closures, arrow functions and anonymous classes are not counted. bear/resource/describe shows
    the same as responseBody.embedReplacements.

  • Resource references, incoming relations, and the relations and Resource calls in a Resource
    description carry the 1-based line of their position next to the byte offset or range, so the
    place can be passed on to a person. Other byte positions (attribute ranges, schema titles, ALPS
    descriptors, DI declarations) are unchanged.

  • Provenance for those three requests lists each file once without a byte range, since every item
    already carries its own position. Previously each item's position was repeated in provenance; for
    an incoming relation it appeared as a zero-length range at the attribute's start. On BEAR.Kata,
    app://self/article references with limit 5 shrink from 118 to 98 lines of JSON.

v0.3.7

Choose a tag to compare

@suzumaze suzumaze released this 31 Oct 08:07
66b6322
  • Binding lookup reports a binding whose to() or toProvider() target is chosen by a ternary with an unknown condition as branch_dependent, with both targets, the arm that selects each, and the condition's path, line and the environment variable names it reads (never their values).
  • Such a binding now replaces an earlier binding for the same key instead of leaving the earlier one reported as the selection.
  • AOP applications report a Resource bound this way as resource_binding_branch instead of matching interceptors for either class.

PHP 8.4 checks passed: 742 tests, 6280 assertions (1 skipped); CI passed on PHP 8.2–8.5.

v0.3.6

Choose a tag to compare

@suzumaze suzumaze released this 16 Oct 05:17
fba8c9b
  • Opt-in bounded Twig dependency graphs with local conditions and separate Resource calls.
  • Exact URL-path declaration lookup with explicit routing coverage and uncertainty.
  • Compact attribute provenance summaries, preserving facts and pagination.
  • Correct handling of Twig short blocks and unverified function options.

PHP 8.2 checks passed: 737 tests, 6252 assertions (1 skipped).

v0.3.5

Choose a tag to compare

@suzumaze suzumaze released this 15 Oct 05:25
13e5a5b

Improve AOP output, static references, URI resolution, and schema discovery.

  • AOP output defaults to compact detail; detail: "shared" deduplicates chains. Use detail: "full" and includeUnknowns: true for detailed evidence. Unknown interceptor filters suggest known names.
  • Dynamic Twig concatenations no longer produce missing-template diagnostics.
  • Missing SQL IDs suggest complete IDs and report bounded-search completeness.
  • Resource and route results expose canonical URI and resolution provenance.
  • Schema tools share method selection and source-derived directory configuration, with optional applicationContext. Incomplete context discovery preserves agreeing schema candidates as provisional results.
  • Resource descriptions share schema directory evidence while preserving context membership and provenance.

Validation: PHP 8.2, PHPCS, PHPStan, 730 PHPUnit tests (6,137 assertions; 1 skipped), and independent review.

v0.3.4

Choose a tag to compare

@suzumaze suzumaze released this 13 Oct 01:47
a139d62

Production contexts for applications whose entry points hand the context to a bootstrap closure or class, and no more failures on half-typed source.

  • bear/app/contexts now lists the production contexts of an application whose entry points pass the context to a bootstrap closure or class instead of calling Injector::getInstance() directly. Before, only the contexts in demo scripts and tests appeared: on public BEAR.Kata, prod-hal-app, hal-app, html-hal-app and cli-html-hal-app were missing. It now follows (require <path>)(...), (new Class())(...), (new Class())->method(...), $closure(...) and Class::method(...) into methods, closures and arrow functions that pass a parameter on as the context, through chains of them, and it scans bootstrap/ too. The environment is not read; a context that comes only from an environment variable is still unresolved.
  • A forwarder whose callers were seen no longer lists its inner Injector::getInstance($context) under unresolved; one nobody calls in a followable form now lists it.
  • A source file that is still being typed ('a' ?? , $x ? 'a' : , ()) no longer makes the whole listing fail. The parser hands back a missing token there, which raised a TypeError and aborted bear/app/contexts for every other file as well. Earlier releases failed the same way.
  • A long concatenated require path can no longer abort the query under Xdebug's nesting limit, and a huge dirname() level count no longer loops. A parameter rebound with global, static or catch is no longer taken for a forwarder.
  • coverage.wrapperResolution is now positional-parameter-forwarders (it was static-positional-single-return-forwarders-only) and coverage.forwarderForms lists the forms followed.

On BEAR.Kata, bear/app/contexts goes from 5 to 9 contexts with 0 unresolved sites instead of 1, and the query takes about 0.96 s instead of 0.78 s.

Validation: PHP 8.2–8.5 CI, PHPCS, PHPStan, 708 PHPUnit tests on PHP 8.5, and 21 syntax-broken inputs that now all complete. Each fix above has a test that failed before the change, except the dirname() level cap.

v0.3.3

Choose a tag to compare

@suzumaze suzumaze released this 02 Oct 01:34
bec5848

Fix for applications on Ray.Di 2.23.1.

  • Recognize the Ray\Di\Matcher\AssistedInjectMatcher source shipped in Ray.Di 2.23.1 as well as 2.20.0. Its method matching is unchanged, but its source differs, so on 2.23.1 every AssistedInjectModule pointcut stayed unresolved: each Resource method got two matcher_or_interceptors_unresolved unknowns, every bear/aop/applications result was provisional, and methods without interceptors were listed. The installed Ray.Di version is still not read, and a changed matcher source is still not recognized.

On BEAR.Kata upgraded to Ray.Di 2.23.1, unresolvedPointcutTotal drops from 124 to 0 and the listed methods drop from 61 to 43. The result now matches both Ray.Di 2.20.0 and the chains built by real Ray.Aop.

Validation: PHP 8.2–8.5 CI, PHPCS, PHPStan, 699 PHPUnit tests, and the isolated BEAR.Kata oracle on PHP 8.5.

v0.3.2

Choose a tag to compare

@suzumaze suzumaze released this 30 Sep 01:45
f4ff036

Follow-up hotfix for source-derived DI and AOP inspection after a second review against real Ray.Di/Ray.Aop.

  • A helper's fallback return is no longer treated as known after an unsupported statement (switch, while, try, ...) or a foreach over an unknown collection, matching the existing handling of unknown if branches.
  • array_map()/array_filter() callbacks such as [$object, 'method'] or user functions are reported as callback_unsupported; only a missing callback or a built-in PHP function is treated as inert.
  • An unknown branch inside an installed vendor helper is recorded at the Module call that consumes it instead of disappearing.
  • Direct binding declarations whose Bind is stored in a variable or property are unresolved with binding_chain_retained.
  • bear/di/moduleDeclarations accepts bindingsOffset and pointcutsOffset, because either list can stop early at the page byte budget.

Composition targets the latest reviewed Ray.Di (2.23.1) without reading the installed version; the docs describe the known Ray.Di 2.20 differences.

Validation: PHP 8.2–8.5 CI, PHPCS, PHPStan, 698 PHPUnit tests with 5,686 assertions, the isolated BEAR.Kata oracle (62 assertions), and a Kata/fixture regression comparison against real Ray.Di/Ray.Aop with no changes.

v0.3.1

Choose a tag to compare

@suzumaze suzumaze released this 29 Sep 08:41
39e3cf6

Hotfix for source-derived DI and AOP inspection after independent Ray.Di/Ray.Aop review.

  • Preserve unknown branches in reachable workspace helpers and Module traits; a later fallback return no longer becomes a confident binding when an earlier branch is unresolved.
  • Report invoked closures and callbacks as unresolved instead of silently omitting their possible bindings.
  • Follow Ray.Aop's exact-attribute ordering rule for inherited method attributes and its any() method exclusions.
  • Correct delayed Bind qualifiers and PHP string escape handling in direct DI/AOP declaration inventories.

Ray.Di 2.20 versus 2.23 multi-interceptor binding behavior remains a documented version-model limitation.

Validation: PHP 8.2–8.5 CI, PHPCS, PHPStan, 687 PHPUnit tests with 5,690 assertions including the isolated BEAR.Kata oracle.

v0.3.0 — Context, DI, and AOP inspection

Choose a tag to compare

@suzumaze suzumaze released this 29 Sep 07:02
ca558b7

BEAR context, DI, and AOP inspection from saved source is now available through Phpactor's read-only semantic requests.

  • Discover application-context candidates with their entry-point locations (bear/app/contexts).
  • Explain a binding for an explicit context with its declaration, Module import path, and retained/discarded decisions (bear/di/bindingLookup). Unknown composition is reported as provisional.
  • Inspect workspace Module relationships and direct binding/AOP declarations with file and line (bear/di/moduleGraph, bear/di/moduleDeclarations).
  • Find PHP attribute definitions and source-matched Resource interceptor chains (bear/attribute/catalog, bear/aop/applications).
  • Compose a bounded, source-derived DI container from supported application and installed vendor Module source (bear/di/container).

These queries do not execute application PHP or prove runtime dependency resolution or AOP weaving. Instance values are not returned. The Module map and direct-declaration view do not expand vendor Modules; binding composition has a separate, broader read boundary.

Validated with 676 PHPUnit tests, PHP_CodeSniffer, PHPStan, PHP 8.2–8.5 CI, the BEAR.Kata/Ray oracle test, and MCP end-to-end integration against BEAR.Kata.

v0.2.0

Choose a tag to compare

@suzumaze suzumaze released this 24 Sep 07:39
abc00e9

Added

  • Standard LSP diagnostics for statically broken BEAR references in the current editor buffer.
  • Source-only response body shape facts for presence-only contract comparison.
  • Source-only bear/di/bindings and bear/aop/pointcuts inventories with reasoned unresolved results.
  • Scheduled BEAR.Kata semantic regression coverage.

Boundary

DI/AOP results describe supported declarations in saved workspace source. They do not construct a container, resolve application contexts or precedence, evaluate pointcuts, or claim runtime weaving.

Verification

PHP 8.2, 8.3, 8.4, and 8.5 CI passed. The suite contains 548 tests and 4898 assertions on PHP 8.5.