PHP code example of matryoshka-model / service-api

1. Go to this page and download the library: Download matryoshka-model/service-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

matryoshka-model / service-api example snippets


'service_manager'    => [
    'factories' => [
        'Matryoshka\Service\Api\Client\HttpClient' => 'Matryoshka\Service\Api\Service\HttpClientServiceFactory',
    ],
    'abstract_factories' => [
        'Matryoshka\Service\Api\Service\HttpApiAbstractServiceFactory',
    ],
],

'matryoshka-httpclient' => [
    'uri'       => 'http://example.net/path', //base uri
    ... //any other options available for Zend\Http\Client
],

'matryoshka-service-api'    => [
    'YourApiServiceName' => [
        'http_client'        => 'Matryoshka\Service\Api\Client\HttpClient', // http client service name
        'base_request'       => 'Zend\Http\Request',                        // base request service name
        'valid_status_code'  => [],                                         // Array of int code valid
        'request_format'     => 'json',                                     // string json/xml
        'profiler'           => '',                                         // profiler service name
    ],
    ...
],