Return repo data for API calls.

@access protected

@return array
501086
protected function return_repo_type() {
		$arr         = [];
		$arr['type'] = $this->type->type;

		switch ( $this->type->git ) {
			case 'github':
				$arr['git']           = 'github';
				$arr['base_uri']      = 'https://api.github.com';
				$arr['base_download'] = 'https://github.com';
				break;
			case 'bitbucket':
				$arr['git'] = 'bitbucket';
				if ( empty( $this->type->enterprise ) ) {
					$arr['base_uri']      = 'https://api.bitbucket.org';
					$arr['base_download'] = 'https://bitbucket.org';
				} else {
					$arr['base_uri']      = $this->type->enterprise_api;
					$arr['base_download'] = $this->type->enterprise;
				}
				break;
			case 'gitlab':
				$arr['git']           = 'gitlab';
				$arr['base_uri']      = 'https://gitlab.com/api/v4';
				$arr['base_download'] = 'https://gitlab.com';
				break;
			case 'gitea':
				$arr['git']           = 'gitea';
				$arr['base_uri']      = $this->type->enterprise . '/api/v1';
				$arr['base_download'] = $this->type->enterprise;
				break;
		}

		return $arr;
	}
1331981
public function getInformation(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
638287
protected function _get_github_api_data() {
		$response = $this->_request_github_api();
		if ( is_wp_error( $response ) ) {
			return $response;
		}

		$response_code = wp_remote_retrieve_response_code( $response );
		$body = json_decode( wp_remote_retrieve_body( $response ) );

		if ( 200 == $response_code ) {
			return $body;
		}

		return new \WP_Error(
			$response_code,
			'Inc2734_WP_GitHub_Theme_Updater error. ' . $body->message
		);
	}
228825
protected function _get_transient_api_data() {
		$transient_name = sprintf( 'wp_github_theme_updater_%1$s', $this->theme_name );
		$transient = get_transient( $transient_name );

		if ( false !== $transient ) {
			return $transient;
		}

		$api_data = $this->_get_github_api_data();
		set_transient( $transient_name, $api_data, 60 * 5 );
		return $api_data;
	}
441342
public function getData()
    {
        $this->validate('transactionReference', 'MD', 'PaRes');

        return [
            'opcode'     => 3,
            'payment_id' => $this->getTransactionReference(),
            'PaRes'      => $this->getPaRes(),
            'MD'         => $this->getMD(),
            'token'      => $this->getRequestToken(),
        ];
    }
1338403
protected function getClassMetadata()
    {
        $classes = array();
        foreach ($this->_repositories as $repository) {
            $classes[] = $repository->getClassMetadata();
        }
        return $classes;
    }
432919
protected function getMappingData(): array
    {
        $mappings = [];

        foreach ($this->locator->getMappingFiles() as $mappingFile) {
            $mappings[] = $this->loadMappingFile($mappingFile);
        }

        $mappingData = [];
        foreach ($mappings as $mapping) {
            $mappingData = $this->mergeMappings($mappingData, $mapping);
        }

        return $mappingData;
    }
1298539
public function toArray()
    {
        $array = [];

        $array['repository'] = $this->getRepository();

        $array['keys'] = [];
        foreach ($this->getKeys() as $primaryKey) {
            $array['keys'][] = $primaryKey->toArray();
        }

        if (!empty($this->getDependencies())) {
            $array['dependencies'] = $this->getDependencies()->toArray();
        }

        if (!empty($this->getActions())) {
            $array['actions'] = $this->getActions()->toArray();
        }

        return $array;
    }
311536
public function getRedirectData()
    {
        $data = $this->getData();
        $request = $this->getRequest()->getParameters();

        return [
            'PaReq'   => $data['additional']['secure3d']['retransmit']['PaReq'],
            'MD'      => $data['additional']['secure3d']['retransmit']['MD'],
            'TermUrl' => $request['returnUrl'],
        ];
    }
525082
protected function getRepositoryReleases()
    {
        if (empty($this->config['repository_vendor']) || empty($this->config['repository_name'])) {
            throw new \Exception('No repository specified. Please enter a valid Github repository owner and name in your config.');
        }

        return $this->client->request(
            'GET',
            self::GITHUB_API_URL.'/repos/'.$this->config['repository_vendor'].'/'.$this->config['repository_name'].'/tags'
        );
    }
675830
public function getData()
    {
        $systemInformation                  = [];
        $systemInformation['newup_version'] = Application::VERSION;

        return $this->dataArray + $systemInformation + $this->collectData();
    }
366435
public function data()
    {
        $data = [
            'filesystems' => array_keys((array)Configure::read(self::CONFIGURE_KEY)),
            'instances' => [],
        ];

        foreach ($data['filesystems'] as $filesystem) {
            $data['instances'][$filesystem] = FilesystemRegistry::retrieve($filesystem);
        }

        return $data;
    }
1310390
protected function getGithubTags($repo)
    {
        $jsonTags = $this->retrieveContentFromUrl(
            'https://api.github.com/repos/' . $repo . '/tags'
        );

        return array_map(
            function ($tag) {
                return $tag['name'];
            },
            json_decode($jsonTags, true)
        );
    }
1371030
public static function apps(): array
    {
        self::initialize();
        $apps = [];
        foreach (self::$repositories as $name => $repository) {
            $apps[] = $name;
        }
        return $apps;
    }
579421
public function listRepositoryLabels(): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repos/:owner/:repo/labels', $this->getIssues()->getOwner(),
                                                 $this->getIssues()->getRepo()));
    }
786036
public function getData()
    {
        if ($this->getAppleReference() !== null) {
            $this->validate('amount', 'appleReference');

            $data = [
                'opcode'      => 4,
                'product_id'  => $this->getProductId(),
                'apple_token' => urlencode(base64_encode(json_encode($this->getAppleReference()))),
                'token'       => $this->getRequestToken(),
            ];
        } elseif ($this->getCardReference() !== null) {
            $this->validate(
                'amount',
                'card',
                'cardReference',
                'transactionId',
                'clientIp',
                'returnUrl'
            );

            $data = [
                'opcode'      => 21,
                'product_id'  => $this->getProductId(),
                'payment_id'  => $this->getCardReference(),
                'amount'      => $this->getAmount(),
                'cf'          => $this->getTransactionId(),
                'ip_address'  => $this->getClientIp(),
                'cvv'         => $this->getCard()->getCvv(),
                'pp_identity' => 'card',
                'token'       => $this->getRequestToken(),
            ];
        } else {
            $this->validate(
                'amount',
                'card',
                'transactionId',
                'clientIp',
                'returnUrl'
            );

            $card = $this->getCard();

            $card->validate();

            $data = [
                'opcode'      => 0,
                'product_id'  => $this->getProductId(),
                'amount'      => $this->getAmount(),
                'cf'          => $this->getTransactionId(),
                'ip_address'  => $this->getClientIp(),
                'pan'         => $card->getNumber(),
                'cardholder'  => $card->getName(),
                'exp_month'   => $card->getExpiryMonth(),
                'exp_year'    => $card->getExpiryYear(),
                'cvv'         => $card->getCvv(),
                'pp_identity' => 'card',
                'token'       => $this->getRequestToken(),
            ];
        }

        if ($this->getPhone()) {
            $data['phone'] = $this->getPhone();
        }
        if ($this->getCf2()) {
            $data['cf2'] = $this->getCf2();
        }
        if ($this->getCf3()) {
            $data['cf3'] = $this->getCf3();
        }
        if ($this->getCallbackUrl()) {
            $data['cb_url'] = $this->getCallbackUrl();
        }

        return $data;
    }
1065960
public function getRepositoryLicenseContent(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/license', $this->getOwner(),
            $this->getRepo()));
    }