Skip to content

Fix/ci and sample api - #1

Merged
imanimen merged 2 commits into
masterfrom
fix/ci-and-sample-api
Sep 6, 2026
Merged

imanimen merged 2 commits into
masterfrom
fix/ci-and-sample-api

Conversation

@imanimen

@imanimen imanimen commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

imanimen and others added 2 commits September 6, 2026 09:38
The workflow triggered on `branches: [main]`, but this repository's default
branch is `master`, so it had never run a single time. The README badge also
pointed at `tests.yml` while the file was named `php.yml`.

Renamed the file to `tests.yml` (matching the badge) and triggered it on both
`master` and `main`.

Laravel 11 is past its security-fix window, so every 11.x release now carries an
open advisory and Composer refuses to install it — the `laravel: '11.*'` matrix
legs would have failed at dependency resolution even once they started running.
The install step opts the CI checkout out of that block; applications should
leave the check on.

Also: install the framework with `--dev` rather than adding it to `require`,
add `--prefer-stable` to the update, cache Composer downloads, restrict
`permissions` to `contents: read`, cancel superseded runs, and move Pint and
PHPStan into their own job instead of repeating them across all six matrix legs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DriverRegistrar snapshotted `config('http-adapter.drivers')` when the manager
was constructed and captured each driver's array by value, so any driver added
or reconfigured after that point was silently ignored. The suite only passed
because every test happened to mutate config before the first resolution.

Driver resolution now reads the live config repository in
AdapterManager::createDriver(), with a new InvalidDriverConfigException::
unknownDriver() for names that are absent from config entirely. Two tests cover
the behaviour, including one that resolves a driver registered after the manager
was already built.

Note that Illuminate\Support\Manager memoises resolved drivers, so changing a
driver's config at runtime still requires forgetDrivers() — documented in the
README and declared on the facade.

The Postex references throughout the docs, fixtures and workbench are replaced
with JSONPlaceholder, a free public sample API:

- tests: `SampleApiClient` fixture with posts/show_post/create_post endpoints.
  The suite still never touches the network; every test stubs the transport.
- workbench: a matching `sample` driver plus a new `http-adapter:sample` command
  that makes a real call and then demonstrates the mock path.
- README: rebuilt around the sample API, with new notes on `@method` docblocks
  for endpoint methods (they go through __call, so static analysers can't see
  them), resolve-time config, and the forgetDrivers() caveat.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@imanimen
imanimen merged commit fc3fc70 into master Sep 6, 2026
7 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