http://phing.info/

Source Code Coverage

Designed for use with PHPUnit2, Xdebug and Phing.

Methods: 5 LOC: 81 Statements: 8
Legend: executednot executeddead code
Source file Statements Methods Total coverage
MapEntry.php 100.0% 100.0% 100.0%
 
1
<?php
2
3
/**
4
 * Xyster Framework
5
 *
6
 * This source file is subject to the new BSD license that is bundled
7
 * with this package in the file LICENSE.txt.
8
 * It is also available through the world-wide-web at this URL:
9
 * http://www.opensource.org/licenses/bsd-license.php
10
 *
11
 * @category  Xyster
12
 * @package   Xyster_Collection
13
 * @copyright Copyright LibreWorks, LLC (http://libreworks.net)
14
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
15
 */
16
namespace Xyster\Collection;
17
/**
18
 * Simple Map Entry
19
 *
20
 * @category  Xyster
21
 * @package   Xyster_Collection
22
 * @copyright Copyright LibreWorks, LLC (http://libreworks.net)
23
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
24
 */
25
class MapEntry
26
{
27
    protected $_key;
28
    protected $_value;
29
30
    /**
31
     * Creates a new map entry
32
     *
33
     * @param mixed $key The key of the entry
34
     * @param mixed $value The value of the entry
35
     */
36
    public function __construct($key, $value)
37
    {
38 35
        $this->_key = $key;
39 35
        $this->_value = $value;
40
    }
41
42
    /**
43
     * Gets the key for this mapping
44
     *
45
     * @return mixed The key
46
     */
47
    public function getKey()
48
    {
49 9
        return $this->_key;
50
    }
51
52
    /**
53
     * Gets the value for this mapping
54
     *
55
     * @return mixed The value
56
     */
57
    public function getValue()
58
    {
59 17
        return $this->_value;
60
    }
61
62
    /**
63
     * Sets the value for this mapping
64
     *
65
     * @param mixed $value The new value
66
     */
67
    public function setValue($value)
68
    {
69 3
        $this->_value = $value;
70
    }
71
72
    /**
73
     * Gets the string equivalent of this mapping
74
     *
75
     * @return string
76
     */
77
    public function __toString()
78
    {
79 1
        return $this->_key . "=" . $this->_value;
80
    }
81 1
}


Report generated at 2010-10-18T17:19:49-04:00