Skip to content

itk-dev/getorganized-api-client-php

Repository files navigation

GetOrganized API client

Installation

composer require itk-dev/getorganized-api-client-php

Usage

use ItkDev\GetOrganized\Client;

$client = new Client($username, $password, $webApplicationUrl);

// Get specific service, e.g. tiles or cases

$tilesService = $client->api('tiles');

$tiles = $tilesService->GetTilesNavigation();

Services

To group GetOrganized API endpoints that consider specific GetOrganized modules or entities, e.g. Tiles or Cases, we create services that extend the abstract ItkDev\GetOrganized\Service class.

Example Tiles service

<?php

namespace ItkDev\GetOrganized\Service;

use ItkDev\GetOrganized\Service;

class Tiles extends Service
{
    protected function getApiBaseUrl(): string
    {
        return '/_goapi/Administration/';
    }

    public function GetTilesNavigation()
    {
        return $this->getData(
            'GET',
            $this->getApiBaseUrl().__FUNCTION__,
            []
        );
    }
}

Development

Tests

docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest vendor/bin/phpunit

Coding standards

The following commands let you test that the code adheres to the coding standards:

docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer coding-standards-check

Automatically fix some coding standards issues by running

docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer coding-standards-apply

Code analysis

docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer code-analysis

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages