PEAR2_Net_RouterOS-1.0.0b2 › PEAR2_Net_RouterOS-1.0.0b2/src/PEAR2/Net/RouterOS/LengthException.php
- PEAR2_Net_RouterOS-1.0.0b2/
- docs/
- docblox.xml
- docblox.xsd
- doxygen.ini
- tutorials/
- PEAR2_Net_RouterOS/
- examples/
- src/
- PEAR2/
- Net/
- RouterOS/
- Transmitter/
- Net/
- PEAR2/
- tests/
- docs/
- package.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* RouterOS API client implementation.
*
* RouterOS is the flag product of the company MikroTik and is a powerful router software. One of its many abilities is to allow control over it via an API. This package provides a client for that API, in turn allowing you to use PHP to control RouterOS hosts.
*
* PHP version 5
*
* @category Net
* @package PEAR2_Net_RouterOS
* @author Vasil Rangelov <boen.robot@gmail.com>
* @copyright 2011 Vasil Rangelov
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @version 1.0.0b2
* @link http://pear2.php.net/PEAR2_Net_RouterOS
*/
/**
* The namespace declaration.
*/
namespace PEAR2\Net\RouterOS;
/**
* Exception thrown when there is a problem with a word's length.
*
* @category Net
* @package PEAR2_Net_RouterOS
* @author Vasil Rangelov <boen.robot@gmail.com>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link http://pear2.php.net/PEAR2_Net_RouterOS
*/
class LengthException extends \LengthException implements Exception
{
/**
*
* @var mixed The unsuppported value.
*/
private $_length = null;
/**
* Creates a new LengthException.
*
* @param string $message The Exception message to throw.
* @param int $code The Exception code.
* @param Exception $previous The previous exception used for the exception
* chaining.
* @param number $value The length.
*/
public function __construct($message, $code = 0, $previous = null,
$value = null
) {
parent::__construct($message, $code, $previous);
$this->_length = $value;
}
/**
* Gets the length.
*
* @return number The length.
*/
public function getLength()
{
return $this->_length;
}
// @codeCoverageIgnoreStart
// String representation is not reliable in testing
/**
* Returns a string representation of the exception.
*
* @return string The exception as a string.
*/
public function __toString()
{
return parent::__toString() . "\nValue:{$this->_length}";
}
// @codeCoverageIgnoreEnd
}EOF
