@@ -37,7 +37,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
37
37
'multipart/mixed ' => array (self ::LEVEL_TOP , self ::LEVEL_MIXED ),
38
38
'multipart/alternative ' => array (self ::LEVEL_MIXED , self ::LEVEL_ALTERNATIVE ),
39
39
'multipart/related ' => array (self ::LEVEL_ALTERNATIVE , self ::LEVEL_RELATED )
40
- );
40
+ );
41
41
42
42
/** A set of filter rules to define what level an entity should be nested at */
43
43
private $ _compoundLevelFilters = array ();
@@ -62,7 +62,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
62
62
'text/plain ' => 1 ,
63
63
'text/html ' => 2 ,
64
64
'multipart/related ' => 3
65
- );
65
+ );
66
66
67
67
/** The CID of this entity */
68
68
private $ _id ;
@@ -87,9 +87,7 @@ public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_ContentEnc
87
87
$ this ->_headers = $ headers ;
88
88
$ this ->_grammar = $ grammar ;
89
89
$ 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 ' ));
93
91
94
92
// This array specifies that, when the entire MIME document contains
95
93
// $compoundLevel, then for each child within $level, if its Content-Type
@@ -186,9 +184,7 @@ public function setContentType($type)
186
184
*/
187
185
public function getId ()
188
186
{
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 ;
192
188
}
193
189
194
190
/**
@@ -474,16 +470,16 @@ public function toString()
474
470
$ string = $ this ->_headers ->toString ();
475
471
$ string .= $ this ->_bodyToString ();
476
472
477
- return $ string ;
478
- }
473
+ return $ string ;
474
+ }
479
475
480
- /**
476
+ /**
481
477
* Get this entire entity as a string.
482
478
*
483
- * @return string
484
- */
485
- protected function _bodyToString ()
486
- {
479
+ * @return string
480
+ */
481
+ protected function _bodyToString ()
482
+ {
487
483
$ string = '' ;
488
484
489
485
if (isset ($ this ->_body ) && empty ($ this ->_immediateChildren )) {
@@ -526,24 +522,23 @@ public function __toString()
526
522
/**
527
523
* Write this entire entity to a {@see Swift_InputByteStream}.
528
524
*
529
- *
530
525
* @param Swift_InputByteStream
531
526
*/
532
527
public function toByteStream (Swift_InputByteStream $ is )
533
528
{
534
529
$ is ->write ($ this ->_headers ->toString ());
535
530
$ is ->commit ();
536
531
537
- $ this ->_bodyToByteStream ($ is );
538
- }
532
+ $ this ->_bodyToByteStream ($ is );
533
+ }
539
534
540
- /**
535
+ /**
541
536
* Write this entire entity to a {@link Swift_InputByteStream}.
542
537
*
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
+ {
547
542
if (empty ($ this ->_immediateChildren )) {
548
543
if (isset ($ this ->_body )) {
549
544
if ($ this ->_cache ->hasKey ($ this ->_cacheKey , 'body ' )) {
@@ -559,13 +554,9 @@ protected function _bodyToByteStream(Swift_InputByteStream $is)
559
554
if ($ this ->_body instanceof Swift_OutputByteStream) {
560
555
$ this ->_body ->setReadPointer (0 );
561
556
562
- $ this ->_encoder ->encodeByteStream ($ this ->_body , $ is , 0 ,
563
- $ this ->getMaxLineLength ()
564
- );
557
+ $ this ->_encoder ->encodeByteStream ($ this ->_body , $ is , 0 , $ this ->getMaxLineLength ());
565
558
} 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 ()));
569
560
}
570
561
571
562
if ($ cacheIs ) {
@@ -661,7 +652,7 @@ protected function _fixHeaders()
661
652
/**
662
653
* Get the KeyCache used in this entity.
663
654
*
664
- * @return Swift_KeyCache
655
+ * @return Swift_KeyCache
665
656
*/
666
657
protected function _getCache ()
667
658
{
@@ -694,9 +685,7 @@ protected function _clearCache()
694
685
protected function getRandomId ()
695
686
{
696
687
$ 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 ' ;
700
689
$ id = $ idLeft . '@ ' . $ idRight ;
701
690
702
691
try {
0 commit comments