Skip to content

Build(deps): update nette/schema requirement from ^1.3.7 to ^1.4.0 - #117

Open
dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/composer/nette/schema-tw-1.4.0
Open

dependabot[bot] wants to merge 1 commit into
masterfrom
dependabot/composer/nette/schema-tw-1.4.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 26, 2026

Copy link
Copy Markdown
Contributor

Updates the requirements on nette/schema to permit the latest version.

Release notes

Sourced from nette/schema's releases.

Released version 1.4.0

Your schema can now be the documentation of your configuration: give elements a description, export the schema as JSON Schema, and editors offer completion, explain each option and underline mistakes right in the config file.

✨ New Features

  • JsonSchema::export() – turns a schema into a JSON Schema document, the format editors read to validate and complete JSON or YAML files. It exports types, ranges, patterns, required items, enum values and descriptions. A type that exists only in PHP, such as a class, throws NotSupportedException instead of exporting something the schema would not accept.
  • description() – attach a human-readable description to any element. It does not affect validation, and it travels into the JSON Schema export.
  • Expect::enum() – stop hand-rolling the conversion of backed enums: Expect::enum(Suit::class) accepts the backing value or the case itself and always gives you the case. An enum-typed property in Expect::from() maps to it automatically. Expect::type(Suit::class) keeps meaning plain instanceof, as for any other class.
  • Expect::tuple() – a fixed-size list where each position has its own schema: Expect::tuple([Expect::string(), Expect::int()]). otherItems() describes the rest elements, extend() appends positions, and when configurations are layered, a later tuple replaces the earlier one as a whole.
  • Expect::listOf() with wrap – Expect::listOf('string', wrap: true) also accepts a single value and wraps it into a one-item list, so both email: foo@example.com and email: [a@example.com, b@example.com] work.
  • mergeMode() and mergeWith() – say in the schema how layered configurations combine instead of relying on the deep merge: Expect::arrayOf('string')->mergeMode(MergeMode::Replace) takes the later array as a whole, while OverwriteKeys and AppendKeys merge by keys. Any element can get its own combining function, such as Expect::bool()->mergeWith(fn($value, $base) => $value || $base). A schema without them merges exactly as before, and the same calls keep working in 2.0.
  • castTo('?type') – castTo('?string') keeps a null and casts everything else. A class or an enum keeps the null even without the question mark, so Expect::string()->nullable()->castTo(DateTime::class) just works.
  • Kind-specific element classes – Expect::string() returns a StringType, Expect::int() a NumberType, Expect::listOf() an ArrayType, so your IDE and PHPStan know which options each element has. They are subclasses of Type, so existing code keeps working.

⚠️ Deprecations

  • before() called repeatedly – a second before() on the same element still replaces the first one, but raises a notice: in 2.0 the handlers will chain in declaration order. Merge them into one.
  • '?int[]' – in 1.x it means an array of nullable items, while 2.0 reads it as a nullable array, as phpDoc does. The notice names the replacement that keeps the meaning: Expect::arrayOf(Expect::type('int')->nullable()).
  • Options that do not fit the element – min(), max(), pattern(), items() and mergeDefaults() on a union such as Expect::type('int|string') belong to the variants: Expect::anyOf(Expect::int()->min(1), Expect::string()->min(1)). Likewise pattern() on a number or an array, items() on a string or a number and mergeDefaults() on anything but

... (truncated)

Commits
  • af9fa8a updated DOCS
  • 9f0f75b tests: PHPStan type tests cover the 1.4 API
  • 33e8dcb added MergeMode enum, mergeMode() and mergeWith()
  • c2a5743 Base: calling before() repeatedly is deprecated (BC break)
  • ae43388 Type: min() and max() accept int, so large integer bounds keep their precision
  • 42e70c7 AnyOf: deprecated() emits its warning like any other element
  • 335f4cc castTo(): null stays null for a class, an enum or a ?type
  • 9b5d4ac Structure: the merging marker is not an item of the shape
  • 230b915 Expect::listOf() with wrap: a single value is accepted and wrapped into a one...
  • 4197ed6 AnyOf: dynamic() is a flag, not a variant
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [nette/schema](https://github.com/nette/schema) to permit the latest version.
- [Release notes](https://github.com/nette/schema/releases)
- [Commits](nette/schema@v1.3.7...v1.4.0)

---
updated-dependencies:
- dependency-name: nette/schema
  dependency-version: 1.4.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added the automerge label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants