gammadia / totem-php-wrapper
This package is abandoned and no longer maintained.
No replacement package was suggested.
PHP Wrapper for Totem
1.0.1
2022-04-13 10:55 UTC
Requires
- php: ^7.2 || >=8.0.2
- gammadia/jms-serializer-1.x: ^1.14
- guzzlehttp/guzzle: ^7.0
- symfony/yaml: ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- mockery/mockery: ^1.3.4
- overtrue/phplint: ^2.4 || ^3.0 || ^4.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8.5
README
Files structures
- src/Entity: contains the DTO (https://en.wikipedia.org/wiki/Data_transfer_object) for the communication with Totem (ex: Entity/Person represents the POST request to create a user into Totem)
- src/Exception: contains the ApiException class and a wrapper to wrap some specific Error (401, 409, etc)
- src/Handler: used for serialisation of the DTO
- src/HttpClient: abstraction layer for Guzzle Http Client (+ middleware)
- src/Resources: configuration file for the serializer
- src/Security: security layer for authentication (used by HttpClient)
- src/Serializer: contains serializer builder
- src/Service: contains the services that wrap the different calls with the API (Totem) with methods
(ex:
$servicePerson->createPerson($person);
) - Client: base class that declare the different services (person atm.)
- ClientBuilder: Builder for Clients
Usages
For each call we want to wrap/create, we must implements a method and place it in the correct service:
- If the call is relative to an existing service (like person), it must be placed it into this service.
- If the call is relative to a new "domain" like "sector", a new service "sector" should be created into the namespace Client\Totem\Service with a method that represents the call in it.
For all new method in service, or new services, the corresponding tests have to be written and placed in the /tests directory.
Test
To execute the tests, from Tipee root directory we have to $ cd Client/Totem
and the execute the tests $ vendors/bin/phpunit