composer require itk-dev/getorganized-api-client-php
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();
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.
<?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__,
[]
);
}
}
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
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
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