Файл: vendor/intervention/image/src/Modifiers/DrawPolygonModifier.php
Строк: 43
<?php
declare(strict_types=1);
namespace InterventionImageModifiers;
use InterventionImageExceptionsInvalidArgumentException;
use InterventionImageGeometryPolygon;
use InterventionImageInterfacesDrawableInterface;
class DrawPolygonModifier extends AbstractDrawModifier
{
/**
* @throws InvalidArgumentException
*/
public function __construct(public Polygon $drawable)
{
if ($drawable->count() < 3) {
throw new InvalidArgumentException('The polygon must have at least 3 points');
}
}
/**
* Return object to be drawn.
*/
protected function drawable(): DrawableInterface
{
return $this->drawable;
}
}