Skip to content

Commit 5cea36c

Browse files
committed
fixed CS
1 parent d02ee1e commit 5cea36c

File tree

4 files changed

+44
-61
lines changed

4 files changed

+44
-61
lines changed

lib/classes/Swift/Mime/HeaderSet.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ public function addTextHeader($name, $value = null);
4848
* @param string $value
4949
* @param array $params
5050
*/
51-
public function addParameterizedHeader($name, $value = null,
52-
$params = array());
51+
public function addParameterizedHeader($name, $value = null, $params = array());
5352

5453
/**
5554
* Add a new ID header for Message-ID or Content-ID.
@@ -115,13 +114,13 @@ public function get($name, $index = 0);
115114
public function getAll($name = null);
116115

117116
/**
118-
* Return the name of all Headers
117+
* Return the name of all Headers
119118
*
120-
* @return array
121-
*/
122-
public function listAll();
119+
* @return array
120+
*/
121+
public function listAll();
123122

124-
/**
123+
/**
125124
* Remove the header with the given $name if it's set.
126125
*
127126
* If multiple headers match, the actual one may be specified by $index.

lib/classes/Swift/Mime/SimpleHeaderSet.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ public function addTextHeader($name, $value = null)
103103
*/
104104
public function addParameterizedHeader($name, $value = null, $params = array())
105105
{
106-
$this->_storeHeader($name,
107-
$this->_factory->createParameterizedHeader($name, $value,
108-
$params));
106+
$this->_storeHeader($name, $this->_factory->createParameterizedHeader($name, $value, $params));
109107
}
110108

111109
/**
@@ -144,8 +142,7 @@ public function has($name, $index = 0)
144142
{
145143
$lowerName = strtolower($name);
146144

147-
return array_key_exists($lowerName, $this->_headers)
148-
&& array_key_exists($index, $this->_headers[$lowerName]);
145+
return array_key_exists($lowerName, $this->_headers) && array_key_exists($index, $this->_headers[$lowerName]);
149146
}
150147

151148
/**
@@ -212,19 +209,19 @@ public function getAll($name = null)
212209
}
213210

214211
/**
215-
* Return the name of all Headers
212+
* Return the name of all Headers
216213
*
217-
* @return array
218-
*/
219-
public function listAll()
220-
{
221-
$headers = $this->_headers;
214+
* @return array
215+
*/
216+
public function listAll()
217+
{
218+
$headers = $this->_headers;
222219
if ($this->_canSort()) {
223-
uksort($headers, array($this, '_sortHeaders'));
224-
}
220+
uksort($headers, array($this, '_sortHeaders'));
221+
}
225222

226-
return array_keys($headers);
227-
}
223+
return array_keys($headers);
224+
}
228225

229226
/**
230227
* Remove the header with the given $name if it's set.

lib/classes/Swift/Mime/SimpleMessage.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEnc
3131
parent::__construct($headers, $encoder, $cache, $grammar, $charset);
3232
$this->getHeaders()->defineOrdering(array(
3333
'Return-Path',
34-
'Received',
35-
'DKIM-Signature',
36-
'DomainKey-Signature',
34+
'Received',
35+
'DKIM-Signature',
36+
'DomainKey-Signature',
3737
'Sender',
3838
'Message-ID',
3939
'Date',
@@ -47,9 +47,7 @@ public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEnc
4747
'Content-Type',
4848
'Content-Transfer-Encoding'
4949
));
50-
$this->getHeaders()->setAlwaysDisplayed(
51-
array('Date', 'Message-ID', 'From')
52-
);
50+
$this->getHeaders()->setAlwaysDisplayed(array('Date', 'Message-ID', 'From'));
5351
$this->getHeaders()->addTextHeader('MIME-Version', '1.0');
5452
$this->setDate(time());
5553
$this->setId($this->getId());

lib/classes/Swift/Mime/SimpleMimeEntity.php

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
3737
'multipart/mixed' => array(self::LEVEL_TOP, self::LEVEL_MIXED),
3838
'multipart/alternative' => array(self::LEVEL_MIXED, self::LEVEL_ALTERNATIVE),
3939
'multipart/related' => array(self::LEVEL_ALTERNATIVE, self::LEVEL_RELATED)
40-
);
40+
);
4141

4242
/** A set of filter rules to define what level an entity should be nested at */
4343
private $_compoundLevelFilters = array();
@@ -62,7 +62,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
6262
'text/plain' => 1,
6363
'text/html' => 2,
6464
'multipart/related' => 3
65-
);
65+
);
6666

6767
/** The CID of this entity */
6868
private $_id;
@@ -87,9 +87,7 @@ public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEnc
8787
$this->_headers = $headers;
8888
$this->_grammar = $grammar;
8989
$this->setEncoder($encoder);
90-
$this->_headers->defineOrdering(
91-
array('Content-Type', 'Content-Transfer-Encoding')
92-
);
90+
$this->_headers->defineOrdering(array('Content-Type', 'Content-Transfer-Encoding'));
9391

9492
// This array specifies that, when the entire MIME document contains
9593
// $compoundLevel, then for each child within $level, if its Content-Type
@@ -186,9 +184,7 @@ public function setContentType($type)
186184
*/
187185
public function getId()
188186
{
189-
return $this->_headers->has($this->_getIdField())
190-
? current((array) $this->_getHeaderFieldModel($this->_getIdField()))
191-
: $this->_id;
187+
return $this->_headers->has($this->_getIdField()) ? current((array) $this->_getHeaderFieldModel($this->_getIdField())) : $this->_id;
192188
}
193189

194190
/**
@@ -474,16 +470,16 @@ public function toString()
474470
$string = $this->_headers->toString();
475471
$string .= $this->_bodyToString();
476472

477-
return $string;
478-
}
473+
return $string;
474+
}
479475

480-
/**
476+
/**
481477
* Get this entire entity as a string.
482478
*
483-
* @return string
484-
*/
485-
protected function _bodyToString()
486-
{
479+
* @return string
480+
*/
481+
protected function _bodyToString()
482+
{
487483
$string = '';
488484

489485
if (isset($this->_body) && empty($this->_immediateChildren)) {
@@ -526,24 +522,23 @@ public function __toString()
526522
/**
527523
* Write this entire entity to a {@see Swift_InputByteStream}.
528524
*
529-
*
530525
* @param Swift_InputByteStream
531526
*/
532527
public function toByteStream(Swift_InputByteStream $is)
533528
{
534529
$is->write($this->_headers->toString());
535530
$is->commit();
536531

537-
$this->_bodyToByteStream($is);
538-
}
532+
$this->_bodyToByteStream($is);
533+
}
539534

540-
/**
535+
/**
541536
* Write this entire entity to a {@link Swift_InputByteStream}.
542537
*
543-
* @param Swift_InputByteStream
544-
*/
545-
protected function _bodyToByteStream(Swift_InputByteStream $is)
546-
{
538+
* @param Swift_InputByteStream
539+
*/
540+
protected function _bodyToByteStream(Swift_InputByteStream $is)
541+
{
547542
if (empty($this->_immediateChildren)) {
548543
if (isset($this->_body)) {
549544
if ($this->_cache->hasKey($this->_cacheKey, 'body')) {
@@ -559,13 +554,9 @@ protected function _bodyToByteStream(Swift_InputByteStream $is)
559554
if ($this->_body instanceof Swift_OutputByteStream) {
560555
$this->_body->setReadPointer(0);
561556

562-
$this->_encoder->encodeByteStream($this->_body, $is, 0,
563-
$this->getMaxLineLength()
564-
);
557+
$this->_encoder->encodeByteStream($this->_body, $is, 0, $this->getMaxLineLength());
565558
} else {
566-
$is->write($this->_encoder->encodeString(
567-
$this->getBody(), 0, $this->getMaxLineLength()
568-
));
559+
$is->write($this->_encoder->encodeString($this->getBody(), 0, $this->getMaxLineLength()));
569560
}
570561

571562
if ($cacheIs) {
@@ -661,7 +652,7 @@ protected function _fixHeaders()
661652
/**
662653
* Get the KeyCache used in this entity.
663654
*
664-
* @return Swift_KeyCache
655+
* @return Swift_KeyCache
665656
*/
666657
protected function _getCache()
667658
{
@@ -694,9 +685,7 @@ protected function _clearCache()
694685
protected function getRandomId()
695686
{
696687
$idLeft = time() . '.' . uniqid();
697-
$idRight = !empty($_SERVER['SERVER_NAME'])
698-
? $_SERVER['SERVER_NAME']
699-
: 'swift.generated';
688+
$idRight = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated';
700689
$id = $idLeft . '@' . $idRight;
701690

702691
try {

0 commit comments

Comments
 (0)