1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38:
<?php
/**
* Erply Books API PHP client
*
* @author Rene Korss <rene@koren.ee>
* @copyright Copyright (c) 2020 Rene Korss (https://koren.ee)
* @license MIT
*/
namespace Koren\ErplyBooks\Resource\Traits;
use BadMethodCallException;
use Koren\ErplyBooks\Response\ItemResponse;
/**
* Trait that denies POST requests
*/
trait NoPost
{
/**
* POST query
*
* @param array $data
*
* @return \Koren\ErplyBooks\Response\ItemResponse
*
* @throws BadMethodCallException
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function post($data = []) : ItemResponse
{
throw new BadMethodCallException(
'POST request is not supported on '.(new \ReflectionClass($this))->getShortName().' resource.'
);
}
}