Repository navigation
Releases: suzumaze/bear-phpactor-extension
Release list
v0.3.8
-
Response body names are found in methods that return early. An
ifwithoutelsewhose
block ends inreturn $this;(optionally after assigning one literal-key body) no longer makes
the methodunsupported;namesdescribe the path that reaches the end, andearlyExitslists
each guard with its line and the body there. A$thishelper 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_exitinside a block that leaves the method with
returnorthrow(usually an intentional error body),embed_body_replacedeverywhere else.
Closures, arrow functions and anonymous classes are not counted.bear/resource/describeshows
the same asresponseBody.embedReplacements. -
Resource references, incoming relations, and the relations and Resource calls in a Resource
description carry the 1-basedlineof 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/articlereferences with limit 5 shrink from 118 to 98 lines of JSON.
v0.3.7
- Binding lookup reports a binding whose
to()ortoProvider()target is chosen by a ternary with an unknown condition asbranch_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_branchinstead 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
- 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
Improve AOP output, static references, URI resolution, and schema discovery.
- AOP output defaults to compact detail;
detail: "shared"deduplicates chains. Usedetail: "full"andincludeUnknowns: truefor 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
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/contextsnow lists the production contexts of an application whose entry points pass the context to a bootstrap closure or class instead of callingInjector::getInstance()directly. Before, only the contexts in demo scripts and tests appeared: on public BEAR.Kata,prod-hal-app,hal-app,html-hal-appandcli-html-hal-appwere missing. It now follows(require <path>)(...),(new Class())(...),(new Class())->method(...),$closure(...)andClass::method(...)into methods, closures and arrow functions that pass a parameter on as the context, through chains of them, and it scansbootstrap/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)underunresolved; 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 aTypeErrorand abortedbear/app/contextsfor every other file as well. Earlier releases failed the same way. - A long concatenated
requirepath can no longer abort the query under Xdebug's nesting limit, and a hugedirname()level count no longer loops. A parameter rebound withglobal,staticorcatchis no longer taken for a forwarder. coverage.wrapperResolutionis nowpositional-parameter-forwarders(it wasstatic-positional-single-return-forwarders-only) andcoverage.forwarderFormslists 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
Fix for applications on Ray.Di 2.23.1.
- Recognize the
Ray\Di\Matcher\AssistedInjectMatchersource 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 everyAssistedInjectModulepointcut stayed unresolved: each Resource method got twomatcher_or_interceptors_unresolvedunknowns, everybear/aop/applicationsresult wasprovisional, 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
Follow-up hotfix for source-derived DI and AOP inspection after a second review against real Ray.Di/Ray.Aop.
- A helper's fallback
returnis no longer treated as known after an unsupported statement (switch,while,try, ...) or aforeachover an unknown collection, matching the existing handling of unknownifbranches. array_map()/array_filter()callbacks such as[$object, 'method']or user functions are reported ascallback_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
Bindis stored in a variable or property areunresolvedwithbinding_chain_retained. bear/di/moduleDeclarationsacceptsbindingsOffsetandpointcutsOffset, 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
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
Bindqualifiers 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
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
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.