lib/Github/Api/Repository/Contents.php
public function rm($username, $repository, $path, $message, $sha, $branch = null, array $committer = null)
    {
        $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path);

        $parameters = [
          'message' => $message,
          'sha'     => $sha,
        ];

        if (null !== $branch) {
            $parameters['branch'] = $branch;
        }

        if (null !== $committer) {
            if (!isset($committer['name'], $committer['email'])) {
                throw new MissingArgumentException(['name', 'email']);
            }
            $parameters['committer'] = $committer;
        }

        return $this->delete($url, $parameters);
    }
public function rm($username, $repository, $path, $message, $sha, $branch = null, array $committer = null)
    {
        $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path);

        $parameters = [
          'message' => $message,
          'sha'     => $sha,
        ];

        if (null !== $branch) {
            $parameters['branch'] = $branch;
        }

        if (null !== $committer) {
            if (!isset($committer['name'], $committer['email'])) {
                throw new MissingArgumentException(['name', 'email']);
            }
            $parameters['committer'] = $committer;
        }

        return $this->delete($url, $parameters);
    }
public function rm ( $ username , $ repository , $ path , $ message , $ sha , $ branch = null , array $ committer = null ) { $ url = '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/contents/' . rawurlencode ( $ path ) ; $ parameters = [ 'message' => $ message , 'sha' => $ sha , ] ; if ( null !== $ branch ) { $ parameters [ 'branch' ] = $ branch ; } if ( null !== $ committer ) { if ( ! isset ( $ committer [ 'name' ] , $ committer [ 'email' ] ) ) { throw new MissingArgumentException ( [ 'name' , 'email' ] ) ; } $ parameters [ 'committer' ] = $ committer ; } return $ this -> delete ( $ url , $ parameters ) ; }
Deletes a file from a repository.

@link http://developer.github.com/v3/repos/contents/#delete-a-file

@param string      $username   the user who owns the repository
@param string      $repository the name of the repository
@param string      $path       path to file
@param string      $message    the commit message
@param string      $sha        blob SHA of the file being deleted
@param null|string $branch     name of a branch
@param null|array  $committer  information about the committer

@throws MissingArgumentException

@return array information about the updated file
Deletes a file from a repository .