Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 319e89b

Browse files
committed
Merge branch 'feature/64' into develop
Close #64
2 parents f70ba66 + c2bdbf8 commit 319e89b

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file, in reverse
88

99
- [#58](https://github.com/zendframework/zend-validator/pull/58) adds a new
1010
`Uuid` validator, capable of validating if Versions 1-5 UUIDs are well-formed.
11+
- [#64](https://github.com/zendframework/zend-validator/pull/64) ports
12+
`Zend\ModuleManager\Feature\ValidatorProviderInterface` to
13+
`Zend\Validator\ValidatorProviderInterface`, and updates the `Module::init()`
14+
to typehint against the new interface instead of the one from
15+
zend-modulemanager. Applications targeting zend-mvc v3 can start updating
16+
their code to implement the new interface, or simply duck-type against it.
1117

1218
### Deprecated
1319

src/Module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function init($moduleManager)
3636
$serviceListener->addServiceManager(
3737
'ValidatorManager',
3838
'validators',
39-
'Zend\ModuleManager\Feature\ValidatorProviderInterface',
39+
ValidatorProviderInterface::class,
4040
'getValidatorConfig'
4141
);
4242
}

src/ValidatorProviderInterface.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* @link http://github.com/zendframework/zend-validator for the canonical source repository
4+
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
5+
* @license http://framework.zend.com/license/new-bsd New BSD License
6+
*/
7+
8+
namespace Zend\Validator;
9+
10+
/**
11+
* Hint to the zend-modulemanager ServiceListener that a module provides validators.
12+
*
13+
* Module classes implementing this interface hint to
14+
* Zend\ModuleManager\ServiceListener that they provide validators for the
15+
* ValidatorPluginManager.
16+
*
17+
* For users of zend-mvc/zend-modulemanager v2, this poses no backwards-compatibility
18+
* break as the method getValidatorConfig is still duck-typed within Zend\Validator\Module
19+
* when providing configuration to the ServiceListener.
20+
*/
21+
interface ValidatorProviderInterface
22+
{
23+
/**
24+
* Provide plugin manager configuration for validators.
25+
*
26+
* @return array
27+
*/
28+
public function getValidatorConfig();
29+
}

0 commit comments

Comments
 (0)