diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-25 15:10:46 +0100 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-11-25 15:10:46 +0100 |
commit | 977d226b11831034b7ca948a654958d34a1c62e3 (patch) | |
tree | 3a257340f364af2a67998b9335acd111a1e50de5 /Model | |
parent | c265aef4342feac7d19bee79c8476bc04efc31e0 (diff) | |
download | Praspel-977d226b11831034b7ca948a654958d34a1c62e3.zip Praspel-977d226b11831034b7ca948a654958d34a1c62e3.tar.gz Praspel-977d226b11831034b7ca948a654958d34a1c62e3.tar.bz2 |
A @default can be declared if…
… at least one @behavior exists.
Diffstat (limited to 'Model')
-rw-r--r-- | Model/Behavior.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Model/Behavior.php b/Model/Behavior.php index 6c5ee46..8fa173d 100644 --- a/Model/Behavior.php +++ b/Model/Behavior.php @@ -217,6 +217,11 @@ class Behavior extends Clause { 'Cannot add the @default clause, since an @ensures ' . 'or a @throwable clause exists at the same level.', 4); + if(false === $this->clauseExists('behavior')) + throw new \Hoa\Praspel\Exception\Model( + 'Cannot add a @default clause if at least one ' . + '@behavior clause has not been declared.', 5); + $handle = new DefaultBehavior($this); break; |