for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Resova\Endpoints\Baskets;
use Resova\Client;
use Resova\Models\PromotionRequest;
class Promotions extends Client
{
/**
* Create a basket promotion
* Creates a new basket promotion object.
*
* @param PromotionRequest $promotion
* @return $this
*/
public function create(PromotionRequest $promotion): self
// Set HTTP params
$this->type = 'post';
$this->endpoint = '/baskets/' . $this->basket_id . '/promotions';
$this->basket_id
boolean|object
concatenation
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
$this->endpoint = '/baskets/' . /** @scrutinizer ignore-type */ $this->basket_id . '/promotions';
basket_id
Resova\Endpoints\Baskets\Promotions
__get
$this->params = $promotion;
return $this;
}
* Retrieve a basket promotion
* Retrieves the details of a basket promotion. Provide the unique id for the basket promotion.
* @param int $promotion_id The basket promotion id
public function __invoke(int $promotion_id): self
$this->promotion_id = $promotion_id;
promotion_id
$this->type = 'get';
$this->endpoint = '/baskets/' . $this->basket_id . '/promotions/' . $promotion_id;
$this->endpoint = '/baskets/' . /** @scrutinizer ignore-type */ $this->basket_id . '/promotions/' . $promotion_id;
* Delete a basket promotion
* Permanently deletes a basket promotion. It cannot be undone.
public function delete(): self
$this->type = 'delete';
$this->endpoint = '/baskets/' . $this->basket_id . '/promotions/' . $this->promotion_id;
$this->endpoint = '/baskets/' . /** @scrutinizer ignore-type */ $this->basket_id . '/promotions/' . $this->promotion_id;
* List all basket promotions
* Returns a list of your basket promotions.
* The basket promotions are returned sorted by creation date, with the most recent basket purchase appearing first.
public function all(): self