src/main/php/response/Status.php
public function unauthorized(array $challenges): self
    {
        if (count($challenges) === 0) {
            throw new \InvalidArgumentException('Challenges must contain at least one entry');
        }

        $this->headers->add('WWW-Authenticate', join(', ', $challenges));
        return $this->fixateCode(401);
    }
public function unauthorized(array $challenges): self
    {
        if (count($challenges) === 0) {
            throw new \InvalidArgumentException('Challenges must contain at least one entry');
        }

        $this->headers->add('WWW-Authenticate', join(', ', $challenges));
        return $this->fixateCode(401);
    }
public function unauthorized ( array $ challenges ) : self { if ( count ( $ challenges ) === 0 ) { throw new \ InvalidArgumentException ( 'Challenges must contain at least one entry' ) ; } $ this -> headers -> add ( 'WWW-Authenticate' , join ( ', ' , $ challenges ) ) ; return $ this -> fixateCode ( 401 ) ; }
sets status to 401 Unauthorized

@param   string[]  $challenges  list of challenges
@return  \stubbles\webapp\response\Status
@throws  \InvalidArgumentException  in case $challenges is empty
sets status to 401 Unauthorized