Skip to content

Commit

Permalink
Fixed a potential behavior bug when setPropertiesConstraintsValidatio…
Browse files Browse the repository at this point in the history
…nEnabled is called too early
  • Loading branch information
antarestupin committed Apr 26, 2016
1 parent 84d6e29 commit f106155
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Accessible/AutomatedBehaviorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ trait AutomatedBehaviorTrait
*
* @var boolean
*/
private $_constraintsValidationEnabled;
private $_constraintsValidationEnabled = null;

/**
* The initial values of the properties that use Initialize and InitializeObject annotations.
Expand Down Expand Up @@ -185,10 +185,13 @@ private function getPropertiesInfo()
$this->_accessProperties = $classInfo['accessProperties'];
$this->_collectionsItemNames = $classInfo['collectionsItemNames'];
$this->_associationsList = $classInfo['associationsList'];
$this->_constraintsValidationEnabled = $classInfo['constraintsValidationEnabled'];
$this->_initialPropertiesValues = $classInfo['initialPropertiesValues'];
$this->_initializationNeededArguments = $classInfo['initializationNeededArguments'];

if ($this->_constraintsValidationEnabled === null) {
$this->_constraintsValidationEnabled = $classInfo['constraintsValidationEnabled'];
}

$this->_automatedBehaviorInitialized = true;
}
}
Expand Down

0 comments on commit f106155

Please sign in to comment.