public function check(Password $str)
    {
        $this->errors = array();

        foreach ($this->constraints as $constraint) {
            $res = $constraint($str);
            if ($res !== true) {
                $this->errors[] = $res;
            }
        }

        return count($this->errors) === 0;
    }
public function check(Password $str)
    {
        $this->errors = array();

        foreach ($this->constraints as $constraint) {
            $res = $constraint($str);
            if ($res !== true) {
                $this->errors[] = $res;
            }
        }

        return count($this->errors) === 0;
    }
{@inheritdoc}