diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml new file mode 100644 index 0000000..cced309 --- /dev/null +++ b/.github/workflows/docs-check.yml @@ -0,0 +1,68 @@ +name: Docs check + +# Checks the docs on every pull request into staging and master. + +on: + pull_request: + branches: [staging, master] + workflow_dispatch: + +permissions: + contents: read + +jobs: + summary: + name: SUMMARY.md matches the pages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-node@v7 + with: + node-version: 22 + + - name: Check SUMMARY.md + run: node scripts/check-summary.mjs + + links: + name: Links and anchors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Check the links between the pages + uses: lycheeverse/lychee-action@v2.9.0 + with: + lycheeVersion: v0.24.2 + args: --config lychee.toml README.md SUMMARY.md 'v3.0/**/*.md' + fail: true + + markdown: + name: Markdown structure + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-node@v7 + with: + node-version: 22 + + - name: Check the Markdown rules + run: npx --yes markdownlint-cli2@0.18.1 + + wording: + name: Wording (warnings on added lines) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Check the wording of the added lines + uses: errata-ai/vale-action@v3.0.0 + with: + version: 3.28.1 + files: README.md,SUMMARY.md,v3.0 + separator: "," + sync: false + reporter: github-pr-annotations + filter_mode: added + fail_on_error: false diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc new file mode 100644 index 0000000..8f41116 --- /dev/null +++ b/.markdownlint-cli2.jsonc @@ -0,0 +1,12 @@ +// Markdown rules for the docs (https://github.com/DavidAnson/markdownlint). +// Run from the repository root: npx markdownlint-cli2 +{ + "config": { + "default": true, + // Paragraphs are written as one line each. + "MD013": false, + // Package pages repeat headings such as "Examples" under different sections. + "MD024": { "siblings_only": true } + }, + "globs": ["README.md", "SUMMARY.md", "v3.0/**/*.md"] +} diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000..fe01fc7 --- /dev/null +++ b/.vale.ini @@ -0,0 +1,16 @@ +# Wording checks for the docs (https://vale.sh). +# Run from the repository root: vale README.md SUMMARY.md v3.0 + +StylesPath = .vale/styles +MinAlertLevel = suggestion +Vocab = Quantum + +[*.md] +BasedOnStyles = Vale, Quantum +# The vocabulary lists both spellings of some names (JWT and the package Jwt), so it only feeds +# the spell check; Quantum.Names enforces the spelling of names. +Vale.Terms = NO + +# The upgrade guide describes what changed, so it may say "previously" and "no longer". +[v3.0/upgrade-guide.md] +Quantum.History = NO diff --git a/.vale/styles/Quantum/Filler.yml b/.vale/styles/Quantum/Filler.yml new file mode 100644 index 0000000..664dfcf --- /dev/null +++ b/.vale/styles/Quantum/Filler.yml @@ -0,0 +1,10 @@ +extends: existence +message: "Leave out '%s'." +level: warning +ignorecase: true +tokens: + - simply + - just + - easily + - obviously + - please diff --git a/.vale/styles/Quantum/History.yml b/.vale/styles/Quantum/History.yml new file mode 100644 index 0000000..9af0851 --- /dev/null +++ b/.vale/styles/Quantum/History.yml @@ -0,0 +1,9 @@ +extends: existence +message: "Describe the current behavior instead of its history ('%s'); the upgrade guide is the place for changes." +level: warning +ignorecase: true +tokens: + - previously + - no longer + - nowadays + - anymore diff --git a/.vale/styles/Quantum/Names.yml b/.vale/styles/Quantum/Names.yml new file mode 100644 index 0000000..62f63bc --- /dev/null +++ b/.vale/styles/Quantum/Names.yml @@ -0,0 +1,11 @@ +extends: substitution +message: "Write '%s' instead of '%s'." +level: warning +ignorecase: false +swap: + QuantumPHP: Quantum + Github: GitHub + Phpunit: PHPUnit + phpunit: PHPUnit + Phpstan: PHPStan + phpstan: PHPStan diff --git a/.vale/styles/config/vocabularies/Quantum/accept.txt b/.vale/styles/config/vocabularies/Quantum/accept.txt new file mode 100644 index 0000000..8eca83a --- /dev/null +++ b/.vale/styles/config/vocabularies/Quantum/accept.txt @@ -0,0 +1,51 @@ +[Aa]rgs +[Aa]utoload(ed|able) +[Aa]utowir(e|ing) +basename +bcmath +[Cc]allables? +[Cc]aptchas? +[Cc]hainable +[Cc]ryptor +[Cc]srf +datetime +debugbar +decryptable +[Dd]ocblocks? +DTOs? +falsey +fileinfo +fillable +gd +[Hh]asher +hCaptcha +HTTP +Http +Idiorm +[Ii]nstantiable +invokable +JWT +Jwt +lowercas(es|ing) +[Mm]emcached? +minifier +Monolog +multibyte +mutators +[Pp]aginators? +PHPDoc +PHPMailer +PHPStan +PHPUnit +preformatted +redis +rehydrates +reloadable +rethrow(n|ing) +simplexml +Symfony +[Tt]hrowables? +traversables +unpositioned +unserializ(e|ed|es|ation) +uppercased diff --git a/AGENTS.md b/AGENTS.md index d89942d..ef26c67 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,17 +27,27 @@ If you use a local Markdown preview tool/editor, verify heading hierarchy and li - Use fenced code blocks with language hints (for example, ```bash). ## Testing Guidelines -There is no automated test suite in this repository. Minimum validation for each change: +The workflow `.github/workflows/docs-check.yml` checks every pull request into `staging` and `master`. Run the same checks locally before you push, from the repository root: -- Check internal links you edited. -- Confirm `SUMMARY.md` includes new/moved pages in the right section. -- Proofread for terminology consistency (`Quantum`, package names, command names like `qt`). +- `node scripts/check-summary.mjs`: every page `SUMMARY.md` links to exists, and every page under `v3.0` is listed in `SUMMARY.md`. +- `lychee --config lychee.toml README.md SUMMARY.md 'v3.0/**/*.md'`: links between the pages and the `#heading` anchors they point to. Links to other sites are not checked. +- `npx markdownlint-cli2@0.18.1`: the Markdown rules in `.markdownlint-cli2.jsonc` (heading order, code blocks with a language hint, blank lines and list markers), with the version CI uses; a newer version knows more rules and reports findings CI does not. `npx markdownlint-cli2@0.18.1 --fix` repairs most findings. +- `vale README.md SUMMARY.md v3.0`: the wording rules in `.vale/styles/Quantum` (names such as `Quantum`, `GitHub` and `PHPUnit`, no history narration outside the upgrade guide, filler words) and the spell check. Add a correct word it does not know to `.vale/styles/config/vocabularies/Quantum/accept.txt`. On a pull request Vale only reports warnings on the lines the pull request adds. + +The first three fail the pull request. Lychee and Vale are single programs from [lychee](https://github.com/lycheeverse/lychee/releases) and [Vale](https://github.com/errata-ai/vale/releases); `npx` downloads markdownlint-cli2 on first use. + +The checks cannot tell whether a statement matches the framework code, so also: + +- Check every statement and example name you add against the framework code. +- Confirm `SUMMARY.md` lists new or moved pages in the right section. ## Commit & Pull Request Guidelines -Recent history uses a conventional docs prefix: +The prefix says what a commit changes: + +- `docs: ` for the documentation itself: the pages under `v3.0`, `README.md` and `SUMMARY.md`. Example: `docs: complete Lang package docs for v3.0`. +- `chore: ` for the tooling around it: the workflows in `.github`, `scripts`, the configs of the checks (`lychee.toml`, `.markdownlint-cli2.jsonc`, `.vale.ini`, `.vale`) and this file. Example: `chore: check links and anchors on pull requests`. -- Commit format: `docs: ` -- Example: `docs: complete Lang package docs for v3.0` +A commit that changes pages only to satisfy a new check, in the same commit as the check, uses `chore:`. For pull requests: @@ -49,7 +59,7 @@ For pull requests: ## Git Workflow 1. Create a feature branch from `master` using `docs/` naming (examples in history: `docs/v3-package-loader`, `docs/summary-add-config-links`). -2. Use focused commits with `docs: ...` messages. +2. Use focused commits with `docs: ...` or `chore: ...` messages (see above). 3. Keep the branch current with `master` before merge (history includes both rebases and `Merge branch 'master' into docs/...`). 4. Open a PR targeting `master` with: - scope summary diff --git a/README.md b/README.md index eaf8d6f..be0824b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Quantum is a lightweight, high-performance PHP framework built with simplicity, modularity, and developer experience in mind. Designed for both beginners and professionals, it allows rapid development of web applications using a clean and expressive syntax. -[![](https://github.com/quantum-php/framework/actions/workflows/php.yml/badge.svg)](https://github.com/quantum-php/framework/actions/workflows/php.yml)[![](https://codecov.io/gh/quantum-php/framework/branch/master/graph/badge.svg)](https://codecov.io/gh/quantum-php/framework)[![](https://scrutinizer-ci.com/g/quantum-php/framework/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/quantum-php/framework)[![](https://img.shields.io/github/license/quantum-php/framework)](https://github.com/quantum-php/framework/blob/master/LICENSE)[![](https://img.shields.io/packagist/v/quantum/framework)](https://packagist.org/packages/quantum/framework) +[![Build](https://github.com/quantum-php/framework/actions/workflows/php.yml/badge.svg)](https://github.com/quantum-php/framework/actions/workflows/php.yml)[![Coverage](https://codecov.io/gh/quantum-php/framework/branch/master/graph/badge.svg)](https://codecov.io/gh/quantum-php/framework)[![Code quality](https://scrutinizer-ci.com/g/quantum-php/framework/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/quantum-php/framework)[![License](https://img.shields.io/github/license/quantum-php/framework)](https://github.com/quantum-php/framework/blob/master/LICENSE)[![Latest version](https://img.shields.io/packagist/v/quantum/framework)](https://packagist.org/packages/quantum/framework) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fquantum-php%2Fdocs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fquantum-php%2Fdocs?ref=badge_shield) *** @@ -76,20 +76,20 @@ Quantum is a modern MVC/HMVC framework that provides the core tools needed to bu ### Features -* MVC & HMVC architecture -* Powerful routing with support for RESTful routes -* Built-in authentication & CSRF protection -* Modular structure with organized services and modules -* Environment-based configuration system -* Templating system with escaping and layout support -* File uploads, storage and file system abstraction -* Mailer integration -* Multiple database adapter support (Idiorm, SleekDB) -* Flexible caching system with multiple drivers (File, Database, Redis, Memcache) -* Simple and extendable testing setup -* Localization and translation support -* CLI tools for rapid scaffolding and dev tasks -* JWT support for APIs +- MVC & HMVC architecture +- Powerful routing with support for RESTful routes +- Built-in authentication & CSRF protection +- Modular structure with organized services and modules +- Environment-based configuration system +- Templating system with escaping and layout support +- File uploads, storage and file system abstraction +- Mailer integration +- Multiple database adapter support (Idiorm, SleekDB) +- Flexible caching system with multiple drivers (File, Database, Redis, Memcache) +- Simple and extendable testing setup +- Localization and translation support +- CLI tools for rapid scaffolding and dev tasks +- JWT support for APIs *** diff --git a/SUMMARY.md b/SUMMARY.md index 6a3477b..123d3c6 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -2,7 +2,13 @@ ## v3.0 +### About Quantum + +* [What is Quantum?](v3.0/introduction/what-is-quantum.md) +* [Why Quantum?](v3.0/introduction/why-quantum.md) + ### Getting Started + * [Introduction](v3.0/getting-started/introduction.md) * [Installation](v3.0/installation.md) * [Quickstart](v3.0/getting-started/quickstart.md) @@ -11,6 +17,7 @@ * [Upgrade Guide](v3.0/upgrade-guide.md) ### Core Concepts + * [Routing](v3.0/core-concepts/routing.md) * [Request](v3.0/core-concepts/request.md) * [Controllers](v3.0/core-concepts/controllers.md) @@ -21,6 +28,7 @@ * [Modules](v3.0/core-concepts/modules.md) ### Advanced Features + * [Request Lifecycle](v3.0/advanced-features/request-lifecycle.md) * [Configuration](v3.0/advanced-features/configuration.md) * [Environment](v3.0/advanced-features/environment.md) @@ -29,6 +37,7 @@ * [Dependency Injection](v3.0/advanced-features/dependency-injection.md) ### CLI + * [CLI Overview](v3.0/cli/overview.md) * [The qt Command-Line Tool](v3.0/cli/qt-command-line-tool.md) * [Development Server](v3.0/cli/development-server.md) @@ -36,6 +45,7 @@ * [Console Commands](v3.0/cli/console-commands.md) ### Packages + * App * [Overview](v3.0/packages/app/overview.md) * [Architecture](v3.0/packages/app/architecture.md) @@ -255,4 +265,3 @@ * [Contracts](v3.0/packages/view/contracts.md) * [Helpers](v3.0/packages/view/helpers.md) * [Usage](v3.0/packages/view/usage.md) - diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..64d09a5 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,7 @@ +# Link check for the docs (https://lychee.cli.rs). +# Checks the links between the pages and the headings they point to (#anchor). +# Links to other sites are skipped, so a slow site cannot fail a pull request. + +offline = true +include_fragments = "anchor-only" +no_progress = true diff --git a/scripts/check-summary.mjs b/scripts/check-summary.mjs new file mode 100644 index 0000000..015d767 --- /dev/null +++ b/scripts/check-summary.mjs @@ -0,0 +1,43 @@ +// Checks that SUMMARY.md and the pages under v3.0 match: +// every page SUMMARY.md links to exists, and every page under v3.0 is listed. +// SUMMARY.md drives the navigation of the website and GitBook, so a page it does not list +// cannot be reached from the sidebar. +// +// Run it from the repository root: node scripts/check-summary.mjs + +import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs'; +import { join, normalize, sep } from 'node:path'; + +const toPosix = (path) => path.split(sep).join('/'); + +const listPages = (dir) => readdirSync(dir).flatMap((name) => { + const path = join(dir, name); + + if (statSync(path).isDirectory()) { + return listPages(path); + } + + return path.endsWith('.md') ? [toPosix(path)] : []; +}); + +const summary = readFileSync('SUMMARY.md', 'utf8'); + +const linked = [...summary.matchAll(/\]\(([^)#\s]+[.]md)(#[^)]*)?\)/g)] + .map((match) => toPosix(normalize(match[1]))); + +const missing = linked.filter((page) => !existsSync(page)); +const unlisted = listPages('v3.0').filter((page) => !linked.includes(page)); + +for (const page of missing) { + console.log(`SUMMARY.md links to a page that does not exist: ${page}`); +} + +for (const page of unlisted) { + console.log(`Page is not listed in SUMMARY.md: ${page}`); +} + +if (missing.length > 0 || unlisted.length > 0) { + process.exit(1); +} + +console.log(`SUMMARY.md lists all ${linked.length} pages, and every link points to an existing page.`); diff --git a/v3.0/advanced-features/configuration.md b/v3.0/advanced-features/configuration.md index a4da6c4..3797092 100644 --- a/v3.0/advanced-features/configuration.md +++ b/v3.0/advanced-features/configuration.md @@ -21,7 +21,7 @@ The `Config` class loads configuration files described by a `Quantum\Config\Setu ## API Methods - `load(Setup $setup)`: Load all configuration files. -- `import(Setup $setup)`: Import additional config files. +- `import(Setup $setup)`: Import additional config files. - `importIfExists(Setup $setup)`: Import a config file only when it exists; returns `false` otherwise. - *Note:* The `filename` defined in the `Setup` object is strictly used as the top-level key for the imported data. `Config::import()` always structures imported data as `[$fileName => $data]`. Empty or `null` filenames are not supported and will result in implicit namespacing under an empty or null key; always provide a unique, non-empty filename to ensure proper access and collision detection. - `get(string $key, $default = null)`: Retrieve a config value. @@ -97,5 +97,3 @@ After configuration fundamentals, continue with: - [Environment](environment.md) - [Dependency Injection](dependency-injection.md) - [Modules](../core-concepts/modules.md) - - diff --git a/v3.0/advanced-features/dependency-injection.md b/v3.0/advanced-features/dependency-injection.md index b359643..3792264 100644 --- a/v3.0/advanced-features/dependency-injection.md +++ b/v3.0/advanced-features/dependency-injection.md @@ -31,6 +31,7 @@ Usage: $args = Di::autowire($callable, $inputArgs); $callable(...$args); ``` + - `Di::set(string $abstract, object $instance, bool $override = true)`: Manually set an instance, optionally preventing an override of existing registered instances by setting `$override` to `false`. If the dependency is already registered and `override` is `false`, the method throws an exception. ## Usage Example @@ -76,5 +77,3 @@ After DI concepts, continue with: - [Services](../core-concepts/services.md) - [Modules](../core-concepts/modules.md) - [Configuration](configuration.md) - - diff --git a/v3.0/advanced-features/environment.md b/v3.0/advanced-features/environment.md index 3cfc729..2a1edc5 100644 --- a/v3.0/advanced-features/environment.md +++ b/v3.0/advanced-features/environment.md @@ -15,7 +15,7 @@ The `Environment` service implements a "one-shot" loading pattern. ### `load()` -- **One-shot**: Once the environment is loaded, subsequent calls to `load()` are no-ops. +- **One-shot**: Once the environment is loaded, subsequent calls to `load()` are no-ops. - **Initialization**: It reads `app_env` from `shared/config/env.php`, picks the matching `.env` file, validates that both files exist (`EnvException` otherwise), loads the variables, and marks the environment as loaded. - The boot does this for you; you call it yourself only in custom bootstraps or tests. @@ -44,7 +44,6 @@ The `Server` class provides a controlled gateway to the server state. > **Proxy/Security Caveat**: The `ip()` method trusts headers provided by the client (proxies/load balancers). In production environments, ensure your entry point configures the application to support only trusted proxies. - ```php use Quantum\Environment\Environment; use Quantum\Di\Di; diff --git a/v3.0/advanced-features/migration.md b/v3.0/advanced-features/migration.md index aa8ad30..881094a 100644 --- a/v3.0/advanced-features/migration.md +++ b/v3.0/advanced-features/migration.md @@ -18,6 +18,7 @@ If your project is still using the starter default `sleekdb` adapter, migration ## Migration Actions Supported actions include: + - create - alter - rename diff --git a/v3.0/advanced-features/request-lifecycle.md b/v3.0/advanced-features/request-lifecycle.md index 8a06509..ad8ebe2 100644 --- a/v3.0/advanced-features/request-lifecycle.md +++ b/v3.0/advanced-features/request-lifecycle.md @@ -130,12 +130,15 @@ That is the request lifecycle in action. A few mistakes are common. ### Confusing routing with execution + Routes describe the destination. They do not do all the work themselves. ### Forgetting middleware in the middle + Many people jump straight from route to controller. In real apps, middleware often sits in between. ### Treating views as independent from controllers + Views are usually part of the response chosen by the controller, not a separate routing destination. ## What to read next diff --git a/v3.0/cli/console-commands.md b/v3.0/cli/console-commands.md index d67ecf6..36731b6 100644 --- a/v3.0/cli/console-commands.md +++ b/v3.0/cli/console-commands.md @@ -15,6 +15,7 @@ That means when you run commands such as `php qt serve`, you are using the frame The console command system is split across the core framework and the starter project. ### In `framework` + The core framework provides: - the base command class: `Quantum\Console\CliCommand` @@ -35,6 +36,7 @@ The core framework provides: - `core:version` ### In `project` + The starter project adds its own project-level commands under: ```text @@ -215,6 +217,7 @@ This is important because it shows that Quantum commands are not limited to tiny In `CliCommand`, command arguments and options are declared as arrays. ### Arguments + Argument definitions use values such as: - `required` @@ -230,6 +233,7 @@ protected array $args = [ ``` ### Options + Option definitions use values such as: - `none` @@ -289,11 +293,11 @@ Tasks are discovered by scanning PHP files within the configured `cron.path` dir When `cron:run` is invoked, the `CronManager`: -1. **Task Discovery**: Scans the configured cron directory for task files. -2. **Locking Mechanism**: Utilizes `CronLock` to manage task exclusivity. - * **Acquire/Release**: Prevents concurrent execution of the same task. -3. **Run Statistics**: Returns an array of execution statistics including `total`, `executed`, `skipped`, `failed`, and `locked` task counts. -4. **Bypass**: Use `--force` with `cron:run` to bypass lock acquisition and release. +1. **Task Discovery**: Scans the configured cron directory for task files. +2. **Locking Mechanism**: Utilizes `CronLock` to manage task exclusivity. + - **Acquire/Release**: Prevents concurrent execution of the same task. +3. **Run Statistics**: Returns an array of execution statistics including `total`, `executed`, `skipped`, `failed`, and `locked` task counts. +4. **Bypass**: Use `--force` with `cron:run` to bypass lock acquisition and release. *Note: The scheduler requires a system-level crontab entry to trigger `php qt cron:run` periodically.* diff --git a/v3.0/cli/development-server.md b/v3.0/cli/development-server.md index aef4330..3d7b521 100644 --- a/v3.0/cli/development-server.md +++ b/v3.0/cli/development-server.md @@ -71,12 +71,15 @@ That is a much smoother onboarding path. ## Common mistakes ### Running the command outside the project directory + If you are not inside the correct project folder, the command may fail or behave unexpectedly. ### Forgetting to finish installation first + If dependencies or setup steps are missing, the app may not boot correctly. ### Treating the development server like production infrastructure + This command is for local development. Production deployment should use a proper web server setup. ## What to do after the server works diff --git a/v3.0/cli/overview.md b/v3.0/cli/overview.md index 5500a0b..8f4dffe 100644 --- a/v3.0/cli/overview.md +++ b/v3.0/cli/overview.md @@ -74,9 +74,11 @@ That is especially helpful when debugging or onboarding into an older project. There are two big reasons. ### 1. It teaches the framework's intended workflow + When a framework ships CLI commands, those commands usually reflect how the framework expects developers to work. ### 2. It reduces manual repetition + You can always create files and folders manually, but the CLI helps you stay aligned with the framework's conventions. That becomes more valuable as the project grows. diff --git a/v3.0/cli/qt-command-line-tool.md b/v3.0/cli/qt-command-line-tool.md index b30b0f0..1047360 100644 --- a/v3.0/cli/qt-command-line-tool.md +++ b/v3.0/cli/qt-command-line-tool.md @@ -36,11 +36,13 @@ That tells Quantum to boot as a console app instead of as a web app. From the upstream console boot flow, this is the basic sequence. ### 1. `qt` starts the console app + The starter project calls `AppFactory::create(AppType::CONSOLE, __DIR__)`. That gives Quantum a base directory and tells it to use the console application path. ### 2. Quantum builds the console adapter + In core, console mode uses `ConsoleAppAdapter`. Before anything else, it sets up: @@ -52,6 +54,7 @@ Before anything else, it sets up: So `qt` is not a shell wrapper around random scripts. It boots a real console application. ### 3. Helpers load and core commands are registered + Next, Quantum loads the helper functions and registers the framework's built-in commands from: ```text @@ -69,9 +72,11 @@ These include commands such as: - `core:key` ### 4. Quantum loads the project + Then Quantum loads what commands usually rely on: `.env`, the app config, and the error handler. It also names the console application from `app.name` and `app.version`. ### 5. App commands are registered + Last, Quantum registers project-level commands from: ```text @@ -86,6 +91,7 @@ That means `qt` can run both: - custom commands defined by your project ### 6. The command is validated and executed + The console app reads the first CLI argument as the command name. If the command does not exist, Quantum throws ``Command `` is not defined``. diff --git a/v3.0/core-concepts/controllers.md b/v3.0/core-concepts/controllers.md index c0f3622..ade8549 100644 --- a/v3.0/core-concepts/controllers.md +++ b/v3.0/core-concepts/controllers.md @@ -190,6 +190,7 @@ That broader structure helps keep controllers from becoming too large. Quantum supports both styles clearly. ### Web controllers + Usually: - prepare layouts @@ -197,6 +198,7 @@ Usually: - return HTML ### API controllers + Usually: - work with JSON responses diff --git a/v3.0/core-concepts/middleware.md b/v3.0/core-concepts/middleware.md index 5b89976..3bbfe33 100644 --- a/v3.0/core-concepts/middleware.md +++ b/v3.0/core-concepts/middleware.md @@ -103,6 +103,7 @@ Examples from the upstream templates include: The upstream templates show several common middleware responsibilities. ### Authentication + Example: - `Auth` @@ -110,6 +111,7 @@ Example: This checks whether the user is authenticated before allowing access. ### Guest-only access + Example: - `Guest` @@ -117,6 +119,7 @@ Example: This prevents authenticated users from visiting routes meant only for guests, such as sign-in pages. ### Authorization and ownership + Examples: - `Editor` @@ -126,11 +129,13 @@ Examples: These restrict actions based on role or ownership. ### Request validation + Some middleware classes validate incoming data before allowing the request to continue. The `Editor` middleware template is a good example. It validates request fields and uploaded image constraints before continuing. ### HTTP basic auth + The Toolkit template includes `BasicAuth`, which protects routes using HTTP basic authentication. ## Web and API middleware behave differently @@ -138,6 +143,7 @@ The Toolkit template includes `BasicAuth`, which protects routes using HTTP basi The upstream templates show an important pattern. ### Web middleware + Often redirects the user when access fails. For example: @@ -147,6 +153,7 @@ For example: - flash validation errors and redirect back ### API middleware + Usually returns JSON errors instead. For example: diff --git a/v3.0/core-concepts/models.md b/v3.0/core-concepts/models.md index 33795c2..b5b8bc1 100644 --- a/v3.0/core-concepts/models.md +++ b/v3.0/core-concepts/models.md @@ -105,7 +105,7 @@ The `type` must be a `Relation` case, and text such as `'belongsTo'` is not acce - `Relation::HAS_MANY`: This model has many related models (one-to-many). - `Relation::HAS_ONE`: This model has a single related model (one-to-one). -### Example: +### Example ```php public function relations(): array diff --git a/v3.0/core-concepts/modules.md b/v3.0/core-concepts/modules.md index fad182e..2d11b3b 100644 --- a/v3.0/core-concepts/modules.md +++ b/v3.0/core-concepts/modules.md @@ -34,9 +34,9 @@ Modules are part of the application startup flow, not just a project-organizatio The framework's module loader manages application startup in two phases: -1. **Dependency Registration**: During initialization, the loader scans modules listed in `shared/config/modules.php` and loads dependencies from `modules//config/dependencies.php` **only for modules marked as enabled**. +1. **Dependency Registration**: During initialization, the loader scans modules listed in `shared/config/modules.php` and loads dependencies from `modules//config/dependencies.php` **only for modules marked as enabled**. -2. **Route Loading**: After dependencies are registered, the loader loads route definitions from `modules//routes/routes.php` **only for modules marked as enabled**. +2. **Route Loading**: After dependencies are registered, the loader loads route definitions from `modules//routes/routes.php` **only for modules marked as enabled**. Modules directly affect both bootstrap behavior and route availability. @@ -75,6 +75,7 @@ This is where module-specific service bindings are declared. The templates make the module shape clear. ### Default API module template + Includes areas such as: - `Controllers/` @@ -82,6 +83,7 @@ Includes areas such as: - `routes/` ### Default Web module template + Includes areas such as: - `Controllers/` @@ -90,6 +92,7 @@ Includes areas such as: - `assets/` ### Demo module templates + Demo templates also include: - `DTOs/` diff --git a/v3.0/core-concepts/request.md b/v3.0/core-concepts/request.md index 9821a0b..fb24f1e 100644 --- a/v3.0/core-concepts/request.md +++ b/v3.0/core-concepts/request.md @@ -25,7 +25,7 @@ Uploaded files are handled through the `setUploadedFiles` method, which follows 1. **`$_FILES` Normalization**: PHP's native `$_FILES` global is processed via the `handleFiles()` method, which iterates over all top-level keys in `$_FILES` and normalizes both single and multi-file payloads. 2. **Multipart Raw Files**: Files extracted during raw multipart parsing are merged into the collection if present. -3. **Resulting Collection**: The finalized files collection contains the normalized keys from `$_FILES` merged with any files extracted by the raw multipart parser. +3. **Resulting Collection**: The finalized files collection contains the normalized keys from `$_FILES` merged with any files extracted by the raw multipart parser. See the [Advanced Request Lifecycle](../advanced-features/request-lifecycle.md) for further technical details on the parsing contract. diff --git a/v3.0/core-concepts/routing.md b/v3.0/core-concepts/routing.md index 323a33b..eac91d2 100644 --- a/v3.0/core-concepts/routing.md +++ b/v3.0/core-concepts/routing.md @@ -98,7 +98,6 @@ $route->get('post/[id=:num]', 'PostController', 'show'); $route->get('post/[id1=:num]', 'PostController', 'show'); ``` - ### Pattern variations - **Optional segments**: Append `?` to the segment (e.g., `verify/[code=:any]?`) @@ -120,7 +119,6 @@ $route->add('verify/[code=:alpha:10]?', 'GET|POST', 'AuthController', 'verify'); The router also exposes helper functions for current route information, including route parameters. - ## Named routes A route can be given a name: @@ -133,7 +131,7 @@ Named routes make it easier to refer to important endpoints by intention instead > **Note**: Route name uniqueness is enforced **per module**, not globally. This allows you to safely use identical route names in different modules. -**Example: Reusing route names** +### Example: Reusing route names ```php // In the Api module @@ -143,7 +141,6 @@ $route->get('data', 'ApiController', 'data')->name('list'); $route->get('list', 'WebController', 'list')->name('list'); ``` - ## Route groups Quantum supports grouping related routes: @@ -200,7 +197,7 @@ Quantum supports both: If a route is closure-based, the dispatcher invokes the closure directly. If a route uses a controller, the dispatcher instantiates the controller and calls the action method. -**Important**: Both closure handlers and controller actions must return an instance of `Quantum\Http\Response`. +**Important**: Both closure handlers and controller actions must return an instance of `Quantum\Http\Response`. The dispatcher enforces this contract via `requireResponse(...)` and will throw a runtime exception if the handler returns any other type. @@ -218,7 +215,6 @@ $route->get('profile', function() { }); ``` - ## Controller lifecycle hooks The route dispatcher also supports controller lifecycle hooks: @@ -256,7 +252,7 @@ The router follows a "first-hit" matching strategy. Route registration order is > **Best Practice**: Always declare specific (static) routes before broad (dynamic) or catch-all routes to avoid unexpected dispatch behavior. -**Example: Overlapping routes** +### Example: Overlapping routes ```php // If this route is declared first, it will always match @@ -317,4 +313,3 @@ After routing, the next best topics are: - [Controllers](controllers.md) - [Middleware](middleware.md) - [Request Handling](request.md) - diff --git a/v3.0/core-concepts/services.md b/v3.0/core-concepts/services.md index c189239..995c9ac 100644 --- a/v3.0/core-concepts/services.md +++ b/v3.0/core-concepts/services.md @@ -55,7 +55,6 @@ The `service(string $serviceClass, bool $singleton = false)` helper function pro - **`$singleton = false` (default)**: Returns a fresh instance of the service via `ServiceFactory::create()`, which invokes `Di::create()` to resolve dependencies. - **`$singleton = true`**: Returns a shared instance of the service via `ServiceFactory::get()`, which invokes `Di::get()` to return a singleton from the DI container. - --- ## Creating a New Service Example diff --git a/v3.0/getting-started/first-app.md b/v3.0/getting-started/first-app.md index 3ec0b2c..3a7187f 100644 --- a/v3.0/getting-started/first-app.md +++ b/v3.0/getting-started/first-app.md @@ -138,15 +138,19 @@ That is enough to continue through the docs without losing context. A few common points are worth clearing up early. ### 1. Routes do not contain the full application logic + Routes should describe request mapping, not become the entire app. ### 2. Controllers are not views + Controllers prepare and coordinate. Views handle presentation. ### 3. HTML and JSON are both valid first outputs + Your first app does not have to be page-only. Quantum supports both traditional web flows and API-style responses. ### 4. Middleware is part of the request path + Even in small apps, middleware often appears quickly for auth, guest access, validation, or ownership checks. ## Suggested next reading diff --git a/v3.0/installation.md b/v3.0/installation.md index 6ee0af9..c53bc6b 100644 --- a/v3.0/installation.md +++ b/v3.0/installation.md @@ -2,7 +2,7 @@ This guide walks you through installing and running a new Quantum PHP project. -### Requirements +## Requirements Make sure your environment includes: @@ -22,9 +22,9 @@ Optional framework features may require additional extensions or packages such a Practical note: run `php -v` to check your PHP version before you start. Quantum needs PHP 8.2 or newer. -### Installation Steps +## Installation Steps -1. **Create a new project** +1. **Create a new project** ```bash composer create-project quantum/project my-project @@ -34,38 +34,34 @@ Practical note: run `php -v` to check your PHP version before you start. Quantum That setup currently: - - creates `.env` from `.env.example` - - generates an application key - - installs the demo `Web` and `Api` modules - - installs OpenAPI assets/routes for the `Api` module - - publishes DebugBar assets - - prints the installed framework version - - -2. **Navigate into the project directory** + * creates `.env` from `.env.example` + * generates an application key + * installs the demo `Web` and `Api` modules + * installs OpenAPI assets/routes for the `Api` module + * publishes DebugBar assets + * prints the installed framework version +2. **Navigate into the project directory** ```bash cd my-project ``` - -3. **Start the development server** +3. **Start the development server** ```bash php qt serve ``` - The development server starts and prints its address, by default `http://127.0.0.1:8000/`. If port 8000 is busy, it uses the next free port. The options are described under [`serve`](packages/console/built-in-commands.md#serve). -### Verification +## Verification You should now see a working Quantum demo application in the browser. On a successful fresh install, you should also expect that: -- `.env` already exists -- `APP_KEY` has been generated -- the starter demo modules are already installed -- the CLI can boot successfully with `php qt serve` +* `.env` already exists +* `APP_KEY` has been generated +* the starter demo modules are already installed +* the CLI can boot successfully with `php qt serve` diff --git a/v3.0/packages/app/overview.md b/v3.0/packages/app/overview.md index 1123114..f2fb610 100644 --- a/v3.0/packages/app/overview.md +++ b/v3.0/packages/app/overview.md @@ -56,4 +56,3 @@ Practical effect: - changing the base directory in a later call does not create a new instance for the same type If you need a fresh runtime for the same type, call `AppFactory::destroy($type)` before creating it again. - diff --git a/v3.0/packages/app/usage.md b/v3.0/packages/app/usage.md index 77b6195..7a18ef4 100644 --- a/v3.0/packages/app/usage.md +++ b/v3.0/packages/app/usage.md @@ -76,4 +76,3 @@ Helpers like `base_dir()` and `public_dir()` require `AppContext` to be set. Cal ### Constructor-heavy console commands The console adapter instantiates discovered command classes directly. If a command requires constructor arguments, it will not fit the built-in registration flow. - diff --git a/v3.0/packages/archive/overview.md b/v3.0/packages/archive/overview.md index 4289533..ae64fd8 100644 --- a/v3.0/packages/archive/overview.md +++ b/v3.0/packages/archive/overview.md @@ -44,4 +44,3 @@ That means archive name and adapter state are shared for that type inside the cu - source files passed to `addFile()` must already exist or the package throws - extraction returns `bool`, so failed extracts are not always raised as exceptions - some adapter-specific behavior differs, especially around partial extraction and archive cleanup - diff --git a/v3.0/packages/asset/overview.md b/v3.0/packages/asset/overview.md index 847c6d1..e265be3 100644 --- a/v3.0/packages/asset/overview.md +++ b/v3.0/packages/asset/overview.md @@ -53,4 +53,3 @@ Lower positions render first inside the same asset type. Assets without an expli - CSS and JavaScript are rendered separately. - The helper returns one shared manager instance for the current process, so registered assets stay in memory until you flush them. - `assets()` only accepts the built-in type keys: `css` and `js`. - diff --git a/v3.0/packages/auth/overview.md b/v3.0/packages/auth/overview.md index 5a14032..365c525 100644 --- a/v3.0/packages/auth/overview.md +++ b/v3.0/packages/auth/overview.md @@ -102,4 +102,3 @@ Fields marked as `visible` in the schema are the only fields that Auth exposes i - Unsupported method calls on `Auth` fail at runtime because the wrapper only forwards methods that exist on the active adapter. - Inactive accounts cannot sign in. - Email-based flows depend on the Mailer package and the shared email templates used by the package. - diff --git a/v3.0/packages/cache/overview.md b/v3.0/packages/cache/overview.md index d08f3ac..6fcd302 100644 --- a/v3.0/packages/cache/overview.md +++ b/v3.0/packages/cache/overview.md @@ -40,4 +40,3 @@ The factory keeps one resolved `Cache` instance per adapter name for the life of - `clear()` is backend-wide for the configured store. It is not limited to the current prefix or to keys created by one caller. - batch methods accept arrays only, even though the PSR signatures say `iterable` - expiry cleanup is lazy for file and database storage: expired entries are removed when they are checked - diff --git a/v3.0/packages/captcha/overview.md b/v3.0/packages/captcha/overview.md index 627bb8d..499af94 100644 --- a/v3.0/packages/captcha/overview.md +++ b/v3.0/packages/captcha/overview.md @@ -39,4 +39,3 @@ The factory keeps one resolved `Captcha` wrapper per adapter name for the life o - visible vs invisible is adapter state; if you call `setType()`, later calls on the same reused helper instance keep that type until you change it again - verification returns only `true` or `false`; provider error details are reduced to the first stored error code from `getErrorMessage()` - tokens older than 60 seconds are treated as replay attacks even if the provider response is otherwise successful - diff --git a/v3.0/packages/config/overview.md b/v3.0/packages/config/overview.md index 6404100..3e13b10 100644 --- a/v3.0/packages/config/overview.md +++ b/v3.0/packages/config/overview.md @@ -60,4 +60,3 @@ With `load()`, keys come from the file directly. With `import()`, the same file - `import()` always stores loaded data under the `Setup` filename. - Import collisions are only guarded by that top-level filename. Re-importing the same truthy filename throws a `ConfigException`. - For predictable imports, use a real non-empty filename in `Setup`. - diff --git a/v3.0/packages/config/usage.md b/v3.0/packages/config/usage.md index 6d6a896..757713a 100644 --- a/v3.0/packages/config/usage.md +++ b/v3.0/packages/config/usage.md @@ -98,4 +98,3 @@ Use unique filenames per imported section. ### Assuming runtime changes persist to disk `set()`, `delete()`, and `flush()` change the in-memory copy only. - diff --git a/v3.0/packages/console/overview.md b/v3.0/packages/console/overview.md index d0ec593..e159ec0 100644 --- a/v3.0/packages/console/overview.md +++ b/v3.0/packages/console/overview.md @@ -34,4 +34,3 @@ The base class also gives you small terminal helpers such as `info()`, `error()` - Discovered commands must have a constructor that can be called without required arguments, because `CommandDiscovery` creates them with `newInstance()` and no parameters. - `CliCommand::execute()` always returns Symfony's success status after calling `exec()`. In practice, many command failures are printed as messages instead of returning a non-zero exit code. - Input and output objects are available only while the command is running. Calling `getArgument()`, `getOption()`, or output helpers before execution raises a runtime error. - diff --git a/v3.0/packages/cookie/overview.md b/v3.0/packages/cookie/overview.md index daf2a14..1e15209 100644 --- a/v3.0/packages/cookie/overview.md +++ b/v3.0/packages/cookie/overview.md @@ -29,4 +29,3 @@ cookie()->delete('theme'); - `time` is treated as seconds from now; `0` creates a session cookie - `has()` treats empty values as missing, so `''`, `0`, `'0'`, `false`, and `null` do not count as present - `get()` depends on `has()`, so those values come back as `null` - diff --git a/v3.0/packages/cron/overview.md b/v3.0/packages/cron/overview.md index 30fdc0c..4bffc90 100644 --- a/v3.0/packages/cron/overview.md +++ b/v3.0/packages/cron/overview.md @@ -61,4 +61,3 @@ The package has working defaults even when that config file is missing: - task directory: `base_dir()/cron` - lock directory: `base_dir()/runtime/cron/locks` - maximum lock age: `86400` seconds - diff --git a/v3.0/packages/csrf/overview.md b/v3.0/packages/csrf/overview.md index 1790be6..5b3f9d5 100644 --- a/v3.0/packages/csrf/overview.md +++ b/v3.0/packages/csrf/overview.md @@ -40,4 +40,3 @@ That makes the default flow single-use. - successful validation removes the token from both session storage and the current request object - missing or mismatched tokens throw `CsrfException` - `csrf_token()` depends on `APP_KEY`; if that value is missing, the helper throws an app exception instead of returning a token - diff --git a/v3.0/packages/di/architecture.md b/v3.0/packages/di/architecture.md index 526b7be..c66ecfb 100644 --- a/v3.0/packages/di/architecture.md +++ b/v3.0/packages/di/architecture.md @@ -124,4 +124,4 @@ The package raises `DiException` for its own validation failures: - circular dependency - invalid callable -Reflection and PHP type errors are not wrapped universally. Some failures can still surface as native reflection or runtime errors during construction. \ No newline at end of file +Reflection and PHP type errors are not wrapped universally. Some failures can still surface as native reflection or runtime errors during construction. diff --git a/v3.0/packages/di/contracts.md b/v3.0/packages/di/contracts.md index 4806e60..2faae2e 100644 --- a/v3.0/packages/di/contracts.md +++ b/v3.0/packages/di/contracts.md @@ -143,4 +143,4 @@ The package defines dedicated messages for: - circular dependency chains - invalid callable input -All package-level validation errors use `Quantum\Di\Exceptions\DiException`. \ No newline at end of file +All package-level validation errors use `Quantum\Di\Exceptions\DiException`. diff --git a/v3.0/packages/di/overview.md b/v3.0/packages/di/overview.md index 85efbbd..5a8408f 100644 --- a/v3.0/packages/di/overview.md +++ b/v3.0/packages/di/overview.md @@ -123,4 +123,4 @@ Use `reset()` only when you want a fully empty container state. - The package only resolves constructor injection; there is no factory binding API in this package. - `has()` checks cached instances only. It does not tell you whether a dependency is registered. - `isRegistered()` checks registry bindings only. It does not tell you whether an instance has been created. -- `Di::__callStatic()` throws `DiException::invalidCallable($method)` when the current container does not implement the requested method. \ No newline at end of file +- `Di::__callStatic()` throws `DiException::invalidCallable($method)` when the current container does not implement the requested method. diff --git a/v3.0/packages/di/usage.md b/v3.0/packages/di/usage.md index 567c1b0..9ed2054 100644 --- a/v3.0/packages/di/usage.md +++ b/v3.0/packages/di/usage.md @@ -150,4 +150,4 @@ Use: - `get()` fails for unknown abstractions; it does not auto-register them. - `autowire()` does not accept string callables or invokable objects. - Missing required scalar parameters can fall through as `null` and fail later when PHP enforces the signature. -- Shared instances are container-scoped. If the app context changes containers, later `Di::...` calls follow the new container. \ No newline at end of file +- Shared instances are container-scoped. If the app context changes containers, later `Di::...` calls follow the new container. diff --git a/v3.0/packages/logger/adapters.md b/v3.0/packages/logger/adapters.md index 57916c6..22c37ca 100644 --- a/v3.0/packages/logger/adapters.md +++ b/v3.0/packages/logger/adapters.md @@ -91,4 +91,4 @@ Both file adapters use the same line format: If you pass `['trace' => $trace]`, the trace is appended on the next line before the final newline. -If you pass an array message, the package JSON-encodes it with pretty printing before writing. \ No newline at end of file +If you pass an array message, the package JSON-encodes it with pretty printing before writing. diff --git a/v3.0/packages/logger/architecture.md b/v3.0/packages/logger/architecture.md index 1403d67..c2744bc 100644 --- a/v3.0/packages/logger/architecture.md +++ b/v3.0/packages/logger/architecture.md @@ -80,4 +80,4 @@ All other context keys are ignored by file adapters. ## Message adapter flow -`MessageAdapter` appends each reported message to its in-memory list. It does not know about the debugger: the debug toolbar reads the list through `logger()` when it renders. See [the `message` adapter](adapters.md#message). \ No newline at end of file +`MessageAdapter` appends each reported message to its in-memory list. It does not know about the debugger: the debug toolbar reads the list through `logger()` when it renders. See [the `message` adapter](adapters.md#message). diff --git a/v3.0/packages/logger/contracts.md b/v3.0/packages/logger/contracts.md index 6adddf1..bcefe41 100644 --- a/v3.0/packages/logger/contracts.md +++ b/v3.0/packages/logger/contracts.md @@ -73,4 +73,4 @@ If the resolved adapter instance does not implement that contract, the factory t If the configured level is unknown, the previous threshold stays in place. -That means a bad config value does not raise an exception here; it leaves logging on the last valid threshold. \ No newline at end of file +That means a bad config value does not raise an exception here; it leaves logging on the last valid threshold. diff --git a/v3.0/packages/logger/helpers.md b/v3.0/packages/logger/helpers.md index 7b09cb9..b5e490e 100644 --- a/v3.0/packages/logger/helpers.md +++ b/v3.0/packages/logger/helpers.md @@ -51,4 +51,4 @@ A few limits are easy to miss: - the convenience helpers accept string messages, while `logger()` also lets you send array payloads through the PSR-3 methods - every helper call goes back through the shared factory -Use `logger()` when you need the full PSR-3 surface, adapter selection, or structured array messages. \ No newline at end of file +Use `logger()` when you need the full PSR-3 surface, adapter selection, or structured array messages. diff --git a/v3.0/packages/logger/overview.md b/v3.0/packages/logger/overview.md index e42e90f..392045b 100644 --- a/v3.0/packages/logger/overview.md +++ b/v3.0/packages/logger/overview.md @@ -66,4 +66,4 @@ In debug mode, `Logger::log()` bypasses threshold filtering and reports every ca - The `message` adapter is not available outside debug mode. - File adapters only use the `trace` context key for output formatting. Other context values are ignored by file logging. - The package does not validate arbitrary custom level strings. Stick to standard PSR log levels for predictable filtering and output. -- The `daily` adapter picks its `.log` file when the adapter is created. In long-running workers, recreate/re-resolve the logger after midnight if you need strict daily rollover. \ No newline at end of file +- The `daily` adapter picks its `.log` file when the adapter is created. In long-running workers, recreate/re-resolve the logger after midnight if you need strict daily rollover. diff --git a/v3.0/packages/logger/usage.md b/v3.0/packages/logger/usage.md index dca08e5..ad07b88 100644 --- a/v3.0/packages/logger/usage.md +++ b/v3.0/packages/logger/usage.md @@ -68,17 +68,17 @@ $messages = logger()->getAdapter()->getMessages(); ## Pick the right backend -### Use `single` when: +### Use `single` when - you want one stable file such as `storage/logs/app.log` - external tooling already tails or rotates one known file -### Use `daily` when: +### Use `daily` when - you want one log file per day - you prefer date-based separation without external naming logic -### Rely on debug-mode `message` when: +### Rely on debug-mode `message` when - you are troubleshooting a page locally - you want its logs in the debug toolbar instead of on disk @@ -88,4 +88,4 @@ $messages = logger()->getAdapter()->getMessages(); - `logger(LoggerType::MESSAGE)` is valid only in debug mode. - In the web app, `logger(LoggerType::DAILY)` or `logger(LoggerType::SINGLE)` still resolves to `message` in debug mode. - Reusing a resolved logger reuses the adapter instance behind it. -- Calling `log()` with a non-standard level string is not rejected by the package, but it can produce uneven behavior. Prefer the standard level methods instead. \ No newline at end of file +- Calling `log()` with a non-standard level string is not rejected by the package, but it can produce uneven behavior. Prefer the standard level methods instead. diff --git a/v3.0/packages/mailer/adapters.md b/v3.0/packages/mailer/adapters.md index ffbddc0..5e00657 100644 --- a/v3.0/packages/mailer/adapters.md +++ b/v3.0/packages/mailer/adapters.md @@ -158,4 +158,4 @@ The API adapters all share these limits: - `send()` reports failure as `false`; the provider's error details (`HttpClient::getErrors()`) are kept in the [transport log](contracts.md#transport-log) - they do not expose reply-to, CC, BCC, file attachments, or string attachments through the package surface - array bodies are concatenated with `implode('')` before send -- template and raw body output is trimmed and newline-stripped before being sent as HTML \ No newline at end of file +- template and raw body output is trimmed and newline-stripped before being sent as HTML diff --git a/v3.0/packages/mailer/architecture.md b/v3.0/packages/mailer/architecture.md index 7e0c8c0..c16535d 100644 --- a/v3.0/packages/mailer/architecture.md +++ b/v3.0/packages/mailer/architecture.md @@ -86,4 +86,4 @@ If `shared/emails` does not already exist as a directory, saving fails and `send The SMTP adapter keeps an internal PHPMailer instance and clears addresses, headers, and attachments after each send. -The API adapters build request payload arrays and send them through `Quantum\HttpClient\HttpClient`. They do not expose SMTP-only helpers such as CC or attachments. \ No newline at end of file +The API adapters build request payload arrays and send them through `Quantum\HttpClient\HttpClient`. They do not expose SMTP-only helpers such as CC or attachments. diff --git a/v3.0/packages/mailer/helpers.md b/v3.0/packages/mailer/helpers.md index 1af09b3..9c978bc 100644 --- a/v3.0/packages/mailer/helpers.md +++ b/v3.0/packages/mailer/helpers.md @@ -51,4 +51,4 @@ mailer(MailerType::SMTP) ->send(); ``` -If you switch that example to a non-SMTP adapter, the proxy call will fail because the method does not exist on that adapter. \ No newline at end of file +If you switch that example to a non-SMTP adapter, the proxy call will fail because the method does not exist on that adapter. diff --git a/v3.0/packages/mailer/overview.md b/v3.0/packages/mailer/overview.md index daa170f..cca9f47 100644 --- a/v3.0/packages/mailer/overview.md +++ b/v3.0/packages/mailer/overview.md @@ -58,4 +58,4 @@ After `send()` finishes, the package clears the sender, recipients, subject, bod - Template paths are stored without the `.php` suffix. The package always requires `