utils/maintenance/GitHub.php
public static function get_project_milestone_pull_requests(
		$project,
		$milestone_id
	) {
		$request_url = sprintf(
			self::API_ROOT . 'repos/%s/issues',
			$project
		);

		$args = [
			'per_page'  => 100,
			'milestone' => $milestone_id,
			'state'     => 'all',
		];

		$pull_requests = [];
		do {
			list( $body, $headers ) = self::request( $request_url, $args );
			foreach ( $body as $issue ) {
				if ( ! empty( $issue->pull_request ) ) {
					$pull_requests[] = $issue;
				}
			}
			$args        = [];
			$request_url = false;
			// Set $request_url to 'rel="next" if present'
			if ( ! empty( $headers['Link'] ) ) {
				$bits = explode( ',', $headers['Link'] );
				foreach ( $bits as $bit ) {
					if ( false !== stripos( $bit, 'rel="next"' ) ) {
						$hrefandrel  = explode( '; ', $bit );
						$request_url = trim( trim( $hrefandrel[0] ), '<>' );
						break;
					}
				}
			}
		} while ( $request_url );

		return $pull_requests;
	}
public static function get_project_milestone_pull_requests(
		$project,
		$milestone_id
	) {
		$request_url = sprintf(
			self::API_ROOT . 'repos/%s/issues',
			$project
		);

		$args = [
			'per_page'  => 100,
			'milestone' => $milestone_id,
			'state'     => 'all',
		];

		$pull_requests = [];
		do {
			list( $body, $headers ) = self::request( $request_url, $args );
			foreach ( $body as $issue ) {
				if ( ! empty( $issue->pull_request ) ) {
					$pull_requests[] = $issue;
				}
			}
			$args        = [];
			$request_url = false;
			// Set $request_url to 'rel="next" if present'
			if ( ! empty( $headers['Link'] ) ) {
				$bits = explode( ',', $headers['Link'] );
				foreach ( $bits as $bit ) {
					if ( false !== stripos( $bit, 'rel="next"' ) ) {
						$hrefandrel  = explode( '; ', $bit );
						$request_url = trim( trim( $hrefandrel[0] ), '<>' );
						break;
					}
				}
			}
		} while ( $request_url );

		return $pull_requests;
	}
public static function get_project_milestone_pull_requests ( $ project , $ milestone_id ) { $ request_url = sprintf ( self :: API_ROOT . 'repos/%s/issues' , $ project ) ; $ args = [ 'per_page' => 100 , 'milestone' => $ milestone_id , 'state' => 'all' , ] ; $ pull_requests = [ ] ; do { list ( $ body , $ headers ) = self :: request ( $ request_url , $ args ) ; foreach ( $ body as $ issue ) { if ( ! empty ( $ issue -> pull_request ) ) { $ pull_requests [ ] = $ issue ; } } $ args = [ ] ; $ request_url = false ; // Set $request_url to 'rel="next" if present' if ( ! empty ( $ headers [ 'Link' ] ) ) { $ bits = explode ( ',' , $ headers [ 'Link' ] ) ; foreach ( $ bits as $ bit ) { if ( false !== stripos ( $ bit , 'rel="next"' ) ) { $ hrefandrel = explode ( '; ' , $ bit ) ; $ request_url = trim ( trim ( $ hrefandrel [ 0 ] ) , '<>' ) ; break ; } } } } while ( $ request_url ) ; return $ pull_requests ; }
Gets the pull requests assigned to a milestone of a given project.

@param string  $project
@param integer $milestone_id

@return array
Gets the pull requests assigned to a milestone of a given project .