-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/ImagickDemo/Imagick/Controls/SwirlImageWithMethodControl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace ImagickDemo\Imagick\Controls; | ||
|
||
|
||
use ImagickDemo\Params\InterpolateType; | ||
use ImagickDemo\ToArray; | ||
use Params\Create\CreateFromVarMap; | ||
use Params\InputParameterListFromAttributes; | ||
use Params\SafeAccess; | ||
|
||
use ImagickDemo\Params\Image; | ||
use ImagickDemo\Params\Swirl; | ||
|
||
class SwirlImageWithMethodControl | ||
{ | ||
use SafeAccess; | ||
use CreateFromVarMap; | ||
use ToArray; | ||
use InputParameterListFromAttributes; | ||
|
||
public function __construct( | ||
#[Swirl('swirl')] | ||
private string $swirl, | ||
#[InterpolateType('interpolate_method')] | ||
private int $interpolate_method, | ||
#[Image('image_path')] | ||
private string $image_path, | ||
) { | ||
} | ||
|
||
public function getValuesForForm(): array | ||
{ | ||
return [ | ||
'swirl' => $this->swirl, | ||
'interpolate_method' => getOptionFromOptions($this->interpolate_method, getInterpolateOptions()), | ||
'image_path' => getOptionFromOptions($this->image_path, getImagePathOptions()), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace ImagickDemo\Imagick; | ||
|
||
use ImagickDemo\Imagick\Controls\SwirlImageWithMethodControl; | ||
|
||
class swirlImageWithMethod extends \ImagickDemo\Example | ||
{ | ||
public function renderTitle(): string | ||
{ | ||
return "Imagick::swirlImageWithMethod"; | ||
} | ||
|
||
public function useImageControlAsOriginalImage() | ||
{ | ||
return true; | ||
} | ||
|
||
public static function getParamType(): string | ||
{ | ||
return SwirlImageWithMethodControl::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters