src/LightSaml/Builder/Action/CompositeActionBuilder.php
public function add(ActionInterface $action, $priority = false)
    {
        if (false === $priority) {
            ++$this->biggestPriority;
            $priority = $this->biggestPriority;
        } elseif (false === is_int($priority)) {
            throw new \InvalidArgumentException('Expected integer value for priority');
        } elseif ($priority > $this->biggestPriority) {
            $this->biggestPriority = $priority;
        }

        if (false === isset($this->actions[$priority])) {
            $this->actions[$priority] = array();
        }
        $this->actions[$priority][] = $action;

        return $this;
    }
public function add(ActionInterface $action, $priority = false)
    {
        if (false === $priority) {
            ++$this->biggestPriority;
            $priority = $this->biggestPriority;
        } elseif (false === is_int($priority)) {
            throw new \InvalidArgumentException('Expected integer value for priority');
        } elseif ($priority > $this->biggestPriority) {
            $this->biggestPriority = $priority;
        }

        if (false === isset($this->actions[$priority])) {
            $this->actions[$priority] = array();
        }
        $this->actions[$priority][] = $action;

        return $this;
    }
@param ActionInterface $action
@param int|bool        $priority

@return CompositeActionBuilder