Skip to content
Open
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
7 changes: 3 additions & 4 deletions lib/Horde/Mail/Exception.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Copyright 2010-2017 Horde LLC (http://www.horde.org/)
* Copyright 2010-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you
* did not receive this file, see http://www.horde.org/licenses/bsd.
Expand All @@ -20,6 +21,4 @@
* @license http://www.horde.org/licenses/bsd New BSD License
* @package Mail
*/
class Horde_Mail_Exception extends Horde_Exception_Wrapped
{
}
class Horde_Mail_Exception extends Horde_Exception_Wrapped {}
46 changes: 23 additions & 23 deletions lib/Horde/Mail/Mbox/Parse.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Copyright 2011-2017 Horde LLC (http://www.horde.org/)
* Copyright 2011-2026 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you
* did not receive this file, see http://www.horde.org/licenses/bsd.
Expand All @@ -24,8 +25,7 @@
* @package Mail
* @since 2.5.0
*/
class Horde_Mail_Mbox_Parse
implements ArrayAccess, Countable, Iterator
class Horde_Mail_Mbox_Parse implements ArrayAccess, Countable, Iterator
{
/**
* Data stream.
Expand All @@ -42,7 +42,7 @@ class Horde_Mail_Mbox_Parse
*
* @var array
*/
protected $_parsed = array();
protected $_parsed = [];

/**
* Constructor.
Expand Down Expand Up @@ -108,10 +108,10 @@ public function __construct($data, $limit = null)
$date = null;
}

$this->_parsed[] = array(
$this->_parsed[] = [
'date' => $date,
'start' => ftell($this->_data)
);
'start' => ftell($this->_data),
];
}

/* Strip all empty lines before first data. */
Expand All @@ -122,26 +122,26 @@ public function __construct($data, $limit = null)

/* This was a single message, not a MBOX file. */
if (empty($this->_parsed)) {
$this->_parsed[] = array(
$this->_parsed[] = [
'date' => false,
'start' => $start
);
'start' => $start,
];
}
}

/* ArrayAccess methods. */

/**
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->_parsed[$offset]);
}

/**
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!isset($this->_parsed[$offset])) {
Expand Down Expand Up @@ -169,27 +169,27 @@ public function offsetGet($offset)
);
}

$out = array(
$out = [
'data' => $fd,
'date' => ($p['date'] === false) ? null : $p['date'],
'size' => intval(ftell($fd))
);
'size' => intval(ftell($fd)),
];
rewind($fd);

return $out;
}

/**
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
// NOOP
}

/**
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
// NOOP
Expand All @@ -202,7 +202,7 @@ public function offsetUnset($offset)
*
* @return integer The number of messages.
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function count()
{
return count($this->_parsed);
Expand All @@ -223,7 +223,7 @@ public function __toString()

/* Iterator methods. */

#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function current()
{
$key = $this->key();
Expand All @@ -233,27 +233,27 @@ public function current()
: $this[$key];
}

#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function key()
{
return key($this->_parsed);
}

#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function next()
{
if ($this->valid()) {
next($this->_parsed);
}
}

#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function rewind()
{
reset($this->_parsed);
}

#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function valid()
{
return !is_null($this->key());
Expand Down
Loading