@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $this->instantiator->checkCommand($cmd); |
42 | 42 | |
43 | - if($cmd instanceof Mailcode_Commands_Command_ShowVariable) |
|
43 | + if ($cmd instanceof Mailcode_Commands_Command_ShowVariable) |
|
44 | 44 | { |
45 | 45 | return $cmd; |
46 | 46 | } |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | throw $this->instantiator->exceptionUnexpectedType('ShowVariable', $cmd); |
49 | 49 | } |
50 | 50 | |
51 | - public function date(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate |
|
51 | + public function date(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate |
|
52 | 52 | { |
53 | 53 | return (new Date())->create($variableName, $formatString); |
54 | 54 | } |
55 | 55 | |
56 | - public function number(string $variableName, string $formatString="", bool $absolute=false) : Mailcode_Commands_Command_ShowNumber |
|
56 | + public function number(string $variableName, string $formatString = "", bool $absolute = false) : Mailcode_Commands_Command_ShowNumber |
|
57 | 57 | { |
58 | 58 | return (new Number())->create($variableName, $formatString, $absolute); |
59 | 59 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return Mailcode_Commands_Command_ShowPhone |
68 | 68 | * @throws Mailcode_Factory_Exception |
69 | 69 | */ |
70 | - public function phone(string $variableName, string $sourceFormat, string $urlEncoding=Mailcode_Factory::URL_ENCODING_NONE) : Mailcode_Commands_Command_ShowPhone |
|
70 | + public function phone(string $variableName, string $sourceFormat, string $urlEncoding = Mailcode_Factory::URL_ENCODING_NONE) : Mailcode_Commands_Command_ShowPhone |
|
71 | 71 | { |
72 | 72 | return (new Phone())->create($variableName, $sourceFormat, $urlEncoding); |
73 | 73 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @return Mailcode_Commands_Command_ShowURL |
90 | 90 | * @throws Mailcode_Factory_Exception |
91 | 91 | */ |
92 | - public function url(string $url, ?string $trackingID=null, array $queryParams=array()) : Mailcode_Commands_Command_ShowURL |
|
92 | + public function url(string $url, ?string $trackingID = null, array $queryParams = array()) : Mailcode_Commands_Command_ShowURL |
|
93 | 93 | { |
94 | 94 | return (new URL())->create($url, $trackingID, $queryParams); |
95 | 95 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | $this->instantiator->checkCommand($cmd); |
38 | 38 | |
39 | - if($cmd instanceof Mailcode_Commands_Command_ShowSnippet) |
|
39 | + if ($cmd instanceof Mailcode_Commands_Command_ShowSnippet) |
|
40 | 40 | { |
41 | 41 | return $cmd; |
42 | 42 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | */ |
24 | 24 | class Date extends Mailcode_Factory_CommandSets_Set |
25 | 25 | { |
26 | - public function create(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate |
|
26 | + public function create(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate |
|
27 | 27 | { |
28 | 28 | $variableName = $this->instantiator->filterVariableName($variableName); |
29 | 29 | |
30 | 30 | $format = ''; |
31 | - if(!empty($formatString)) |
|
31 | + if (!empty($formatString)) |
|
32 | 32 | { |
33 | 33 | $format = sprintf( |
34 | 34 | ' "%s"', |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $this->instantiator->checkCommand($cmd); |
51 | 51 | |
52 | - if($cmd instanceof Mailcode_Commands_Command_ShowDate) |
|
52 | + if ($cmd instanceof Mailcode_Commands_Command_ShowDate) |
|
53 | 53 | { |
54 | 54 | return $cmd; |
55 | 55 | } |
@@ -33,21 +33,21 @@ discard block |
||
33 | 33 | * @return Mailcode_Commands_Command_ShowURL |
34 | 34 | * @throws Mailcode_Factory_Exception |
35 | 35 | */ |
36 | - public function create(string $url, ?string $trackingID=null, array $queryParams=array()) : Mailcode_Commands_Command_ShowURL |
|
36 | + public function create(string $url, ?string $trackingID = null, array $queryParams = array()) : Mailcode_Commands_Command_ShowURL |
|
37 | 37 | { |
38 | 38 | $contentID = PreParser::storeContent($url); |
39 | 39 | |
40 | 40 | $params = array(); |
41 | 41 | $params[] = (string)$contentID; |
42 | 42 | |
43 | - if($trackingID !== null) |
|
43 | + if ($trackingID !== null) |
|
44 | 44 | { |
45 | 45 | $params[] = sprintf('"%s"', $trackingID); |
46 | 46 | } |
47 | 47 | |
48 | - if(!empty($queryParams)) |
|
48 | + if (!empty($queryParams)) |
|
49 | 49 | { |
50 | - foreach($queryParams as $name => $value) |
|
50 | + foreach ($queryParams as $name => $value) |
|
51 | 51 | { |
52 | 52 | $params[] = sprintf( |
53 | 53 | '"%s=%s"', |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $this->instantiator->checkCommand($cmd); |
70 | 70 | |
71 | - if($cmd instanceof Mailcode_Commands_Command_ShowURL) |
|
71 | + if ($cmd instanceof Mailcode_Commands_Command_ShowURL) |
|
72 | 72 | { |
73 | 73 | return $cmd; |
74 | 74 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @return Mailcode_Commands_Command_ShowPhone |
36 | 36 | * @throws Mailcode_Factory_Exception |
37 | 37 | */ |
38 | - public function create(string $variableName, string $sourceFormat, string $urlEncoding=Mailcode_Factory::URL_ENCODING_NONE) : Mailcode_Commands_Command_ShowPhone |
|
38 | + public function create(string $variableName, string $sourceFormat, string $urlEncoding = Mailcode_Factory::URL_ENCODING_NONE) : Mailcode_Commands_Command_ShowPhone |
|
39 | 39 | { |
40 | 40 | $variableName = $this->instantiator->filterVariableName($variableName); |
41 | 41 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->instantiator->checkCommand($cmd); |
59 | 59 | $this->instantiator->setEncoding($cmd, $urlEncoding); |
60 | 60 | |
61 | - if($cmd instanceof Mailcode_Commands_Command_ShowPhone) |
|
61 | + if ($cmd instanceof Mailcode_Commands_Command_ShowPhone) |
|
62 | 62 | { |
63 | 63 | return $cmd; |
64 | 64 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | class Number extends Mailcode_Factory_CommandSets_Set |
25 | 25 | { |
26 | - public function create(string $variableName, string $formatString="", bool $absolute=false) : Mailcode_Commands_Command_ShowNumber |
|
26 | + public function create(string $variableName, string $formatString = "", bool $absolute = false) : Mailcode_Commands_Command_ShowNumber |
|
27 | 27 | { |
28 | 28 | $variableName = $this->instantiator->filterVariableName($variableName); |
29 | 29 | $paramsString = $this->compileNumberParams($formatString, $absolute); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $this->instantiator->checkCommand($cmd); |
43 | 43 | |
44 | - if($cmd instanceof Mailcode_Commands_Command_ShowNumber) |
|
44 | + if ($cmd instanceof Mailcode_Commands_Command_ShowNumber) |
|
45 | 45 | { |
46 | 46 | return $cmd; |
47 | 47 | } |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | throw $this->instantiator->exceptionUnexpectedType('ShowNumber', $cmd); |
50 | 50 | } |
51 | 51 | |
52 | - private function compileNumberParams(string $formatString="", bool $absolute=false) : string |
|
52 | + private function compileNumberParams(string $formatString = "", bool $absolute = false) : string |
|
53 | 53 | { |
54 | 54 | $params = array(); |
55 | 55 | |
56 | - if(!empty($formatString)) |
|
56 | + if (!empty($formatString)) |
|
57 | 57 | { |
58 | 58 | $params[] = sprintf( |
59 | 59 | ' "%s"', |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | ); |
62 | 62 | } |
63 | 63 | |
64 | - if($absolute) |
|
64 | + if ($absolute) |
|
65 | 65 | { |
66 | 66 | $params[] = ' absolute:'; |
67 | 67 | } |
68 | 68 | |
69 | - if(!empty($params)) |
|
69 | + if (!empty($params)) |
|
70 | 70 | { |
71 | 71 | return ' '.implode(' ', $params); |
72 | 72 | } |
@@ -20,9 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | abstract class Mailcode_Factory_CommandSets_Set |
22 | 22 | { |
23 | - /** |
|
24 | - * @var Mailcode_Factory_Instantiator |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var Mailcode_Factory_Instantiator |
|
25 | + */ |
|
26 | 26 | protected Mailcode_Factory_Instantiator $instantiator; |
27 | 27 | |
28 | 28 | /** |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * @return $this |
36 | 36 | * @throws Mailcode_Exception |
37 | 37 | */ |
38 | - public function setURLDecoding(bool $decode=true) : self |
|
38 | + public function setURLDecoding(bool $decode = true) : self |
|
39 | 39 | { |
40 | 40 | return $this->setEncodingEnabled(Mailcode_Commands_Keywords::TYPE_URLDECODE, $decode); |
41 | 41 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * @return $this |
42 | 42 | * @throws Mailcode_Exception |
43 | 43 | */ |
44 | - public function setURLEncoding(bool $encoding=true) : self |
|
44 | + public function setURLEncoding(bool $encoding = true) : self |
|
45 | 45 | { |
46 | 46 | return $this->setEncodingEnabled(Mailcode_Commands_Keywords::TYPE_URLENCODE, $encoding); |
47 | 47 | } |