mirror of
https://github.com/Intervention/image.git
synced 2025-08-29 16:50:07 +02:00
renamed parameter
This commit is contained in:
@@ -14,7 +14,7 @@ class CircleCommand extends \Intervention\Image\Commands\AbstractCommand
|
|||||||
*/
|
*/
|
||||||
public function execute($image)
|
public function execute($image)
|
||||||
{
|
{
|
||||||
$radius = $this->argument(0)->type('numeric')->required()->value();
|
$diameter = $this->argument(0)->type('numeric')->required()->value();
|
||||||
$x = $this->argument(1)->type('numeric')->required()->value();
|
$x = $this->argument(1)->type('numeric')->required()->value();
|
||||||
$y = $this->argument(2)->type('numeric')->required()->value();
|
$y = $this->argument(2)->type('numeric')->required()->value();
|
||||||
$callback = $this->argument(3)->type('closure')->value();
|
$callback = $this->argument(3)->type('closure')->value();
|
||||||
@@ -22,7 +22,7 @@ class CircleCommand extends \Intervention\Image\Commands\AbstractCommand
|
|||||||
$circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape',
|
$circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape',
|
||||||
$image->getDriver()->getDriverName());
|
$image->getDriver()->getDriverName());
|
||||||
|
|
||||||
$circle = new $circle_classname($radius);
|
$circle = new $circle_classname($diameter);
|
||||||
|
|
||||||
if ($callback instanceof Closure) {
|
if ($callback instanceof Closure) {
|
||||||
$callback($circle);
|
$callback($circle);
|
||||||
|
@@ -7,22 +7,22 @@ use \Intervention\Image\Image;
|
|||||||
class CircleShape extends EllipseShape
|
class CircleShape extends EllipseShape
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Radius of circle in pixels
|
* Diameter of circle in pixels
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $radius = 100;
|
public $diameter = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new instance of circle
|
* Create new instance of circle
|
||||||
*
|
*
|
||||||
* @param integer $radius
|
* @param integer $diameter
|
||||||
*/
|
*/
|
||||||
public function __construct($radius = null)
|
public function __construct($diameter = null)
|
||||||
{
|
{
|
||||||
$this->width = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->width = is_numeric($diameter) ? intval($diameter) : $this->diameter;
|
||||||
$this->height = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter;
|
||||||
$this->radius = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -7,22 +7,22 @@ use \Intervention\Image\Image;
|
|||||||
class CircleShape extends EllipseShape
|
class CircleShape extends EllipseShape
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Radius of circle in pixels
|
* Diameter of circle in pixels
|
||||||
*
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*/
|
*/
|
||||||
public $radius = 100;
|
public $diameter = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new instance of circle
|
* Create new instance of circle
|
||||||
*
|
*
|
||||||
* @param integer $radius
|
* @param integer $diameter
|
||||||
*/
|
*/
|
||||||
public function __construct($radius = null)
|
public function __construct($diameter = null)
|
||||||
{
|
{
|
||||||
$this->width = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->width = is_numeric($diameter) ? intval($diameter) : $this->diameter;
|
||||||
$this->height = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->height = is_numeric($diameter) ? intval($diameter) : $this->diameter;
|
||||||
$this->radius = is_numeric($radius) ? intval($radius) : $this->radius;
|
$this->diameter = is_numeric($diameter) ? intval($diameter) : $this->diameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user