PHP code example of tebru / retrofit-bundle
1. Go to this page and download the library: Download tebru/retrofit-bundle 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/ */
tebru / retrofit-bundle example snippets
new Tebru\RetrofitBundle\TebruRetrofitBundle()
namespace AppBundle;
use Tebru\Retrofit\Adapter\Rest\RestAdapter;
class FooBarRestAdapterProvider
{
public static function get($baseUrl)
{
// setup additional dependencies like an http client here and use
// the setters to add them to the builder
// build the rest adapter
return RestAdapter::builder()
->setBaseUrl($baseUrl)
->build();
}
}
namespace AppBundle;
use Tebru\Retrofit\Annotation as Rest;
interface Foo
{
/**
* @Rest\GET("/get/{id}")
*/
public function getFoo($id);
}