FIX: Do not migrate already migrated validators
This commit is contained in:
parent
4228053b3f
commit
4a6d344ab6
1 changed files with 7 additions and 2 deletions
|
@ -28,15 +28,20 @@ class Version20170603120900 extends AbstractMigration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
$this->processConfiguration(Package::CONFIGURATION_TYPE_VALIDATION,
|
$this->processConfiguration(
|
||||||
|
Package::CONFIGURATION_TYPE_VALIDATION,
|
||||||
function (&$configuration) {
|
function (&$configuration) {
|
||||||
foreach ($configuration as $validatorName => &$validators) {
|
foreach ($configuration as $validatorName => &$validators) {
|
||||||
|
// guard that protects configuration, which has already the new format:
|
||||||
|
if (isset($validators['properties']) || isset($validators['self'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$newConfiguration = ['properties' => [], 'self' => []];
|
$newConfiguration = ['properties' => [], 'self' => []];
|
||||||
|
|
||||||
foreach ($validators as $key => &$validator) {
|
foreach ($validators as $key => &$validator) {
|
||||||
if (! isset($validator['validator']) || ! isset($validator['options'])) {
|
if (! isset($validator['validator']) || ! isset($validator['options'])) {
|
||||||
$this->showWarning('The Validation.yaml files contained no validator or options for ' .
|
$this->showWarning('The Validation.yaml files contained no validator or options for ' .
|
||||||
'validation: "' . $validatorName . '.' . $key . '". It was not be migrated.');
|
'validation: "' . $validatorName . '.' . $key . '". It was not migrated.');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isset($validator['property'])) {
|
if (isset($validator['property'])) {
|
||||||
|
|
Loading…
Reference in a new issue