feature #15285 [Config] deprecate cannotBeEmpty() for boolean and numeric nodes (xabbuh)

This PR was merged into the 2.8 branch.

Discussion
----------

[Config] deprecate cannotBeEmpty() for boolean and numeric nodes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

d4473f3 [Config] deprecate cannotBeEmpty() for boolean and numeric nodes
This commit is contained in:
Fabien Potencier 2015-08-01 08:21:41 +02:00
commit 0de8905919
2 changed files with 24 additions and 0 deletions

View File

@ -30,6 +30,18 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
$this->nullEquivalent = true;
}
/**
* {@inheritdoc}
*
* @deprecated Deprecated since version 2.8, to be removed in 3.0.
*/
public function cannotBeEmpty()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
return parent::cannotBeEmpty();
}
/**
* Instantiate a Node.
*

View File

@ -58,4 +58,16 @@ abstract class NumericNodeDefinition extends ScalarNodeDefinition
return $this;
}
/**
* {@inheritdoc}
*
* @deprecated Deprecated since version 2.8, to be removed in 3.0.
*/
public function cannotBeEmpty()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
return parent::cannotBeEmpty();
}
}