php-extended/php-api-endpoint-object

This package is abandoned and no longer maintained. The author suggests using the php-extended/php-reifier-object package instead.

A library that implements the php-extended/php-api-endpoint-interface library

6.1.1 2023-08-13 08:36 UTC

README

A library that implements the php-extended/php-api-endpoint-interface library.

coverage build status

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar php-extended/php-api-endpoint-object ^6

Basic Usage

This library is made to be extended. The base Endpoint implementation is a generic object that is made to ease the transform into a really useful endpoint that may be something like :


use PhpExtended\Endpoint\Endpoint;

class MyEndpoint extends Endpoint
{

	public function getFoo() : Foo
	{
		return $this->getObject(Foo::class, $this->getDataProvider());
	}

}

Where getDataProvider() is a method that returns a data provider that get raw data, either from a file (csv, json, yaml, etc.) or network (json api, rest api, xml, parsed html, etc, even semantic formats..)

License

MIT (See license file).