@@ -42,15 +42,15 @@ final public function __construct(
4242 $this -> appendChild($child );
4343 }
4444 $this -> setAttributes($attributes );
45- if (:xhp :: $ENABLE_VALIDATION ) {
45+ if (:xhp :: isChildValidationEnabled() ) {
4646 // There is some cost to having defaulted unused arguments on a function
4747 // so we leave these out and get them with func_get_args().
4848 $args = func_get_args ();
4949 if (isset ($args [2 ])) {
5050 $this -> source = " $args[2] :$args[3] " ;
5151 } else {
5252 $this -> source =
53- ' You have ENABLE_VALIDATION on, but debug information is not being ' .
53+ ' You have child validation on, but debug information is not being ' .
5454 ' passed to XHP objects correctly. Ensure xhp.include_debug is on ' .
5555 ' in your PHP configuration. Without this option enabled, ' .
5656 ' validation errors will be painful to debug at best.' ;
@@ -304,7 +304,9 @@ final public function getAttributes(): Map<string, mixed> {
304304 */
305305 final public function setAttribute (string $attr , mixed $value ): this {
306306 if (! ReflectionXHPAttribute :: IsSpecial($attr )) {
307- $value = $this -> validateAttributeValue($attr , $value );
307+ if (:xhp :: isAttributeValidationEnabled()) {
308+ $value = $this -> validateAttributeValue($attr , $value );
309+ }
308310 } else {
309311 $value = (string )$value ;
310312 }
@@ -345,7 +347,9 @@ final public function isAttributeSet(string $attr): bool {
345347 */
346348 final public function removeAttribute (string $attr ): this {
347349 if (! ReflectionXHPAttribute :: IsSpecial($attr )) {
348- $value = $this -> validateAttributeValue($attr , null );
350+ if (:xhp :: isAttributeValidationEnabled()) {
351+ $value = $this -> validateAttributeValue($attr , null );
352+ }
349353 }
350354 $this -> attributes -> removeKey($attr );
351355 return $this ;
0 commit comments