src/Attributes.php
public function setBooleanAttrib($name, $value = true, $comparisonAttribute = null)
	{
		if (!is_bool($value) && !is_null($comparisonAttribute)) {
			$compare = $this->getAttrib($comparisonAttribute);
			if (is_array($value)) {
				$value = in_array($compare, $value, true);
			}
			else {
				$value = $value === $compare;
			}
		}
		$this->setAttrib($name, $value);
	}
public function setBooleanAttrib($name, $value = true, $comparisonAttribute = null)
	{
		if (!is_bool($value) && !is_null($comparisonAttribute)) {
			$compare = $this->getAttrib($comparisonAttribute);
			if (is_array($value)) {
				$value = in_array($compare, $value, true);
			}
			else {
				$value = $value === $compare;
			}
		}
		$this->setAttrib($name, $value);
	}
public function setBooleanAttrib ( $ name , $ value = true , $ comparisonAttribute = null ) { if ( ! is_bool ( $ value ) && ! is_null ( $ comparisonAttribute ) ) { $ compare = $ this -> getAttrib ( $ comparisonAttribute ) ; if ( is_array ( $ value ) ) { $ value = in_array ( $ compare , $ value , true ) ; } else { $ value = $ value === $ compare ; } } $ this -> setAttrib ( $ name , $ value ) ; }
Sets a boolean attribute by comparing a value with the value of another attribute.

Helpful for attributes like <code>selected</code> in HTML.

@param  string   $name       Name of the attribute.
@param  mixed    $value      One or more (array) values.
@param  string   $delimiter  The boundary string.
@param  boolean  $check      Whether multiple entries shall be removed or not.
Sets a boolean attribute by comparing a value with the value of another attribute .