for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Leonidas\Library\System\Post\Constraints;
use Leonidas\Contracts\Http\ConstrainerInterface;
use Leonidas\Traits\ExpectsPostTrait;
use Psr\Http\Message\ServerRequestInterface;
class PostConstrainer implements ConstrainerInterface
{
use ExpectsPostTrait;
Leonidas\Traits\ExpectsPostTrait
$ID
Leonidas\Library\System\...traints\PostConstrainer
/**
* @var int[]
*/
protected $posts = [];
*
public function __construct(int ...$posts)
$this->posts = $posts;
}
* Get the value of posts
* @return int[]
public function getPosts(): array
return $this->posts;
public function requestMeetsCriteria(ServerRequestInterface $request): bool
return in_array($this->getPostId($request), $this->posts);