1+ <?php
2+
3+ declare (strict_types = 1 );
4+
5+ namespace ImagickDemo \Imagick \Controls ;
6+
7+ use ImagickDemo \Params \ImagickColorParam ;
8+ use ImagickDemo \Params \UserText ;
9+ use ImagickDemo \ToArray ;
10+ use Params \Create \CreateFromVarMap ;
11+ use Params \InputParameterList ;
12+ use Params \InputParameterListFromAttributes ;
13+ use Params \SafeAccess ;
14+ use ImagickDemo \Params \Image ;
15+ use ImagickDemo \Params \Angle ;
16+ use ImagickDemo \Params \InterpolateType ;
17+
18+ class PolaroidWithTextAndMethodControl implements InputParameterList
19+ {
20+ use SafeAccess;
21+ use CreateFromVarMap;
22+ use ToArray;
23+ use InputParameterListFromAttributes;
24+
25+ public function __construct (
26+ #[UserText('text ' , 100 , 'shamone ' )]
27+ private string $ text ,
28+ #[InterpolateType('interpolate_type ' )]
29+ private int $ interpolate_type ,
30+ #[Angle('angle ' )]
31+ private string $ angle ,
32+ #[Image('image_path ' )]
33+ private string $ image_path ,
34+ #[ImagickColorParam('rgb(0, 0, 0) ' , 'stroke_color ' )]
35+ private string $ stroke_color ,
36+ #[ImagickColorParam('white ' , 'fill_color ' )]
37+ private string $ fill_color ,
38+ ) {
39+ }
40+
41+ public function getValuesForForm (): array
42+ {
43+ return [
44+ 'text ' => $ this ->text ,
45+ 'interpolate_type ' => getOptionFromOptions ($ this ->interpolate_type , getInterpolateOptions ()),
46+ 'angle ' => $ this ->angle ,
47+ 'image_path ' => getOptionFromOptions ($ this ->image_path , getImagePathOptions ()),
48+ 'stroke_color ' => $ this ->stroke_color ,
49+ 'fill_color ' => $ this ->fill_color ,
50+ ];
51+ }
52+ }
0 commit comments