Skip to content

Commit ba05f49

Browse files
Deprecate Constraint::CHECK_MODE_NONE (#896)
`Constraint::CHECK_MODE_NONE` (`0x00000000`) has been defined since early versions but is never referenced anywhere in the codebase and has no meaningful semantic—a bitmask of zero applied to any flag check is a no-op. ## Changes - **`Constraint.php`** — Added `@deprecated` PHPDoc to `CHECK_MODE_NONE`; constant is retained to avoid a breaking change and will be removed in the next major release (7.0.0) ```php /** @deprecated CHECK_MODE_NONE is unused and will be removed in the next major release (7.0.0) */ public const CHECK_MODE_NONE = 0x00000000; ``` IDEs and static analysis tools (PHPStan, Psalm) will surface the deprecation warning at call sites. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Constraint::CHECK_MODE_NONE is defined but never used</issue_title> > <issue_description>As it says on the tin: "Constraint::CHECK_MODE_NONE is defined but never used". Also what would a validator do in a check mode none? > > This might require some checking and should only be removed in the next mayor release. However it could be marked as deprecated</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #839 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DannyvdSluijs <618940+DannyvdSluijs@users.noreply.github.com>
1 parent 8318497 commit ba05f49

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/JsonSchema/Constraints/Constraint.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface
1111
/** @var string */
1212
protected $inlineSchemaProperty = '$schema';
1313

14+
/** @deprecated CHECK_MODE_NONE is unused and will be removed in the next major release (7.0.0) */
1415
public const CHECK_MODE_NONE = 0x00000000;
1516
public const CHECK_MODE_NORMAL = 0x00000001;
1617
public const CHECK_MODE_TYPE_CAST = 0x00000002;

0 commit comments

Comments
 (0)