src/LightSaml/Criteria/CriteriaSet.php
public function addIf($condition, $callback)
    {
        if ($condition) {
            $criteria = call_user_func($callback);
            if ($criteria) {
                $this->add($criteria);
            }
        }

        return $this;
    }
public function addIf($condition, $callback)
    {
        if ($condition) {
            $criteria = call_user_func($callback);
            if ($criteria) {
                $this->add($criteria);
            }
        }

        return $this;
    }
@param mixed    $condition
@param callable $callback

@return CriteriaSet