Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Cleaned trailing whitespace #194

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lib/classes/Swift.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@

/**
* General utility class in Swift Mailer, not to be instantiated.
*
*
* @package Swift
*
*
* @author Chris Corbyn
*/
abstract class Swift
{

static $initialized = false;
static $initPath;

/** Swift Mailer Version number generated during dist release process */
const VERSION = '@SWIFT_VERSION_NUMBER@';

/**
* Internal autoloader for spl_autoload_register().
*
*
* @param string $class
*/
public static function autoload($class)
Expand All @@ -52,10 +52,10 @@ public static function autoload($class)

require $path;
}

/**
* Configure autoloading using Swift Mailer.
*
*
* This is designed to play nicely with other autoloaders.
*
* @param string $initPath The init script to load when autoloading the first Swift class
Expand All @@ -65,5 +65,5 @@ public static function registerAutoload($initPath = null)
self::$initPath = $initPath;
spl_autoload_register(array('Swift', 'autoload'));
}

}
10 changes: 5 additions & 5 deletions lib/classes/Swift/Attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
class Swift_Attachment extends Swift_Mime_Attachment
{

/**
* Create a new Attachment.
* Details may be optionally provided to the constructor.
Expand All @@ -33,15 +33,15 @@ public function __construct($data = null, $filename = null,
Swift_DependencyContainer::getInstance()
->createDependenciesFor('mime.attachment')
);

$this->setBody($data);
$this->setFilename($filename);
if ($contentType)
{
$this->setContentType($contentType);
}
}

/**
* Create a new Attachment.
* @param string|Swift_OutputByteStream $data
Expand All @@ -54,7 +54,7 @@ public static function newInstance($data = null, $filename = null,
{
return new self($data, $filename, $contentType);
}

/**
* Create a new Attachment from a filesystem path.
* @param string $path
Expand All @@ -68,5 +68,5 @@ public static function fromPath($path, $contentType = null)
$contentType
);
}

}
54 changes: 27 additions & 27 deletions lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@
abstract class Swift_ByteStream_AbstractFilterableInputStream
implements Swift_InputByteStream, Swift_Filterable
{

/** Write sequence */
private $_sequence = 0;
protected $_sequence = 0;

/** StreamFilters */
private $_filters = array();
protected $_filters = array();

/** A buffer for writing */
private $_writeBuffer = '';
protected $_writeBuffer = '';

/** Bound streams */
private $_mirrors = array();
protected $_mirrors = array();

/**
* Commit the given bytes to the storage medium immediately.
* @param string $bytes
* @access protected
*/
abstract protected function _commit($bytes);

/**
* Flush any buffers/content with immediate effect.
* @access protected
*/
abstract protected function _flush();

/**
* Add a StreamFilter to this InputByteStream.
* @param Swift_StreamFilter $filter
Expand All @@ -53,7 +53,7 @@ public function addFilter(Swift_StreamFilter $filter, $key)
{
$this->_filters[$key] = $filter;
}

/**
* Remove an already present StreamFilter based on its $key.
* @param string $key
Expand All @@ -62,7 +62,7 @@ public function removeFilter($key)
{
unset($this->_filters[$key]);
}

/**
* Writes $bytes to the end of the stream.
* @param string $bytes
Expand All @@ -81,36 +81,36 @@ public function write($bytes)
$this->_doWrite($this->_writeBuffer);
return ++$this->_sequence;
}

/**
* For any bytes that are currently buffered inside the stream, force them
* off the buffer.
*
*
* @throws Swift_IoException
*/
public function commit()
{
$this->_doWrite($this->_writeBuffer);
}

/**
* Attach $is to this stream.
* The stream acts as an observer, receiving all data that is written.
* All {@link write()} and {@link flushBuffers()} operations will be mirrored.
*
*
* @param Swift_InputByteStream $is
*/
public function bind(Swift_InputByteStream $is)
{
$this->_mirrors[] = $is;
}

/**
* Remove an already bound stream.
* If $is is not bound, no errors will be raised.
* If the stream currently has any buffered data it will be written to $is
* before unbinding occurs.
*
*
* @param Swift_InputByteStream $is
*/
public function unbind(Swift_InputByteStream $is)
Expand All @@ -127,7 +127,7 @@ public function unbind(Swift_InputByteStream $is)
}
}
}

/**
* Flush the contents of the stream (empty it) and set the internal pointer
* to the beginning.
Expand All @@ -140,15 +140,15 @@ public function flushBuffers()
$this->_doWrite($this->_writeBuffer);
}
$this->_flush();

foreach ($this->_mirrors as $stream)
{
$stream->flushBuffers();
}
}

// -- Private methods

/** Run $bytes through all filters */
private function _filter($bytes)
{
Expand All @@ -158,18 +158,18 @@ private function _filter($bytes)
}
return $bytes;
}

/** Just write the bytes to the stream */
private function _doWrite($bytes)
{
$this->_commit($this->_filter($bytes));

foreach ($this->_mirrors as $stream)
{
$stream->write($bytes);
}

$this->_writeBuffer = '';
}

}
14 changes: 7 additions & 7 deletions lib/classes/Swift/ByteStream/ArrayByteStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class Swift_ByteStream_ArrayByteStream
* @access private
*/
private $_offset = 0;

/** Bound streams */
private $_mirrors = array();

/**
* Create a new ArrayByteStream.
* If $stack is given the stream will be populated with the bytes it contains.
Expand Down Expand Up @@ -105,20 +105,20 @@ public function write($bytes)
$this->_array[] = $value;
}
$this->_arraySize = count($this->_array);

foreach ($this->_mirrors as $stream)
{
$stream->write($bytes);
}
}

/**
* Not used.
*/
public function commit()
{
}

/**
* Attach $is to this stream.
* The stream acts as an observer, receiving all data that is written.
Expand All @@ -130,7 +130,7 @@ public function bind(Swift_InputByteStream $is)
{
$this->_mirrors[] = $is;
}

/**
* Remove an already bound stream.
* If $is is not bound, no errors will be raised.
Expand Down Expand Up @@ -178,7 +178,7 @@ public function flushBuffers()
$this->_offset = 0;
$this->_array = array();
$this->_arraySize = 0;

foreach ($this->_mirrors as $stream)
{
$stream->flushBuffers();
Expand Down
Loading