public function create($username, $repository, array $params)
    {
        if (!isset($params['title'])) {
            throw new MissingArgumentException('title');
        }
        if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) {
            $params['state'] = 'open';
        }

        return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', $params);
    }
public function create($username, $repository, array $params)
    {
        if (!isset($params['title'])) {
            throw new MissingArgumentException('title');
        }
        if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) {
            $params['state'] = 'open';
        }

        return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', $params);
    }
public function create ( $ username , $ repository , array $ params ) { if ( ! isset ( $ params [ 'title' ] ) ) { throw new MissingArgumentException ( 'title' ) ; } if ( isset ( $ params [ 'state' ] ) && ! in_array ( $ params [ 'state' ] , [ 'open' , 'closed' ] ) ) { $ params [ 'state' ] = 'open' ; } return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/milestones' , $ params ) ; }
Create a milestone for a repository.

@link https://developer.github.com/v3/issues/milestones/#create-a-milestone

@param string $username
@param string $repository
@param array  $params

@throws \Github\Exception\MissingArgumentException

@return array
Create a milestone for a repository .