itk-dev / getorganized-api-client-php
PHP client for GetOrganized API
Installs: 4 367
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- ext-dom: *
- ext-json: *
- symfony/http-client: ^5.4 || ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.7
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.5
- symfony/finder: ^5.4 || ^6.0
- symfony/yaml: ^5.4 || ^6.0
This package is auto-updated.
Last update: 2024-10-18 10:19:55 UTC
README
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.1-fpm:latest composer install docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-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.1-fpm:latest composer install docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-check
Automatically fix some coding standards issues by running
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-apply
Code analysis
docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install docker run --interactive --tty --rm --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer code-analysis