Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
16 changes: 8 additions & 8 deletions src/Protocol/Imap.php
Expand Up @@ -473,7 +473,7 @@ public function examineOrSelect($command = 'EXAMINE', $box = 'INBOX')
$result[strtolower($tokens[1])] = $tokens[0];
break;
case '[UIDVALIDITY':
$result['uidvalidity'] = (int)$tokens[2];
$result['uidvalidity'] = (int) $tokens[2];
break;
default:
// ignore
Expand Down Expand Up @@ -529,11 +529,11 @@ public function fetch($items, $from, $to = null)
if (is_array($from)) {
$set = implode(',', $from);
} elseif ($to === null) {
$set = (int)$from;
$set = (int) $from;
} elseif ($to === INF) {
$set = (int)$from . ':*';
$set = (int) $from . ':*';
} else {
$set = (int)$from . ':' . (int)$to;
$set = (int) $from . ':' . (int)$to;
}

$items = (array)$items;
Expand Down Expand Up @@ -643,9 +643,9 @@ public function store(array $flags, $from, $to = null, $mode = null, $silent = t
}

$flags = $this->escapeList($flags);
$set = (int)$from;
$set = (int) $from;
if ($to != null) {
$set .= ':' . ($to == INF ? '*' : (int)$to);
$set .= ':' . ($to == INF ? '*' : (int) $to);
}

$result = $this->requestAndResponse('STORE', array($set, $item, $flags), $silent);
Expand Down Expand Up @@ -702,9 +702,9 @@ public function append($folder, $message, $flags = null, $date = null)
*/
public function copy($folder, $from, $to = null)
{
$set = (int)$from;
$set = (int) $from;
if ($to != null) {
$set .= ':' . ($to == INF ? '*' : (int)$to);
$set .= ':' . ($to == INF ? '*' : (int) $to);
}

return $this->requestAndResponse('COPY', array($set, $this->escapeString($folder)), true);
Expand Down
8 changes: 4 additions & 4 deletions src/Protocol/Pop3.php
Expand Up @@ -275,15 +275,15 @@ public function getList($msgno = null)
$result = $this->request("LIST $msgno");

list(, $result) = explode(' ', $result);
return (int)$result;
return (int) $result;
}

$result = $this->request('LIST', true);
$messages = array();
$line = strtok($result, "\n");
while ($line) {
list($no, $size) = explode(' ', trim($line));
$messages[(int)$no] = (int)$size;
$messages[(int)$no] = (int) $size;
$line = strtok("\n");
}

Expand Down Expand Up @@ -315,7 +315,7 @@ public function uniqueid($msgno = null)
continue;
}
list($no, $id) = explode(' ', trim($line), 2);
$messages[(int)$no] = $id;
$messages[(int) $no] = $id;
}

return $messages;
Expand Down Expand Up @@ -347,7 +347,7 @@ public function top($msgno, $lines = 0, $fallback = false)
}
$this->hasTop = true;

$lines = (!$lines || $lines < 1) ? 0 : (int)$lines;
$lines = (!$lines || $lines < 1) ? 0 : (int) $lines;

try {
$result = $this->request("TOP $msgno $lines", true);
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Folder.php
Expand Up @@ -170,7 +170,7 @@ public function __unset($name)
*/
public function __toString()
{
return (string)$this->getGlobalName();
return (string) $this->getGlobalName();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Folder/Maildir.php
Expand Up @@ -58,7 +58,7 @@ class Maildir extends Storage\Maildir implements FolderInterface
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

if (!isset($params->dirname) || !is_dir($params->dirname)) {
Expand Down Expand Up @@ -186,7 +186,7 @@ public function getFolders($rootFolder = null)
*/
public function selectFolder($globalName)
{
$this->currentFolder = (string)$globalName;
$this->currentFolder = (string) $globalName;

// getting folder from folder tree for validation
$folder = $this->getFolders($this->currentFolder);
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Folder/Mbox.php
Expand Up @@ -54,7 +54,7 @@ class Mbox extends Storage\Mbox implements FolderInterface
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

if (isset($params->filename)) {
Expand Down Expand Up @@ -160,7 +160,7 @@ public function getFolders($rootFolder = null)
*/
public function selectFolder($globalName)
{
$this->currentFolder = (string)$globalName;
$this->currentFolder = (string) $globalName;

// getting folder from folder tree for validation
$folder = $this->getFolders($this->currentFolder);
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Imap.php
Expand Up @@ -181,7 +181,7 @@ public function getRawContent($id, $part = null)
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

$this->has['flags'] = true;
Expand Down Expand Up @@ -307,7 +307,7 @@ public function getNumberByUniqueId($id)
*/
public function getFolders($rootFolder = null)
{
$folders = $this->protocol->listMailbox((string)$rootFolder);
$folders = $this->protocol->listMailbox((string) $rootFolder);
if (!$folders) {
throw new Exception\InvalidArgumentException('folder not found');
}
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Maildir.php
Expand Up @@ -221,7 +221,7 @@ public function getRawContent($id, $part = null)
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

if (!isset($params->dirname) || !is_dir($params->dirname)) {
Expand Down Expand Up @@ -330,7 +330,7 @@ protected function _getMaildirFiles($dh, $dirname, $default_flags = array())
'flaglookup' => array_flip($named_flags),
'filename' => $dirname . $entry);
if ($size !== null) {
$data['size'] = (int)$size;
$data['size'] = (int) $size;
}
$this->files[] = $data;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Mbox.php
Expand Up @@ -183,7 +183,7 @@ public function getRawContent($id, $part = null)
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

if (!isset($params->filename)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Pop3.php
Expand Up @@ -40,7 +40,7 @@ public function countMessages()
$count = 0; // "Declare" variable before first usage.
$octets = 0; // "Declare" variable since it's passed by reference
$this->protocol->status($count, $octets);
return (int)$count;
return (int) $count;
}

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public function getRawContent($id, $part = null)
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

$this->has['fetchPart'] = false;
Expand Down
12 changes: 6 additions & 6 deletions src/Storage/Writable/Maildir.php
Expand Up @@ -87,7 +87,7 @@ public static function initMaildir($dir)
public function __construct($params)
{
if (is_array($params)) {
$params = (object)$params;
$params = (object) $params;
}

if (!empty($params->create) && isset($params->dirname) && !file_exists($params->dirname . DIRECTORY_SEPARATOR . 'cur')) {
Expand Down Expand Up @@ -495,7 +495,7 @@ public function appendMessage($message, $folder = null, $flags = null, $recent =
'flags' => $flags,
'filename' => $new_filename);
if ($this->quota) {
$this->_addQuotaEntry((int)$size, 1);
$this->_addQuotaEntry((int) $size, 1);
}
}

Expand Down Expand Up @@ -565,7 +565,7 @@ public function copyMessage($id, $folder)
}

if ($this->quota) {
$this->_addQuotaEntry((int)$size, 1);
$this->_addQuotaEntry((int) $size, 1);
}
}

Expand Down Expand Up @@ -686,7 +686,7 @@ public function removeMessage($id)
// remove the gap
$this->files = array_values($this->files);
if ($this->quota) {
$this->_addQuotaEntry(0 - (int)$size, -1);
$this->_addQuotaEntry(0 - (int) $size, -1);
}
}

Expand Down Expand Up @@ -923,8 +923,8 @@ protected function _addQuotaEntry($size, $count = 1)
if (!file_exists($this->rootdir . 'maildirsize')) {
// TODO: should get file handler from _calculateQuota
}
$size = (int)$size;
$count = (int)$count;
$size = (int) $size;
$count = (int) $count;
file_put_contents($this->rootdir . 'maildirsize', "$size $count\n", FILE_APPEND);
}

Expand Down

0 comments on commit 19c92ef

Please sign in to comment.