PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / vendor / intervention / image / src / Intervention / Image / Commands / RectangleCommand.php

RectangleCommand.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.3, at vendor/intervention/image/src/Intervention/Image/Commands/RectangleCommand.php

37 lines 1018 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\Image\Commands;
4
5 use Closure;
6
7 class RectangleCommand extends AbstractCommand
8 {
9 /**
10 * Draws rectangle on given image
11 *
12 * @param \Intervention\Image\Image $image
13 * @return boolean
14 */
15 public function execute($image)
16 {
17 $x1 = $this->argument(0)->type('numeric')->required()->value();
18 $y1 = $this->argument(1)->type('numeric')->required()->value();
19 $x2 = $this->argument(2)->type('numeric')->required()->value();
20 $y2 = $this->argument(3)->type('numeric')->required()->value();
21 $callback = $this->argument(4)->type('closure')->value();
22
23 $rectangle_classname = sprintf('\Intervention\Image\%s\Shapes\RectangleShape',
24 $image->getDriver()->getDriverName());
25
26 $rectangle = new $rectangle_classname($x1, $y1, $x2, $y2);
27
28 if ($callback instanceof Closure) {
29 $callback($rectangle);
30 }
31
32 $rectangle->applyToImage($image, $x1, $y1);
33
34 return true;
35 }
36 }
37