@@ -100,8 +100,8 @@ class Attachment {
100
100
101
101
/**
102
102
* Attachment constructor.
103
- * @param Message $oMessage
104
- * @param Part $part
103
+ * @param Message $oMessage
104
+ * @param Part $part
105
105
*/
106
106
public function __construct (Message $ oMessage , Part $ part ) {
107
107
$ this ->config = ClientManager::get ('options ' );
@@ -112,13 +112,13 @@ public function __construct(Message $oMessage, Part $part) {
112
112
113
113
if ($ this ->oMessage ->getClient ()) {
114
114
$ default_mask = $ this ->oMessage ->getClient ()?->getDefaultAttachmentMask();
115
- if ($ default_mask != null ) {
115
+ if ($ default_mask != null ) {
116
116
$ this ->mask = $ default_mask ;
117
117
}
118
- }else {
119
- $ default_mask = ClientManager::getMask ("attachment " );
120
- if ($ default_mask != "" ){
121
- $ this ->mask =$ default_mask ;
118
+ } else {
119
+ $ default_mask = ClientManager::getMask ("attachment " );
120
+ if ($ default_mask != "" ) {
121
+ $ this ->mask = $ default_mask ;
122
122
}
123
123
}
124
124
@@ -135,23 +135,23 @@ public function __construct(Message $oMessage, Part $part) {
135
135
* @throws MethodNotFoundException
136
136
*/
137
137
public function __call (string $ method , array $ arguments ) {
138
- if (strtolower (substr ($ method , 0 , 3 )) === 'get ' ) {
138
+ if (strtolower (substr ($ method , 0 , 3 )) === 'get ' ) {
139
139
$ name = Str::snake (substr ($ method , 3 ));
140
140
141
- if (isset ($ this ->attributes [$ name ])) {
141
+ if (isset ($ this ->attributes [$ name ])) {
142
142
return $ this ->attributes [$ name ];
143
143
}
144
144
145
145
return null ;
146
- }elseif (strtolower (substr ($ method , 0 , 3 )) === 'set ' ) {
146
+ } elseif (strtolower (substr ($ method , 0 , 3 )) === 'set ' ) {
147
147
$ name = Str::snake (substr ($ method , 3 ));
148
148
149
149
$ this ->attributes [$ name ] = array_pop ($ arguments );
150
150
151
151
return $ this ->attributes [$ name ];
152
152
}
153
153
154
- throw new MethodNotFoundException ("Method " . self ::class. ':: ' . $ method. '() is not supported ' );
154
+ throw new MethodNotFoundException ("Method " . self ::class . ':: ' . $ method . '() is not supported ' );
155
155
}
156
156
157
157
/**
@@ -174,7 +174,7 @@ public function __set($name, $value) {
174
174
* @return mixed|null
175
175
*/
176
176
public function __get ($ name ) {
177
- if (isset ($ this ->attributes [$ name ])) {
177
+ if (isset ($ this ->attributes [$ name ])) {
178
178
return $ this ->attributes [$ name ];
179
179
}
180
180
@@ -274,7 +274,7 @@ protected function fetch(): void {
274
274
public function save (string $ path , ?string $ filename = null ): bool {
275
275
$ filename = $ filename ? $ this ->decodeName ($ filename ) : $ this ->filename ;
276
276
277
- return file_put_contents ($ path. DIRECTORY_SEPARATOR . $ filename , $ this ->getContent ()) !== false ;
277
+ return file_put_contents ($ path . DIRECTORY_SEPARATOR . $ filename , $ this ->getContent ()) !== false ;
278
278
}
279
279
280
280
/**
@@ -335,7 +335,7 @@ public function getExtension(): ?string {
335
335
}
336
336
if ($ extension === null ) {
337
337
$ deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser " ;
338
- if (class_exists ($ deprecated_guesser ) !== false ){
338
+ if (class_exists ($ deprecated_guesser ) !== false ) {
339
339
/** @var \Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser $deprecated_guesser */
340
340
$ extension = $ deprecated_guesser ::getInstance ()->guess ($ this ->getMimeType ());
341
341
}
@@ -374,7 +374,7 @@ public function getMessage(): Message {
374
374
* @return $this
375
375
*/
376
376
public function setMask ($ mask ): Attachment {
377
- if (class_exists ($ mask )){
377
+ if (class_exists ($ mask )) {
378
378
$ this ->mask = $ mask ;
379
379
}
380
380
@@ -399,10 +399,10 @@ public function getMask(): string {
399
399
*/
400
400
public function mask (string $ mask = null ): mixed {
401
401
$ mask = $ mask !== null ? $ mask : $ this ->mask ;
402
- if (class_exists ($ mask )){
402
+ if (class_exists ($ mask )) {
403
403
return new $ mask ($ this );
404
404
}
405
405
406
- throw new MaskNotFoundException ("Unknown mask provided: " . $ mask );
406
+ throw new MaskNotFoundException ("Unknown mask provided: " . $ mask );
407
407
}
408
408
}
0 commit comments