src/CanvasPest.php
public function setupToken($token)
    {
        if (!empty($token)) {
            $this->headers['Authorization'] = "Bearer $token";
            return true;
        } else {
            if ($this->throw_exceptions) {
                throw new CanvasPest_Exception(
                    'API authorization token must be a non-zero-length string',
                    CanvasPest_Exception::INVALID_TOKEN
                );
            }
            return false;
        }
    }
public function setupToken($token)
    {
        if (!empty($token)) {
            $this->headers['Authorization'] = "Bearer $token";
            return true;
        } else {
            if ($this->throw_exceptions) {
                throw new CanvasPest_Exception(
                    'API authorization token must be a non-zero-length string',
                    CanvasPest_Exception::INVALID_TOKEN
                );
            }
            return false;
        }
    }
public function setupToken ( $ token ) { if ( ! empty ( $ token ) ) { $ this -> headers [ 'Authorization' ] = "Bearer $token" ; return true ; } else { if ( $ this -> throw_exceptions ) { throw new CanvasPest_Exception ( 'API authorization token must be a non-zero-length string' , CanvasPest_Exception :: INVALID_TOKEN ) ; } return false ; } }
Set up a new API access token to access this instance

@param string $token API access token

@return boolean

@throws CanvasPest_Exception INVALID_TOKEN on an empty or non-string token value
Set up a new API access token to access this instance