idx
int64 0
60.3k
| question
stringlengths 101
6.21k
| target
stringlengths 7
803
|
|---|---|---|
5,400
|
protected function boot ( ) { $ this -> checkRequirements ( ) ; $ this -> yell ( " * We have configured your new Drupal VM to use PHP 7.2. If you would like to change this, edit box/config.yml." ) ; $ confirm = $ this -> confirm ( "Do you want to boot Drupal VM?" , TRUE ) ; if ( $ confirm ) { $ this -> say ( "In the future, run <comment>vagrant up</comment> to boot the VM." ) ; $ result = $ this -> taskExec ( "vagrant up" ) -> dir ( $ this -> getConfigValue ( 'repo.root' ) ) -> printOutput ( TRUE ) -> run ( ) ; if ( ! $ result -> wasSuccessful ( ) ) { $ this -> logger -> error ( "Drupal VM failed to boot. Read Drupal VM's previous output for more information." ) ; $ confirm = $ this -> confirm ( "Do you want to try to re-provision the VM? Sometimes this works." , TRUE ) ; if ( $ confirm ) { $ result = $ this -> taskExec ( "vagrant provision" ) -> dir ( $ this -> getConfigValue ( 'repo.root' ) ) -> printOutput ( TRUE ) -> run ( ) ; if ( ! $ result -> wasSuccessful ( ) ) { throw new BltException ( "Unable to provision virtual machine. This is likely due to an issue with your Drupal VM configuration and not BLT itself." ) ; } } } else { $ this -> yell ( "Drupal VM booted successfully." ) ; $ this -> say ( " * To run blt or drush commands against your VM, must SSH into the VM via <comment>vagrant ssh</comment>." ) ; $ this -> say ( " * From now on, please use vagrant commands to manage your virtual machine on this computer." ) ; } return $ result ; } }
|
Boots a Drupal VM .
|
5,401
|
protected function isDrupalVmRequired ( ) { $ composer_json = json_decode ( file_get_contents ( $ this -> getConfigValue ( 'repo.root' ) . '/composer.json' ) , TRUE ) ; return ! empty ( $ composer_json [ 'require-dev' ] [ 'geerlingguy/drupal-vm' ] ) && $ composer_json [ 'require-dev' ] [ 'geerlingguy/drupal-vm' ] == $ this -> drupalVmVersionConstraint ; }
|
Determines if Drupal VM is currently in composer . json s require - dev .
|
5,402
|
protected function checkRequirements ( ) { if ( ! $ this -> getInspector ( ) -> commandExists ( "vagrant" ) ) { $ this -> logger -> error ( "Vagrant is not installed." ) ; $ this -> say ( "Please install all dependencies for Drupal VM by following the Quickstart Guide:" ) ; $ this -> say ( "https://github.com/geerlingguy/drupal-vm#quick-start-guide" ) ; throw new BltException ( "Drupal VM requirements are missing." ) ; } else { $ this -> installVagrantPlugin ( 'vagrant-hostsupdater' ) ; } }
|
Checks local system for Drupal VM requirements .
|
5,403
|
protected function setBaseBox ( $ config ) { $ base_box = $ this -> askChoice ( "Which base box would you like to use?" , [ 'geerlingguy/drupal-vm' , 'geerlingguy/ubuntu1604' , ] , 0 ) ; switch ( $ base_box ) { case 'geerlingguy/ubuntu1604' : case 'geerlingguy/drupal-vm' : $ config -> set ( 'workspace' , '/root' ) ; $ config -> set ( 'extra_packages' , [ 'patchutils' , 'sqlite' , ] ) ; $ config -> set ( 'installed_extras' , [ 'adminer' , 'selenium' , 'drush' , 'mailhog' , 'memcached' , 'nodejs' , 'solr' , 'xdebug' , ] ) ; break ; } $ config -> set ( 'base_box' , $ base_box ) ; }
|
Sets the Drupal VM base box .
|
5,404
|
protected function customizeConfigFiles ( ) { $ config = clone $ this -> getConfig ( ) ; $ config -> set ( 'drupalvm.config.dir' , $ this -> vmConfigDir ) ; $ config -> expandFileProperties ( $ this -> projectDrupalVmVagrantfile ) ; $ random_local_ip = "192.168." . rand ( 3 , 254 ) . '.' . rand ( 3 , 254 ) ; $ config -> set ( 'random.ip' , $ random_local_ip ) ; $ this -> setBaseBox ( $ config ) ; $ config -> expandFileProperties ( $ this -> projectDrupalVmConfigFile ) ; }
|
Modifies the default configuration file .
|
5,405
|
protected function createConfigFiles ( ) { $ this -> logger -> info ( "Creating configuration files for Drupal VM..." ) ; $ this -> taskFilesystemStack ( ) -> mkdir ( $ this -> vmDir ) -> copy ( $ this -> defaultDrupalVmConfigFile , $ this -> projectDrupalVmConfigFile , TRUE ) -> copy ( $ this -> defaultDrupalVmVagrantfile , $ this -> projectDrupalVmVagrantfile , TRUE ) -> stopOnFail ( ) -> setVerbosityThreshold ( VerbosityThresholdInterface :: VERBOSITY_VERBOSE ) -> run ( ) ; }
|
Creates the default configuration file .
|
5,406
|
protected function createDrushAlias ( ) { $ this -> logger -> info ( "Adding a drush alias for the new VM..." ) ; if ( ! file_exists ( $ this -> projectDrushAliasesFile ) ) { $ new_aliases = Expander :: parse ( file_get_contents ( $ this -> defaultDrupalVmDrushAliasesFile ) , $ this -> getConfig ( ) -> export ( ) ) ; } else { $ project_drush_aliases = Expander :: parse ( file_get_contents ( $ this -> projectDrushAliasesFile ) , $ this -> getConfig ( ) -> export ( ) ) ; $ default_drupal_vm_drush_aliases = Expander :: parse ( file_get_contents ( $ this -> defaultDrupalVmDrushAliasesFile ) , $ this -> getConfig ( ) -> export ( ) ) ; $ new_aliases = ArrayManipulator :: arrayMergeRecursiveDistinct ( $ project_drush_aliases , $ default_drupal_vm_drush_aliases ) ; } file_put_contents ( $ this -> projectDrushAliasesFile , Yaml :: dump ( $ new_aliases ) ) ; }
|
Creates a new drush alias record .
|
5,407
|
protected function initializeBlt ( ) { $ this -> updateRootProjectFiles ( ) ; $ this -> taskExecStack ( ) -> dir ( $ this -> getConfigValue ( "repo.root" ) ) -> exec ( "composer drupal:scaffold" ) -> setVerbosityThreshold ( VerbosityThresholdInterface :: VERBOSITY_VERBOSE ) -> run ( ) ; $ config_initializer = new ConfigInitializer ( $ this -> getConfigValue ( 'repo.root' ) , $ this -> input ( ) ) ; $ new_config = $ config_initializer -> initialize ( ) ; $ this -> getConfig ( ) -> import ( $ new_config -> export ( ) ) ; $ this -> invokeCommand ( 'blt:init:settings' ) ; $ this -> invokeCommand ( 'recipes:blt:init:command' ) ; $ this -> invokeCommand ( 'blt:init:shell-alias' ) ; if ( DIRECTORY_SEPARATOR === '\\' ) { $ this -> input ( ) -> setInteractive ( FALSE ) ; } if ( $ this -> input ( ) -> isInteractive ( ) ) { $ this -> invokeCommand ( 'wizard' ) ; } }
|
Creates initial BLT files in their default state .
|
5,408
|
public function update ( $ options = [ 'since' => InputOption :: VALUE_REQUIRED ] ) { $ this -> rsyncTemplate ( ) ; $ starting_version = $ options [ 'since' ] ? : $ this -> currentSchemaVersion ; if ( $ this -> executeSchemaUpdates ( $ starting_version ) ) { $ this -> updateSchemaVersionFile ( ) ; } $ this -> cleanup ( ) ; $ this -> invokeCommand ( 'blt:init:shell-alias' ) ; }
|
Updates files from BLT s template and executes scripted updates .
|
5,409
|
public function cleanup ( ) { $ this -> say ( "Removing deprecated files and directories..." ) ; $ this -> taskFilesystemStack ( ) -> remove ( [ "build" , "docroot/sites/default/settings/apcu_fix.yml" , "docroot/sites/default/settings/base.settings.php" , "docroot/sites/default/settings/blt.settings.php" , "docroot/sites/default/settings/cache.settings.php" , "docroot/sites/default/settings/filesystem.settings.php" , "docroot/sites/default/settings/logging.settings.php" , "docroot/sites/default/settings/travis.settings.php" , "docroot/sites/default/settings/pipelines.settings.php" , "docroot/sites/default/settings/tugboat.settings.php" , "docroot/sites/settings/global.settings.default.php" , "tests/phpunit/blt" , "tests/phpunit/Bolt" , "scripts/blt" , "scripts/drupal" , "scripts/drupal-vm" , "scripts/git-hooks" , "scripts/release-notes" , "scripts/tugboat" , "blt.sh" , "project.yml" , "project.local.yml" , "example.project.local.yml" , "readme/acsf-setup.md" , "readme/architecture.md" , "readme/best-practices.md" , "readme/deploy.md" , "readme/dev-workflow.md" , "readme/features-workflow.md" , "readme/local-development.md" , "readme/onboarding.md" , "readme/project-tasks.md" , "readme/release-process.md" , "readme/repo-architecture.md" , "readme/views.md" , "drush/policy.drush.inc" , ] ) -> setVerbosityThreshold ( VerbosityThresholdInterface :: VERBOSITY_VERBOSE ) -> run ( ) ; }
|
Removes deprecated BLT files and directories .
|
5,410
|
protected function executeSchemaUpdates ( $ starting_version ) { $ starting_version = $ this -> convertLegacySchemaVersion ( $ starting_version ) ; $ updater = new Updater ( 'Acquia\Blt\Update\Updates' , $ this -> getConfigValue ( 'repo.root' ) ) ; $ updates = $ updater -> getUpdates ( $ starting_version ) ; if ( $ updates ) { $ this -> say ( "<comment>The following BLT updates are outstanding:</comment>" ) ; $ updater -> printUpdates ( $ updates ) ; $ confirm = $ this -> confirm ( 'Would you like to perform the listed updates?' , TRUE ) ; if ( $ confirm ) { try { $ updater -> executeUpdates ( $ updates ) ; return TRUE ; } catch ( \ Exception $ e ) { $ this -> logger -> error ( $ e -> getMessage ( ) ) ; return FALSE ; } } } }
|
Executes all update hooks for a given schema delta .
|
5,411
|
protected function convertLegacySchemaVersion ( $ version ) { if ( strpos ( $ version , '.' ) !== FALSE ) { str_replace ( '-beta1' , '' , $ version ) ; $ semver_array = explode ( '.' , $ version ) ; $ semver_array [ 1 ] = str_pad ( $ semver_array [ 1 ] , 3 , "0" , STR_PAD_LEFT ) ; $ semver_array [ 2 ] = str_pad ( $ semver_array [ 2 ] , 3 , "0" , STR_PAD_LEFT ) ; $ version = implode ( '' , $ semver_array ) ; } if ( strpos ( $ version , 'dev' ) !== FALSE ) { $ version = '0' ; } return $ version ; }
|
Converts legacy BLT schema version to current version .
|
5,412
|
protected function rsyncTemplate ( ) { $ source = $ this -> getConfigValue ( 'blt.root' ) . '/template' ; $ destination = $ this -> getConfigValue ( 'repo.root' ) ; if ( DIRECTORY_SEPARATOR === '\\' ) { $ source = $ this -> convertWindowsPathToCygwinPath ( $ source ) ; $ destination = $ this -> convertWindowsPathToCygwinPath ( $ destination ) ; } $ exclude_from = $ this -> getConfigValue ( 'blt.update.ignore-existing-file' ) ; $ this -> say ( "Copying files from BLT's template into your project..." ) ; $ result = $ this -> taskExecStack ( ) -> exec ( "rsync -a --no-g '$source/' '$destination/' --exclude-from='$exclude_from'" ) -> exec ( "rsync -a --no-g '$source/' '$destination/' --include-from='$exclude_from' --ignore-existing" ) -> setVerbosityThreshold ( VerbosityThresholdInterface :: VERBOSITY_VERBOSE ) -> run ( ) ; if ( ! $ result -> wasSuccessful ( ) ) { throw new BltException ( "Could not rsync files from BLT into your repository." ) ; } }
|
Rsyncs files from BLT s template dir into project root dir .
|
5,413
|
protected function mungeProjectYml ( ) { $ this -> say ( "Merging BLT's <comment>blt.yml</comment> template with your project's <comment>blt/blt.yml</comment>..." ) ; $ repo_project_yml = $ this -> getConfigValue ( 'blt.config-files.project' ) ; $ template_project_yml = $ this -> getConfigValue ( 'blt.root' ) . '/template/blt/blt.yml' ; $ munged_yml = YamlMunge :: mungeFiles ( $ template_project_yml , $ repo_project_yml ) ; try { YamlMunge :: writeFile ( $ repo_project_yml , $ munged_yml ) ; } catch ( \ Exception $ e ) { throw new BltException ( "Could not update $repo_project_yml." ) ; } }
|
Updates project BLT . yml files with new key value pairs from upstream .
|
5,414
|
protected function setProjectName ( ) { $ project_name = basename ( $ this -> getConfigValue ( 'repo.root' ) ) ; $ project_yml = $ this -> getConfigValue ( 'blt.config-files.project' ) ; $ project_config = YamlMunge :: parseFile ( $ project_yml ) ; $ project_config [ 'project' ] [ 'machine_name' ] = $ project_name ; YamlMunge :: writeFile ( $ project_yml , $ project_config ) ; }
|
Sets project . name using the directory name of repot . root .
|
5,415
|
public static function convertComposerJson ( $ composer_json ) { foreach ( $ composer_json [ 'require' ] as $ package_name => $ version_constraint ) { if ( $ package_name == 'drupal/core' ) { continue ; } if ( strstr ( $ package_name , 'drupal/' ) ) { $ composer_json [ 'require' ] [ $ package_name ] = self :: convertVersionConstraint ( $ version_constraint ) ; } } $ composer_json [ 'require' ] [ 'acquia/lightning' ] = '^2' ; unset ( $ composer_json [ 'require' ] [ 'drupal/lightning' ] ) ; foreach ( $ composer_json [ 'require-dev' ] as $ package_name => $ version_constraint ) { if ( strstr ( $ package_name , 'drupal/' ) ) { $ composer_json [ 'require-dev' ] [ $ package_name ] = self :: convertVersionConstraint ( $ version_constraint ) ; } } foreach ( $ composer_json [ 'repositories' ] as $ key => $ repository ) { if ( $ repository [ 'url' ] == 'https://packagist.drupal-composer.org' ) { unset ( $ composer_json [ 'repositories' ] [ $ key ] ) ; } } $ composer_json [ 'repositories' ] [ 'drupal' ] = [ 'type' => 'composer' , 'url' => 'https://packages.drupal.org/8' , ] ; return $ composer_json ; }
|
Converts composer . json from packagist . drupal - composer . org to D . O format .
|
5,416
|
protected static function convertVersionConstraint ( $ version_constraint ) { if ( preg_match ( '/-dev(#[0-9a-f]+)?$/' , $ version_constraint ) ) { return preg_replace ( '/^8\.(x-)?/' , NULL , $ version_constraint ) ; } if ( strpos ( $ version_constraint , 'dev-' ) === 0 ) { return preg_replace ( '/^dev-(8\.(x-)?)?([^#]+)(#[a-f0-9]+)?$/' , '$3-dev$4' , $ version_constraint ) ; } if ( preg_match ( '/^8\.\*$/' , $ version_constraint ) ) { return "*" ; } if ( preg_match ( '/^[\^~]8$/' , $ version_constraint ) ) { return '*@stable' ; } if ( preg_match ( '/^([\^~]|[><=!]{1,2})?8(\.)?(\d+)?(\.\d+)?(-(alpha|beta|rc)\d+)?(\.\*)?(@(dev|alpha|beta|rc))?/' , $ version_constraint , $ matches ) ) { $ new_version_constraint = $ matches [ 3 ] ; if ( isset ( $ matches [ 4 ] ) ) { $ new_version_constraint .= $ matches [ 4 ] ; } if ( isset ( $ matches [ 3 ] ) ) { $ new_version_constraint .= '.0' ; } else { $ new_version_constraint .= '*' ; } if ( isset ( $ matches [ 5 ] ) ) { $ new_version_constraint .= $ matches [ 5 ] ; } elseif ( isset ( $ matches [ 7 ] ) ) { $ new_version_constraint .= $ matches [ 7 ] ; } if ( isset ( $ matches [ 8 ] ) ) { $ new_version_constraint .= $ matches [ 8 ] ; } if ( isset ( $ matches [ 1 ] ) ) { $ new_version_constraint = $ matches [ 1 ] . $ new_version_constraint ; } return $ new_version_constraint ; } return $ version_constraint ; }
|
Converts from to to packagist . drupal - composer . org to D . O format .
|
5,417
|
public function updateAcsfSites ( $ site , $ target_env ) { $ this -> say ( "Running updates for site <comment>$site</comment> in environment <comment>$target_env</comment>." ) ; $ this -> switchSiteContext ( $ site ) ; $ this -> invokeCommand ( 'artifact:update:drupal' ) ; }
|
Executes updates against all ACSF sites in the target environment .
|
5,418
|
public function all ( $ username , $ repository , $ issue ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/issues/' . rawurlencode ( $ issue ) . '/timeline' ) ; }
|
Get all events for a specific issue .
|
5,419
|
public function repositories ( $ organization , $ type = 'all' , $ page = 1 ) { return $ this -> get ( '/orgs/' . rawurlencode ( $ organization ) . '/repos' , [ 'type' => $ type , 'page' => $ page , ] ) ; }
|
List all repositories across all the organizations that you can access .
|
5,420
|
public function createInstallationToken ( $ installationId , $ userId = null ) { $ parameters = [ ] ; if ( $ userId ) { $ parameters [ 'user_id' ] = $ userId ; } return $ this -> post ( '/app/installations/' . rawurlencode ( $ installationId ) . '/access_tokens' , $ parameters ) ; }
|
Create an access token for an installation .
|
5,421
|
public function listRepositories ( $ userId = null ) { $ parameters = [ ] ; if ( $ userId ) { $ parameters [ 'user_id' ] = $ userId ; } return $ this -> get ( '/installation/repositories' , $ parameters ) ; }
|
List repositories that are accessible to the authenticated installation .
|
5,422
|
public function show ( $ username , $ repository , $ reference ) { $ reference = $ this -> encodeReference ( $ reference ) ; return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/git/refs/' . $ reference ) ; }
|
Show the reference of a repository .
|
5,423
|
public function update ( $ username , $ repository , $ reference , array $ params ) { if ( ! isset ( $ params [ 'sha' ] ) ) { throw new MissingArgumentException ( 'sha' ) ; } $ reference = $ this -> encodeReference ( $ reference ) ; return $ this -> patch ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/git/refs/' . $ reference , $ params ) ; }
|
Update a reference for a repository .
|
5,424
|
public function remove ( $ username , $ repository , $ reference ) { $ reference = $ this -> encodeReference ( $ reference ) ; return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/git/refs/' . $ reference ) ; }
|
Delete a reference of a repository .
|
5,425
|
public function show ( $ username , $ repository , $ sha , $ recursive = false ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/git/trees/' . rawurlencode ( $ sha ) , $ recursive ? [ 'recursive' => 1 ] : [ ] ) ; }
|
Get the tree for a repository .
|
5,426
|
public function create ( $ username , $ repository , array $ params ) { if ( ! isset ( $ params [ 'tree' ] ) || ! is_array ( $ params [ 'tree' ] ) ) { throw new MissingArgumentException ( 'tree' ) ; } if ( ! isset ( $ params [ 'tree' ] [ 0 ] ) ) { $ params [ 'tree' ] = [ $ params [ 'tree' ] ] ; } foreach ( $ params [ 'tree' ] as $ key => $ tree ) { if ( ! isset ( $ tree [ 'path' ] , $ tree [ 'mode' ] , $ tree [ 'type' ] ) ) { throw new MissingArgumentException ( [ "tree.$key.path" , "tree.$key.mode" , "tree.$key.type" ] ) ; } if ( ! isset ( $ tree [ 'sha' ] ) && ! isset ( $ tree [ 'content' ] ) ) { throw new MissingArgumentException ( "tree.$key.content" ) ; } } return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/git/trees' , $ params ) ; }
|
Create tree for a repository .
|
5,427
|
public function configure ( $ bodyType = null ) { if ( ! in_array ( $ bodyType , [ 'text' , 'html' , 'full' ] ) ) { $ bodyType = 'raw' ; } $ this -> acceptHeaderValue = sprintf ( 'application/vnd.github.%s.%s+json' , $ this -> client -> getApiVersion ( ) , $ bodyType ) ; return $ this ; }
|
Configure the body type .
|
5,428
|
public function update ( $ gist , $ comment_id , $ body ) { return $ this -> patch ( '/gists/' . rawurlencode ( $ gist ) . '/comments/' . rawurlencode ( $ comment_id ) , [ 'body' => $ body ] ) ; }
|
Create a comment for a gist .
|
5,429
|
public function following ( $ username , array $ parameters = [ ] , array $ requestHeaders = [ ] ) { return $ this -> get ( '/users/' . rawurlencode ( $ username ) . '/following' , $ parameters , $ requestHeaders ) ; }
|
Request the users that a specific user is following .
|
5,430
|
public function followers ( $ username , array $ parameters = [ ] , array $ requestHeaders = [ ] ) { return $ this -> get ( '/users/' . rawurlencode ( $ username ) . '/followers' , $ parameters , $ requestHeaders ) ; }
|
Request the users following a specific user .
|
5,431
|
public function starred ( $ username , $ page = 1 , $ perPage = 30 , $ sort = 'created' , $ direction = 'desc' ) { return $ this -> get ( '/users/' . rawurlencode ( $ username ) . '/starred' , [ 'page' => $ page , 'per_page' => $ perPage , 'sort' => $ sort , 'direction' => $ direction , ] ) ; }
|
Request starred repositories that a specific user has starred .
|
5,432
|
public function status ( $ username , $ repository , $ id ) { $ link = $ this -> show ( $ username , $ repository , $ id ) [ '_links' ] [ 'statuses' ] [ 'href' ] ; return $ this -> get ( $ link ) ; }
|
All statuses which are the statuses of its head branch .
|
5,433
|
public function readme ( $ username , $ repository , $ reference = null ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/readme' , [ 'ref' => $ reference , ] ) ; }
|
Get content of README file in a repository .
|
5,434
|
public function show ( $ username , $ repository , $ path = null , $ reference = null ) { $ url = '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/contents' ; if ( null !== $ path ) { $ url .= '/' . rawurlencode ( $ path ) ; } return $ this -> get ( $ url , [ 'ref' => $ reference , ] ) ; }
|
Get contents of any file or directory in a repository .
|
5,435
|
public function create ( $ username , $ repository , $ path , $ content , $ message , $ branch = null , array $ committer = null ) { $ url = '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/contents/' . rawurlencode ( $ path ) ; $ parameters = [ 'content' => base64_encode ( $ content ) , 'message' => $ message , ] ; 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 -> put ( $ url , $ parameters ) ; }
|
Creates a new file in a repository .
|
5,436
|
public function exists ( $ username , $ repository , $ path , $ reference = null ) { $ url = '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/contents' ; if ( null !== $ path ) { $ url .= '/' . rawurlencode ( $ path ) ; } try { $ response = $ this -> head ( $ url , [ 'ref' => $ reference , ] ) ; if ( $ response -> getStatusCode ( ) !== 200 ) { return false ; } } catch ( TwoFactorAuthenticationRequiredException $ ex ) { throw $ ex ; } catch ( \ Exception $ ex ) { return false ; } return true ; }
|
Checks that a given path exists in a repository .
|
5,437
|
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 .
|
5,438
|
public function archive ( $ username , $ repository , $ format , $ reference = null ) { if ( ! in_array ( $ format , [ 'tarball' , 'zipball' ] ) ) { $ format = 'tarball' ; } return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/' . rawurlencode ( $ format ) . ( ( null !== $ reference ) ? ( '/' . rawurlencode ( $ reference ) ) : '' ) ) ; }
|
Get content of archives in a repository .
|
5,439
|
public function download ( $ username , $ repository , $ path , $ reference = null ) { $ file = $ this -> show ( $ username , $ repository , $ path , $ reference ) ; if ( ! isset ( $ file [ 'type' ] ) || ! in_array ( $ file [ 'type' ] , [ 'file' , 'symlink' ] , true ) ) { throw new InvalidArgumentException ( sprintf ( 'Path "%s" is not a file or a symlink to a file.' , $ path ) ) ; } if ( ! isset ( $ file [ 'content' ] ) ) { throw new ErrorException ( sprintf ( 'Unable to access "content" for file "%s" (possible keys: "%s").' , $ path , implode ( ', ' , array_keys ( $ file ) ) ) ) ; } if ( ! isset ( $ file [ 'encoding' ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Can\'t decode content of file "%s", as no encoding is defined.' , $ path ) ) ; } if ( 'base64' !== $ file [ 'encoding' ] ) { throw new InvalidArgumentException ( sprintf ( 'Encoding "%s" of file "%s" is not supported.' , $ file [ 'encoding' ] , $ path ) ) ; } return base64_decode ( $ file [ 'content' ] ) ? : null ; }
|
Get the contents of a file in a repository .
|
5,440
|
public function find ( $ username , $ repository , $ state , $ keyword ) { if ( ! in_array ( $ state , [ 'open' , 'closed' ] ) ) { $ state = 'open' ; } return $ this -> get ( '/legacy/issues/search/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/' . rawurlencode ( $ state ) . '/' . rawurlencode ( $ keyword ) ) ; }
|
Search issues by username repo state and keyword .
|
5,441
|
public function org ( $ organization , $ state , array $ params = [ ] ) { if ( ! in_array ( $ state , [ 'open' , 'closed' ] ) ) { $ state = 'open' ; } return $ this -> get ( '/orgs/' . rawurlencode ( $ organization ) . '/issues' , array_merge ( [ 'page' => 1 , 'state' => $ state ] , $ params ) ) ; }
|
List issues by organization .
|
5,442
|
public function lock ( $ username , $ repository , $ id ) { return $ this -> put ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/issues/' . rawurlencode ( $ id ) . '/lock' ) ; }
|
Lock an issue . Users with push access can lock an issue s conversation .
|
5,443
|
public function unlock ( $ username , $ repository , $ id ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/issues/' . rawurlencode ( $ id ) . '/lock' ) ; }
|
Unlock an issue . Users with push access can unlock an issue s conversation .
|
5,444
|
public function getResource ( $ name ) { if ( empty ( $ this -> resources ) ) { $ this -> fetchLimits ( ) ; } if ( ! isset ( $ this -> resources [ $ name ] ) ) { return false ; } return $ this -> resources [ $ name ] ; }
|
Returns a rate limit resource object by the given name .
|
5,445
|
protected function fetchLimits ( ) { $ result = $ this -> get ( '/rate_limit' ) ? : [ ] ; foreach ( $ result [ 'resources' ] as $ resourceName => $ resource ) { $ this -> resources [ $ resourceName ] = new RateLimitResource ( $ resourceName , $ resource ) ; } return $ result ; }
|
Returns the data directly from the GitHub API endpoint .
|
5,446
|
public function updateStatus ( $ username , $ repository , $ id , array $ params ) { if ( ! isset ( $ params [ 'state' ] ) ) { throw new MissingArgumentException ( [ 'state' ] ) ; } return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/deployments/' . rawurlencode ( $ id ) . '/statuses' , $ params ) ; }
|
Updates a deployment by creating a new status update .
|
5,447
|
public function getStatuses ( $ username , $ repository , $ id ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/deployments/' . rawurlencode ( $ id ) . '/statuses' ) ; }
|
Gets all of the status updates tied to a given deployment .
|
5,448
|
public static function getHeader ( ResponseInterface $ response , $ name ) { $ headers = $ response -> getHeader ( $ name ) ; return array_shift ( $ headers ) ; }
|
Get the value for a single header .
|
5,449
|
public function all ( $ includingRead = false , $ participating = false , DateTime $ since = null , DateTime $ before = null ) { $ parameters = [ 'all' => $ includingRead , 'participating' => $ participating , ] ; if ( $ since !== null ) { $ parameters [ 'since' ] = $ since -> format ( DateTime :: ISO8601 ) ; } if ( $ before !== null ) { $ parameters [ 'before' ] = $ before -> format ( DateTime :: ISO8601 ) ; } return $ this -> get ( '/notifications' , $ parameters ) ; }
|
Get a listing of notifications .
|
5,450
|
public function markRead ( DateTime $ since = null ) { $ parameters = [ ] ; if ( $ since !== null ) { $ parameters [ 'last_read_at' ] = $ since -> format ( DateTime :: ISO8601 ) ; } $ this -> put ( '/notifications' , $ parameters ) ; }
|
Marks all notifications as read from the current date .
|
5,451
|
public function listAvailable ( $ username , $ repository , array $ parameters = [ ] ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/assignees' , $ parameters ) ; }
|
List all the available assignees to which issues may be assigned .
|
5,452
|
public function check ( $ username , $ repository , $ assignee ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/assignees/' . rawurlencode ( $ assignee ) ) ; }
|
Check to see if a particular user is an assignee for a repository .
|
5,453
|
public function add ( $ username , $ repository , $ issue , array $ parameters ) { if ( ! isset ( $ parameters [ 'assignees' ] ) ) { throw new MissingArgumentException ( 'assignees' ) ; } if ( ! is_array ( $ parameters [ 'assignees' ] ) ) { @ trigger_error ( sprintf ( 'Passing the "assignees" parameter as a string in "%s" is deprecated and will throw an exception in php-github-api version 3.0. Pass an array of strings instead' , __METHOD__ ) , E_USER_DEPRECATED ) ; $ parameters [ 'assignees' ] = [ $ parameters [ 'assignees' ] ] ; } return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/issues/' . rawurlencode ( $ issue ) . '/assignees' , $ parameters ) ; }
|
Add assignees to an Issue .
|
5,454
|
public function remove ( $ username , $ repository , $ issue , array $ parameters ) { if ( ! isset ( $ parameters [ 'assignees' ] ) ) { throw new MissingArgumentException ( 'assignees' ) ; } return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/issues/' . rawurlencode ( $ issue ) . '/assignees' , $ parameters ) ; }
|
Remove assignees from an Issue .
|
5,455
|
public function show ( $ username , $ repository , $ event ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/issues/events/' . rawurlencode ( $ event ) ) ; }
|
Display an event for an issue .
|
5,456
|
public function show ( $ username , $ repository , $ sha ) { $ response = $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/git/blobs/' . rawurlencode ( $ sha ) ) ; return $ response ; }
|
Show a blob of a sha for a repository .
|
5,457
|
public function all ( $ username , $ repository , $ pullRequest = null , array $ params = [ ] ) { if ( null !== $ pullRequest ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . rawurlencode ( $ pullRequest ) . '/comments' ) ; } $ parameters = array_merge ( [ 'page' => 1 , 'per_page' => 30 , ] , $ params ) ; return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/comments' , $ parameters ) ; }
|
Get a listing of a pull request s comments by the username repository and pull request number or all repository comments by the username and repository .
|
5,458
|
public function remove ( $ username , $ repository , $ comment ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/comments/' . rawurlencode ( $ comment ) ) ; }
|
Delete a pull request comment by the username repository and comment id .
|
5,459
|
public function update ( $ username , $ repository , array $ values ) { return $ this -> patch ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) , $ values ) ; }
|
Set information of a repository .
|
5,460
|
public function readme ( $ username , $ repository , $ format = 'raw' ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/readme' , [ ] , [ 'Accept' => "application/vnd.github.$format" , ] ) ; }
|
Get the readme content for a repository by its username and repository name .
|
5,461
|
public function contributors ( $ username , $ repository , $ includingAnonymous = false ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/contributors' , [ 'anon' => $ includingAnonymous ? : null , ] ) ; }
|
Get the contributors of a repository .
|
5,462
|
public function tags ( $ username , $ repository , array $ params = [ ] ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/tags' , $ params ) ; }
|
Get the tags of a repository .
|
5,463
|
public function codeOfConduct ( $ username , $ repository ) { $ this -> acceptHeaderValue = 'application/vnd.github.scarlet-witch-preview+json' ; return $ this -> get ( '/repos/' . rawurldecode ( $ username ) . '/' . rawurldecode ( $ repository ) . '/community/code_of_conduct' ) ; }
|
Get the contents of a repository s code of conduct .
|
5,464
|
public function topics ( $ username , $ repository ) { $ this -> acceptHeaderValue = 'application/vnd.github.mercy-preview+json' ; return $ this -> get ( '/repos/' . rawurldecode ( $ username ) . '/' . rawurldecode ( $ repository ) . '/topics' ) ; }
|
List all topics for a repository .
|
5,465
|
public function replaceTopics ( $ username , $ repository , array $ topics ) { $ this -> acceptHeaderValue = 'application/vnd.github.mercy-preview+json' ; return $ this -> put ( '/repos/' . rawurldecode ( $ username ) . '/' . rawurldecode ( $ repository ) . '/topics' , [ 'names' => $ topics ] ) ; }
|
Replace all topics for a repository .
|
5,466
|
public function transfer ( $ username , $ repository , $ newOwner , $ teamId = [ ] ) { $ this -> acceptHeaderValue = 'application/vnd.github.nightshade-preview+json' ; return $ this -> post ( '/repos/' . rawurldecode ( $ username ) . '/' . rawurldecode ( $ repository ) . '/transfer' , [ 'new_owner' => $ newOwner , 'team_id' => $ teamId ] ) ; }
|
Transfer a repository .
|
5,467
|
public function all ( $ username , $ repository , array $ params = [ ] ) { if ( isset ( $ params [ 'state' ] ) && ! in_array ( $ params [ 'state' ] , [ 'open' , 'closed' , 'all' ] ) ) { $ params [ 'state' ] = 'open' ; } if ( isset ( $ params [ 'sort' ] ) && ! in_array ( $ params [ 'sort' ] , [ 'due_date' , 'completeness' ] ) ) { $ params [ 'sort' ] = 'due_date' ; } if ( isset ( $ params [ 'direction' ] ) && ! in_array ( $ params [ 'direction' ] , [ 'asc' , 'desc' ] ) ) { $ params [ 'direction' ] = 'asc' ; } return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/milestones' , array_merge ( [ 'page' => 1 , 'state' => 'open' , 'sort' => 'due_date' , 'direction' => 'asc' , ] , $ params ) ) ; }
|
Get all milestones for a repository .
|
5,468
|
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 .
|
5,469
|
public function update ( $ username , $ repository , $ id , array $ params ) { if ( isset ( $ params [ 'state' ] ) && ! in_array ( $ params [ 'state' ] , [ 'open' , 'closed' ] ) ) { $ params [ 'state' ] = 'open' ; } return $ this -> patch ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/milestones/' . rawurlencode ( $ id ) , $ params ) ; }
|
Update a milestone for a repository .
|
5,470
|
public function remove ( $ username , $ repository , $ id ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/milestones/' . rawurlencode ( $ id ) ) ; }
|
Delete a milestone for a repository .
|
5,471
|
public function labels ( $ username , $ repository , $ id ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/milestones/' . rawurlencode ( $ id ) . '/labels' ) ; }
|
Get the labels of a milestone .
|
5,472
|
public function show ( $ username , $ repository , $ pullRequest , $ id ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . $ pullRequest . '/reviews/' . $ id ) ; }
|
Get a single pull request review by the username repository pull request number and the review id .
|
5,473
|
public function comments ( $ username , $ repository , $ pullRequest , $ id ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . rawurlencode ( $ pullRequest ) . '/reviews/' . rawurlencode ( $ id ) . '/comments' ) ; }
|
Get comments for a single pull request review .
|
5,474
|
public function create ( $ username , $ repository , $ pullRequest , array $ params = [ ] ) { if ( array_key_exists ( 'event' , $ params ) && ! in_array ( $ params [ 'event' ] , [ 'APPROVE' , 'REQUEST_CHANGES' , 'COMMENT' ] , true ) ) { throw new InvalidArgumentException ( sprintf ( '"event" must be one of ["APPROVE", "REQUEST_CHANGES", "COMMENT"] ("%s" given).' , $ params [ 'event' ] ) ) ; } return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . $ pullRequest . '/reviews' , $ params ) ; }
|
Create a pull request review by the username repository and pull request number .
|
5,475
|
public function submit ( $ username , $ repository , $ pullRequest , $ id , array $ params = [ ] ) { if ( ! isset ( $ params [ 'event' ] ) ) { throw new MissingArgumentException ( 'event' ) ; } if ( ! in_array ( $ params [ 'event' ] , [ 'APPROVE' , 'REQUEST_CHANGES' , 'COMMENT' ] , true ) ) { throw new InvalidArgumentException ( sprintf ( '"event" must be one of ["APPROVE", "REQUEST_CHANGES", "COMMENT"] ("%s" given).' , $ params [ 'event' ] ) ) ; } return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . $ pullRequest . '/reviews/' . $ id . '/events' , $ params ) ; }
|
Submit a pull request review by the username repository pull request number and the review id .
|
5,476
|
public function dismiss ( $ username , $ repository , $ pullRequest , $ id , $ message ) { if ( ! is_string ( $ message ) ) { throw new InvalidArgumentException ( sprintf ( '"message" must be a valid string ("%s" given).' , gettype ( $ message ) ) ) ; } if ( empty ( $ message ) ) { throw new InvalidArgumentException ( '"message" is mandatory and cannot be empty' ) ; } return $ this -> put ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . $ pullRequest . '/reviews/' . $ id . '/dismissals' , [ 'message' => $ message , ] ) ; }
|
Dismiss a pull request review by the username repository pull request number and the review id .
|
5,477
|
public function update ( $ username , $ repository , $ pullRequest , $ id , $ body ) { if ( ! is_string ( $ body ) ) { throw new InvalidArgumentException ( sprintf ( '"body" must be a valid string ("%s" given).' , gettype ( $ body ) ) ) ; } if ( empty ( $ body ) ) { throw new InvalidArgumentException ( '"body" is mandatory and cannot be empty' ) ; } return $ this -> put ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/pulls/' . $ pullRequest . '/reviews/' . $ id , [ 'body' => $ body , ] ) ; }
|
Update a pull request review by the username repository pull request number and the review id .
|
5,478
|
private function setEnterpriseUrl ( $ enterpriseUrl ) { $ builder = $ this -> getHttpClientBuilder ( ) ; $ builder -> removePlugin ( Plugin \ AddHostPlugin :: class ) ; $ builder -> removePlugin ( PathPrepend :: class ) ; $ builder -> addPlugin ( new Plugin \ AddHostPlugin ( UriFactoryDiscovery :: find ( ) -> createUri ( $ enterpriseUrl ) ) ) ; $ builder -> addPlugin ( new PathPrepend ( sprintf ( '/api/%s' , $ this -> getApiVersion ( ) ) ) ) ; }
|
Sets the URL of your GitHub Enterprise instance .
|
5,479
|
public function show ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection' ) ; }
|
Retrieves configured protection for the provided branch .
|
5,480
|
public function update ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> put ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection' , $ params ) ; }
|
Updates the repo s branch protection .
|
5,481
|
public function remove ( $ username , $ repository , $ branch ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection' ) ; }
|
Remove the repo s branch protection .
|
5,482
|
public function showStatusChecks ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks' ) ; }
|
Get required status checks of protected branch .
|
5,483
|
public function updateStatusChecks ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> patch ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks' , $ params ) ; }
|
Update required status checks of protected branch .
|
5,484
|
public function removeStatusChecks ( $ username , $ repository , $ branch ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks' ) ; }
|
Remove required status checks of protected branch .
|
5,485
|
public function showStatusChecksContexts ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks/contexts' ) ; }
|
List required status checks contexts of protected branch .
|
5,486
|
public function replaceStatusChecksContexts ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> put ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks/contexts' , $ params ) ; }
|
Replace required status checks contexts of protected branch .
|
5,487
|
public function addStatusChecksContexts ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks/contexts' , $ params ) ; }
|
Add required status checks contexts of protected branch .
|
5,488
|
public function removeStatusChecksContexts ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_status_checks/contexts' , $ params ) ; }
|
Remove required status checks contexts of protected branch .
|
5,489
|
public function showPullRequestReviewEnforcement ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_pull_request_reviews' ) ; }
|
Get pull request review enforcement of protected branch .
|
5,490
|
public function updatePullRequestReviewEnforcement ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> patch ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_pull_request_reviews' , $ params ) ; }
|
Update pull request review enforcement of protected branch .
|
5,491
|
public function removePullRequestReviewEnforcement ( $ username , $ repository , $ branch ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/required_pull_request_reviews' ) ; }
|
Remove pull request review enforcement of protected branch .
|
5,492
|
public function showAdminEnforcement ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/enforce_admins' ) ; }
|
Get admin enforcement of protected branch .
|
5,493
|
public function addAdminEnforcement ( $ username , $ repository , $ branch ) { return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/enforce_admins' ) ; }
|
Add admin enforcement of protected branch .
|
5,494
|
public function removeAdminEnforcement ( $ username , $ repository , $ branch ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/enforce_admins' ) ; }
|
Remove admin enforcement of protected branch .
|
5,495
|
public function showRestrictions ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/restrictions' ) ; }
|
Get restrictions of protected branch .
|
5,496
|
public function removeRestrictions ( $ username , $ repository , $ branch ) { return $ this -> delete ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/restrictions' ) ; }
|
Remove restrictions of protected branch .
|
5,497
|
public function showTeamRestrictions ( $ username , $ repository , $ branch ) { return $ this -> get ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/restrictions/teams' ) ; }
|
List team restrictions of protected branch .
|
5,498
|
public function replaceTeamRestrictions ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> put ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/restrictions/teams' , $ params ) ; }
|
Replace team restrictions of protected branch .
|
5,499
|
public function addTeamRestrictions ( $ username , $ repository , $ branch , array $ params = [ ] ) { return $ this -> post ( '/repos/' . rawurlencode ( $ username ) . '/' . rawurlencode ( $ repository ) . '/branches/' . rawurlencode ( $ branch ) . '/protection/restrictions/teams' , $ params ) ; }
|
Add team restrictions of protected branch .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.