Merge branch 'release/2.0.3'
This commit is contained in:
commit
0f9c5f4697
4 changed files with 11 additions and 7 deletions
|
@ -31,8 +31,7 @@ class Package extends BasePackage
|
||||||
|
|
||||||
$dispatcher = $bootstrap->getSignalSlotDispatcher();
|
$dispatcher = $bootstrap->getSignalSlotDispatcher();
|
||||||
$dispatcher->connect(ConfigurationManager::class, 'configurationManagerReady',
|
$dispatcher->connect(ConfigurationManager::class, 'configurationManagerReady',
|
||||||
function ($configurationManager) {
|
function (ConfigurationManager $configurationManager) {
|
||||||
/* @var ConfigurationManager $configurationManager */
|
|
||||||
$configurationManager->registerConfigurationType(
|
$configurationManager->registerConfigurationType(
|
||||||
static::CONFIGURATION_TYPE_VALIDATION,
|
static::CONFIGURATION_TYPE_VALIDATION,
|
||||||
ConfigurationManager::CONFIGURATION_PROCESSING_TYPE_DEFAULT,
|
ConfigurationManager::CONFIGURATION_PROCESSING_TYPE_DEFAULT,
|
||||||
|
|
|
@ -126,7 +126,7 @@ class SettingsValidator extends AbstractValidator
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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'])) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ class TestObject
|
||||||
protected $shouldBeFalse = true;
|
protected $shouldBeFalse = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Flow\Validate(type="DigiComp.SettingValidator:Settings", options={"name": "TrueValidator"})
|
* @Flow\Validate(type="DigiComp.SettingValidator:Settings", options={"name"="TrueValidator"})
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $shouldBeTrueAndValidatedByAnnotation = false;
|
protected $shouldBeTrueAndValidatedByAnnotation = false;
|
||||||
|
|
Loading…
Reference in a new issue