icecave / repr
Showing 2 of 5 files from the diff.

@@ -1,4 +1,5 @@
Loading
1 1
<?php
2 +
2 3
namespace Icecave\Repr;
3 4
4 5
/**
@@ -7,8 +8,8 @@
Loading
7 8
class Repr
8 9
{
9 10
    /**
10 -
    * Generate a string representation for an arbitrary value.
11 -
    *
11 +
     * Generate a string representation for an arbitrary value.
12 +
     *
12 13
     * @param mixed $value The value for which a string reprsentation should be generated.
13 14
     *
14 15
     * @return string The string representation of $value.

@@ -1,4 +1,5 @@
Loading
1 1
<?php
2 +
2 3
namespace Icecave\Repr;
3 4
4 5
use ReflectionClass;
@@ -9,9 +10,9 @@
Loading
9 10
class Generator
10 11
{
11 12
    /**
12 -
     * @param integer $maximumLength   The maximum number of characters to display when representing a string.
13 -
     * @param integer $maximumDepth    The maximum depth to represent for nested types.
14 -
     * @param integer $maximumElements The maximum number of elements to include in representations of container types.
13 +
     * @param int $maximumLength   The maximum number of characters to display when representing a string.
14 +
     * @param int $maximumDepth    The maximum depth to represent for nested types.
15 +
     * @param int $maximumElements The maximum number of elements to include in representations of container types.
15 16
     */
16 17
    public function __construct($maximumLength = 50, $maximumDepth = 3, $maximumElements = 3)
17 18
    {
@@ -23,8 +24,8 @@
Loading
23 24
    /**
24 25
     * Generate a string representation for an arbitrary value.
25 26
     *
26 -
     * @param mixed   $value        The value to represent.
27 -
     * @param integer $currentDepth The current depth in the representation string.
27 +
     * @param mixed $value        The value to represent.
28 +
     * @param int   $currentDepth The current depth in the representation string.
28 29
     *
29 30
     * @return string A short human-readable string representation of the given value.
30 31
     */
@@ -46,7 +47,7 @@
Loading
46 47
    }
47 48
48 49
    /**
49 -
     * @return integer The maximum number of characters to display when representing a string.
50 +
     * @return int The maximum number of characters to display when representing a string.
50 51
     */
51 52
    public function maximumLength()
52 53
    {
@@ -54,7 +55,7 @@
Loading
54 55
    }
55 56
56 57
    /**
57 -
     * @param integer $maximum The maximum number of characters to display when representing a string.
58 +
     * @param int $maximum The maximum number of characters to display when representing a string.
58 59
     */
59 60
    public function setMaximumLength($maximum)
60 61
    {
@@ -62,7 +63,7 @@
Loading
62 63
    }
63 64
64 65
    /**
65 -
     * @return integer The maximum depth to represent for nested types.
66 +
     * @return int The maximum depth to represent for nested types.
66 67
     */
67 68
    public function maximumDepth()
68 69
    {
@@ -70,7 +71,7 @@
Loading
70 71
    }
71 72
72 73
    /**
73 -
     * @param integer $maximum The maximum depth to represent for nested types.
74 +
     * @param int $maximum The maximum depth to represent for nested types.
74 75
     */
75 76
    public function setMaximumDepth($maximum)
76 77
    {
@@ -78,7 +79,7 @@
Loading
78 79
    }
79 80
80 81
    /**
81 -
     * @return integer The maximum number of elements to include in representations of container types.
82 +
     * @return int The maximum number of elements to include in representations of container types.
82 83
     */
83 84
    public function maximumElements()
84 85
    {
@@ -86,7 +87,7 @@
Loading
86 87
    }
87 88
88 89
    /**
89 -
     * @param integer $maximum The maximum number of elements to include in representations of container types.
90 +
     * @param int $maximum The maximum number of elements to include in representations of container types.
90 91
     */
91 92
    public function setMaximumElements($maximum)
92 93
    {
@@ -97,12 +98,12 @@
Loading
97 98
     * Render a list of values.
98 99
     *
99 100
     * @param traversable $value        The traversable containing the elements.
100 -
     * @param integer     $currentDepth The current rendering depth.
101 +
     * @param int         $currentDepth The current rendering depth.
101 102
     * @param string      $separator    The separator to use between elements.
102 103
     */
103 104
    public function renderValueList($value, $currentDepth = 0, $separator = ', ')
104 105
    {
105 -
        $elements = array();
106 +
        $elements = [];
106 107
107 108
        $counter = 0;
108 109
        foreach ($value as $element) {
@@ -116,13 +117,13 @@
Loading
116 117
     * Render a list of keys and values.
117 118
     *
118 119
     * @param traversable $value        The traversable containing the elements.
119 -
     * @param integer     $currentDepth The current rendering depth.
120 +
     * @param int         $currentDepth The current rendering depth.
120 121
     * @param string      $separator    The separator to use between elements.
121 122
     * @param string      $keySeparator The separator to use between key and value.
122 123
     */
123 124
    public function renderKeyValueList($value, $currentDepth = 0, $separator = ', ', $keySeparator = ' => ')
124 125
    {
125 -
        $elements = array();
126 +
        $elements = [];
126 127
127 128
        foreach ($value as $key => $element) {
128 129
            $elements[] = $this->generate($key, $currentDepth) . $keySeparator . $this->generate($element, $currentDepth);
@@ -132,8 +133,8 @@
Loading
132 133
    }
133 134
134 135
    /**
135 -
     * @param array   $value
136 -
     * @param integer $currentDepth
136 +
     * @param array $value
137 +
     * @param int   $currentDepth
137 138
     *
138 139
     * @return string
139 140
     */
@@ -162,8 +163,8 @@
Loading
162 163
    }
163 164
164 165
    /**
165 -
     * @param object  $value
166 -
     * @param integer $currentDepth
166 +
     * @param object $value
167 +
     * @param int    $currentDepth
167 168
     *
168 169
     * @return string
169 170
     */
@@ -190,7 +191,7 @@
Loading
190 191
191 192
    /**
192 193
     * @param resource $value
193 -
     * @param integer  $currentDepth
194 +
     * @param int      $currentDepth
194 195
     *
195 196
     * @return string
196 197
     */
@@ -240,7 +241,7 @@
Loading
240 241
                $ch = '\e';
241 242
            } elseif ($ch === "\f") {
242 243
                $ch = '\f';
243 -
            } elseif ($ch === "\\") {
244 +
            } elseif ($ch === '\\') {
244 245
                $ch = '\\\\';
245 246
            } elseif ($ch === '$') {
246 247
                $ch = '\$';
@@ -257,8 +258,8 @@
Loading
257 258
    }
258 259
259 260
    /**
260 -
     * @param scalar  $value
261 -
     * @param integer $currentDepth
261 +
     * @param scalar $value
262 +
     * @param int    $currentDepth
262 263
     *
263 264
     * @return string
264 265
     */
@@ -272,8 +273,8 @@
Loading
272 273
    }
273 274
274 275
    /**
275 -
     * @param scalar  $value
276 -
     * @param integer $currentDepth
276 +
     * @param scalar $value
277 +
     * @param int    $currentDepth
277 278
     *
278 279
     * @return string
279 280
     */
Files Complexity Coverage
src 48 100.00%
Project Totals (2 files) 48 100.00%
42.2
7.3=.3
TRAVIS_OS_NAME=linux
42.1
7.2=.2
TRAVIS_OS_NAME=linux
42.3
TRAVIS_OS_NAME=linux
7.4=.4

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading