Config sections for adapters, and Config::all() returning an array (3.2.0)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 63/100
- Type d'issue
- Documentation
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- markdown, php
- Domaine
- documentation
Piste de recherche
Start from v3.0/packages/config/contracts.md, the "Typed reader contract" and section() entries, and check each claim against the 3.2.x code before editing. Then work through overview.md, architecture.md, usage.md, v3.0/advanced-features/configuration.md, the adapter pages listed (renderer, logger, mailer, cache, ratelimit, session, lang, auth) and the new 3.1-to-3.2 section in v3.0/upgrade-guide.md. Done when every cited line matches the released 3.2 behaviour and the upgrade-guide grep also covers ValueTrait, ConfigFileTrait and ->all()->.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Framework 3.2.0 gives adapters their settings as a read-only Quantum\Config\ConfigSection instead of an array (quantum-php/framework#672). config()->section('cache.redis') returns one; Config and ConfigSection read with the same code (ReadTrait, TypedValuesTrait), and only Config loads and changes values (WriteTrait, renamed from ValueTrait; ConfigFileTrait is folded into Config). Config::all() returns an array instead of the Data object. Adapters read ports, TTLs and lifetimes as whole numbers, so text such as '600' works and 'abc' throws a ConfigException; a missing cache or rate limit ttl or port throws, and the auth adapters require their config. getBool() and getInt() without a default require the key, and empty text (such as KEY= in .env) counts as not set. The docs still describe the arrays, all(): ?Data, the old traits and the old typed reader defaults.
Changes
- Config package (
v3.0/packages/config/):overview.md:51: the traits areReadTrait,WriteTraitandTypedValuesTrait; mentionConfigSection.architecture.md:13,:19-21:all()returns an array; the trait list (noConfigFileTrait,ValueTraitisWriteTrait, the newReadTraitis shared withConfigSection).contracts.md:66-68,:102:all(): array,[]when empty (notnull); add thesection()andConfigSectioncontract (read-only, empty for a missing or non-array key, keeps its values, arrays copied and objects shared);set()with a dotted key on an empty config nests the value.contracts.md:70-86, "Typed reader contract": the signatures aregetBool(string $key, ?bool $default = null)andgetInt(string $key, ?int $default = null); a key that is missing,nullor empty text is not set; not set returns the default when one is given and throwsConfigException::missingKey()when none is given;getBool()no longer reads an empty value asfalse, andgetInt()no longer throwsinvalidValue()for it.usage.md: a short section on reading a slice withconfig()->section(...); in "Reading booleans and numbers" (:41-48), the exampleconfig()->getBool('app.debug')and the text "both return the default:falseand0unless you pass another" change to the required-key rule, with a default passed for optional keys.
v3.0/advanced-features/configuration.md:32:all()returns an array, not a dot-accessible object.- Adapter config pages, the adapter receives a
ConfigSection, and numbers are whole numbers:renderer/adapters.md:25,:63,:76: no more "config array"; Twig receives the section'sall().logger/architecture.md:36,mailer/architecture.md:33: "constructor parameters" become the adapter's config section.cache/adapters.md(ttl,port) andratelimit/adapters.md(ttl,port): text works, other text throws, a missingttlthrows.session/adapters.md:20(timeout),lang/usage.md:131-145(cache.ttl),auth/adapters.md:34(remember_lifetime),auth/usage.md:61(otp_expires): read as whole numbers, defaults kept when missing.mailer/adapters.md(SMTP):portis a whole number; a missing or emptyportuses 25.auth/adapters.md,auth/usage.md:two_fa,otp_expiresandsession.remember_lifetimeare read when the adapter is built, so an invalid value fails there, also with two-factor authentication off; an adapter of your own that usesAuthTraitimplementsreadConfig(ConfigSection $config).
v3.0/upgrade-guide.md, "Upgrading from 3.1 to 3.2": a new section before "Check the upgrade" on code that builds adapters itself (new RedisAdapter(new ConfigSection([...]))), values that now throw,config()->all()returning an array,ConfigInterface, the renamed and removed traits,LoggerTrait::initialize(ConfigSection $config),AuthTrait'sreadConfig(), the required auth config, andgetBool()/getInt()without a default requiring the key (empty text counts as not set); the check grep also looks forValueTrait,ConfigFileTraitand->all()->.
Every statement is checked against the 3.2.x code. The changes wait in staging until 3.2.0 is released.
Related
- quantum-php/framework#672, PR quantum-php/framework#706, merge-up quantum-php/framework#708
Updated 2026-11-25 to the final code of PR #706: the typed reader rules, the SMTP port default, and the auth settings read when the adapter is built.
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 3
- Forks
- 1
- Merge moyen
- 2 min
- PR mergées (30 j)
- 27
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de quantum-php/docs
-
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
quantum-php/docs#196 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
quantum-php/docs#190 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
quantum-php/docs#187 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 75/100
quantum-php/docs#194 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
quantum-php/docs#185 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de quantum-php/docs
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 73/100
google/elephant-goldfish-model#586 ·
Les mainteneurs répondent en général sous 2 jours
-
documentation Entwickler
Difficulté 1/5 Moins d'une heure Accessibilité débutants 89/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
memtomem/memtomem-stm#1657 ·
Les mainteneurs répondent en général sous 1 jour
-
Help with the docsOuvertedocumentation good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 76/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
lightninglabs/layertree#28 ·