2222 * @psalm-type QueueElement = array{instance: ValidatorInterface, breakChainOnFailure: bool}
2323 * @implements IteratorAggregate<array-key, QueueElement>
2424 */
25- final class ValidatorChain implements Countable, IteratorAggregate, ValidatorInterface
25+ final class ValidatorChain implements Countable, IteratorAggregate, ValidatorChainInterface
2626{
2727 /**
2828 * Default priority at which validators are added
29+ *
30+ * @deprecated Use ValidatorChainInterface::DEFAULT_PRIORITY instead.
2931 */
30- public const DEFAULT_PRIORITY = 1 ;
32+ public const DEFAULT_PRIORITY = ValidatorChainInterface:: DEFAULT_PRIORITY ;
3133
3234 /**
3335 * Validator chain
@@ -102,8 +104,8 @@ public function setPluginManager(ValidatorPluginManager $plugins): void
102104 *
103105 * @internal \Laminas
104106 *
105- * @param string|class-string<T> $name Name of validator to return
106- * @param array<string, mixed> $options Options to pass to validator constructor
107+ * @param string|class-string<T> $name Name of validator to return
108+ * @param array<string, mixed> $options Options to pass to validator constructor
107109 * (if not already instantiated)
108110 * @template T of ValidatorInterface
109111 * @return ($name is class-string<T> ? T : ValidatorInterface)
@@ -126,7 +128,7 @@ public function plugin(string $name, array $options = []): ValidatorInterface
126128 public function attach (
127129 ValidatorInterface $ validator ,
128130 bool $ breakChainOnFailure = false ,
129- int $ priority = self ::DEFAULT_PRIORITY
131+ int $ priority = ValidatorChainInterface ::DEFAULT_PRIORITY
130132 ): void {
131133 $ this ->validators ->insert (
132134 [
@@ -145,7 +147,7 @@ public function attach(
145147 */
146148 public function prependValidator (ValidatorInterface $ validator , bool $ breakChainOnFailure = false ): void
147149 {
148- $ priority = self ::DEFAULT_PRIORITY ;
150+ $ priority = ValidatorChainInterface ::DEFAULT_PRIORITY ;
149151
150152 if (! $ this ->validators ->isEmpty ()) {
151153 $ extractedNodes = $ this ->validators ->toArray (PriorityQueue::EXTR_PRIORITY );
@@ -172,7 +174,7 @@ public function attachByName(
172174 string $ name ,
173175 array $ options = [],
174176 bool $ breakChainOnFailure = false ,
175- int $ priority = self ::DEFAULT_PRIORITY ,
177+ int $ priority = ValidatorChainInterface ::DEFAULT_PRIORITY ,
176178 ): void {
177179 $ bc = null ;
178180 foreach (['break_chain_on_failure ' , 'breakchainonfailure ' ] as $ key ) {
@@ -192,7 +194,7 @@ public function attachByName(
192194 * Use the plugin manager to prepend a validator by name
193195 *
194196 * @param string|class-string<ValidatorInterface> $name
195- * @param array<string, mixed> $options
197+ * @param array<string, mixed> $options
196198 */
197199 public function prependByName (string $ name , array $ options = [], bool $ breakChainOnFailure = false ): void
198200 {
0 commit comments