@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | public function __construct(?array $attachments = null) |
56 | 56 | { |
57 | - if (null!==$attachments) { |
|
57 | + if (null !== $attachments) { |
|
58 | 58 | Assert::allIsInstanceOf($attachments, EmailAttachment::class, static::MESSAGE_ATTACHMENT); |
59 | 59 | try { |
60 | 60 | /** @var EmailAttachment $attachment */ |
@@ -66,21 +66,21 @@ |
||
66 | 66 | */ |
67 | 67 | public function __construct(?string $subject = null, ?string $body = null, ?int $fromId = null, ?int $toId = null) |
68 | 68 | { |
69 | - if (null!==$subject) { |
|
69 | + if (null !== $subject) { |
|
70 | 70 | $subject = trim($subject); |
71 | 71 | Assert::stringNotEmpty($subject, static::MESSAGE_SUBJECT); |
72 | 72 | $this->subject = $subject; |
73 | 73 | } |
74 | - if (null!==$body) { |
|
74 | + if (null !== $body) { |
|
75 | 75 | $body = trim($body); |
76 | 76 | Assert::stringNotEmpty($body, static::MESSAGE_BODY); |
77 | 77 | $this->body = $body; |
78 | 78 | } |
79 | - if (null!==$fromId) { |
|
79 | + if (null !== $fromId) { |
|
80 | 80 | Assert::greaterThan($fromId, 0, static::MESSAGE_FROM); |
81 | 81 | $this->fromId = $fromId; |
82 | 82 | } |
83 | - if (null!==$toId) { |
|
83 | + if (null !== $toId) { |
|
84 | 84 | Assert::greaterThan($toId, 0, static::MESSAGE_TO); |
85 | 85 | $this->toId = $toId; |
86 | 86 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public function __construct(?array $addresses = null) |
55 | 55 | { |
56 | - if (null!==$addresses) { |
|
56 | + if (null !== $addresses) { |
|
57 | 57 | Assert::allIsInstanceOf($addresses, EmailAddress::class, static::MESSAGE_ADDRESS); |
58 | 58 | try { |
59 | 59 | /** @var EmailAddress $address */ |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function __construct(?string $email = null, ?string $displayName = null) |
60 | 60 | { |
61 | - if (null!==$email) { |
|
61 | + if (null !== $email) { |
|
62 | 62 | $email = trim($email); |
63 | 63 | Assert::true( |
64 | - false!==filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE), |
|
64 | + false !== filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE), |
|
65 | 65 | static::MESSAGE_ADDRESS |
66 | 66 | ); |
67 | 67 | $this->email = $email; |
68 | 68 | } |
69 | - if (null!==$displayName) { |
|
69 | + if (null !== $displayName) { |
|
70 | 70 | $displayName = trim($displayName); |
71 | 71 | $displayName = empty($displayName) ? null : $displayName; |
72 | 72 | Assert::nullOrStringNotEmpty($displayName, static::MESSAGE_NAME); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | try { |
87 | 87 | Assert::true( |
88 | - false!==filter_var($this->email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE), |
|
88 | + false !== filter_var($this->email, FILTER_VALIDATE_EMAIL, FILTER_FLAG_EMAIL_UNICODE), |
|
89 | 89 | static::MESSAGE_ADDRESS |
90 | 90 | ); |
91 | 91 | } catch (\InvalidArgumentException $e) { |
@@ -115,22 +115,22 @@ |
||
115 | 115 | ?EmailAddress $fromAddress = null, |
116 | 116 | ?EmailAddress $toAddress = null |
117 | 117 | ) { |
118 | - if (null!==$subject) { |
|
118 | + if (null !== $subject) { |
|
119 | 119 | $subject = trim($subject); |
120 | 120 | Assert::stringNotEmpty($subject, static::MESSAGE_SUBJECT); |
121 | 121 | $this->subject = $subject; |
122 | 122 | } |
123 | - if (null!==$body) { |
|
123 | + if (null !== $body) { |
|
124 | 124 | $body = trim($body); |
125 | 125 | Assert::stringNotEmpty($body, static::MESSAGE_BODY); |
126 | 126 | $this->body = $body; |
127 | 127 | } |
128 | 128 | try { |
129 | - if (null!==$fromAddress) { |
|
129 | + if (null !== $fromAddress) { |
|
130 | 130 | $fromAddress->getEmail(); |
131 | 131 | $this->fromAddress = $fromAddress; |
132 | 132 | } |
133 | - if (null!==$toAddress) { |
|
133 | + if (null !== $toAddress) { |
|
134 | 134 | $toAddress->getEmail(); |
135 | 135 | $this->toAddresses = new EmailAddressList([$toAddress]); |
136 | 136 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function setPriority($priority) |
42 | 42 | { |
43 | - $this->priority = (int) $priority; |
|
43 | + $this->priority = (int)$priority; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | static $ret = null; |
84 | 84 | |
85 | - if ($ret===null) { |
|
85 | + if ($ret === null) { |
|
86 | 86 | if (count($this->providers)) { |
87 | 87 | $ret = reset($this->providers)->getMode(); |
88 | 88 | } else { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | public function register(AbstractContract $object) |
103 | 103 | { |
104 | 104 | // verify this is the proper type of object |
105 | - $contract = '\Xoops\Core\Service\Contract\\' . $this->service . 'Interface'; |
|
105 | + $contract = '\Xoops\Core\Service\Contract\\'.$this->service.'Interface'; |
|
106 | 106 | |
107 | 107 | if (is_a($object, '\Xoops\Core\Service\AbstractContract') |
108 | 108 | && $object instanceof $contract |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function sortProviders() |
130 | 130 | { |
131 | 131 | $sortable = $this->providers; |
132 | - usort($sortable, function (AbstractContract $a, AbstractContract $b) { |
|
132 | + usort($sortable, function(AbstractContract $a, AbstractContract $b) { |
|
133 | 133 | if ($a->getPriority() != $b->getPriority()) { |
134 | 134 | return ($a->getPriority() > $b->getPriority()) ? 1 : -1; |
135 | 135 | } else { |
@@ -37,8 +37,8 @@ |
||
37 | 37 | $path = rtrim($path, '/'); |
38 | 38 | if (is_dir($path) && $handle = opendir($path)) { |
39 | 39 | while (false !== ($file = readdir($handle))) { |
40 | - if (!preg_match('/^[\.]{1,2}$/', $file) && is_file($path . '/' . $file)) { |
|
41 | - $file = $prefix . $file; |
|
40 | + if (!preg_match('/^[\.]{1,2}$/', $file) && is_file($path.'/'.$file)) { |
|
41 | + $file = $prefix.$file; |
|
42 | 42 | $fileList[$file] = $file; |
43 | 43 | } |
44 | 44 | } |
@@ -32,6 +32,6 @@ |
||
32 | 32 | */ |
33 | 33 | public static function getList() |
34 | 34 | { |
35 | - return Directory::getList(\XoopsBaseConfig::get('root-path') . '/class/xoopseditor/'); |
|
35 | + return Directory::getList(\XoopsBaseConfig::get('root-path').'/class/xoopseditor/'); |
|
36 | 36 | } |
37 | 37 | } |