Completed
Push — master ( 1ea133...692929 )
by recca
07:00
created

PHP   B

Complexity

Total Complexity 38

Size/Duplication

Total Lines 327
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 23.08%

Importance

Changes 0
Metric Value
wmc 38
lcom 1
cbo 4
dl 0
loc 327
ccs 18
cts 78
cp 0.2308
rs 8.3999
c 0
b 0
f 0

31 Methods

Rating   Name   Duplication   Size   Complexity  
A addcslashes() 0 4 1
A addslashes() 0 4 1
A bin2hex() 0 4 1
A convertEncoding() 0 6 2
A convertTo() 0 4 1
A chineseToNumber() 0 4 1
A explode() 0 6 2
A htmlEntityDecode() 0 6 2
A htmlentities() 0 6 2
A htmlspecialcharsDecode() 0 6 2
A htmlspecialchars() 0 6 2
A lcfirst() 0 4 1
A ltrim() 0 4 1
A md5() 0 4 1
A nl2br() 0 4 1
A parse() 0 7 1
A rtrim() 0 4 1
A sha1() 0 4 1
A sscanf() 0 4 1
A pad() 0 4 1
A rot13() 0 4 1
A shuffle() 0 4 1
A stripTags() 0 6 2
A stripcslashes() 0 4 1
A stripslashes() 0 4 1
A reverse() 0 4 1
A toFullCase() 0 4 1
A toHalfCase() 0 4 1
A ucfirst() 0 4 1
A ucwords() 0 4 1
A wordwrap() 0 4 1
1
<?php
2
3
namespace Recca0120\Lodash\JString;
4
5
use Recca0120\Lodash\JArray;
6
use Recca0120\Lodash\JString\Extensions\Chinese;
7
use Recca0120\Lodash\JString\Extensions\FullCase;
8
use Recca0120\Lodash\JString\Extensions\Converter;
9
10
trait PHP
11
{
12
    /**
13
     * Quote string with slashes in a C style.
14
     *
15
     * @param string $charlist
16
     * @return static
17
     */
18
    public function addcslashes($charlist)
19
    {
20
        return new static(addcslashes($this->subject, $charlist));
2 ignored issues
show
Bug introduced by
The property subject does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with addcslashes($this->subject, $charlist).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
21
    }
22
23
    /**
24
     *  Quote string with slashes.
25
     *
26
     * @return static
27
     */
28
    public function addslashes()
29
    {
30
        return new static(addslashes($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with addslashes($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
31
    }
32
33
    /**
34
     *  Convert binary data into hexadecimal representation.
35
     *
36
     * @return static
37
     */
38
    public function bin2hex()
39
    {
40
        return new static(bin2hex($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with bin2hex($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
41
    }
42
43 1
    public function convertEncoding($toEncoding)
44
    {
45 1
        return func_num_args() === 1 ?
46 1
            new static(mb_convert_encoding($this->subject, $toEncoding)) :
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with mb_convert_encoding($this->subject, $toEncoding).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
47 1
            new static(mb_convert_encoding($this->subject, $toEncoding, func_get_arg(0)));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with mb_convert_encoding($thi...oding, func_get_arg(0)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
48
    }
49
50 1
    public function convertTo($variant = 'zh-tw')
51
    {
52 1
        return new static(Converter::instance()->convertTo($this->subject, $variant));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with \Recca0120\Lodash\JStrin...his->subject, $variant).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
53
    }
54
55
    public function chineseToNumber()
56
    {
57
        return (new Chinese($this->subject))->toNumber();
58
    }
59
60
    /**
61
     * Split a string by string.
62
     *
63
     * @param string $delimiter
64
     * @param int $limit
1 ignored issue
show
Bug introduced by
There is no parameter named $limit. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
65
     * @return \Recca0120\Lodash\JArray
66
     */
67 1
    public function explode($delimiter)
68
    {
69 1
        return func_num_args() === 1 ?
70 1
            new JArray(explode($delimiter, $this->subject)) :
71 1
            new JArray(explode($delimiter, $this->subject, func_get_arg(1)));
72
    }
73
74
    /**
75
     * Convert all HTML entities to their applicable characters.
76
     *
77
     * @param int $flags
1 ignored issue
show
Bug introduced by
There is no parameter named $flags. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
78
     * @return static
79
     */
80
    public function htmlEntityDecode()
81
    {
82
        return func_num_args() === 0 ?
83
            new static(html_entity_decode($this->subject)) :
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with html_entity_decode($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
84
            new static(html_entity_decode($this->subject, func_get_arg(0)));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with html_entity_decode($this...bject, func_get_arg(0)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
85
    }
86
87
    /**
88
     * Convert all applicable characters to HTML entities.
89
     *
90
     * @param int $flags
1 ignored issue
show
Bug introduced by
There is no parameter named $flags. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
91
     * @return static
92
     */
93 1
    public function htmlentities()
94
    {
95 1
        return func_num_args() === 0 ?
96 1
            new static(htmlentities($this->subject)) :
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with htmlentities($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
97 1
            new static(htmlentities($this->subject, func_get_arg(0)));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with htmlentities($this->subject, func_get_arg(0)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
98
    }
99
100
    /**
101
     * Convert special HTML entities back to characters.
102
     *
103
     * @param int $flags
1 ignored issue
show
Bug introduced by
There is no parameter named $flags. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
104
     * @return static
105
     */
106
    public function htmlspecialcharsDecode()
107
    {
108
        return func_num_args() === 0 ?
109
            new static(htmlspecialchars_decode($this->subject)) :
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with htmlspecialchars_decode($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
110
            new static(htmlspecialchars_decode($this->subject, func_get_arg(0)));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with htmlspecialchars_decode(...bject, func_get_arg(0)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
111
    }
112
113
    /**
114
     * Convert special characters to HTML entities.
115
     *
116
     * @param int $flags
1 ignored issue
show
Bug introduced by
There is no parameter named $flags. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
117
     * @return static
118
     */
119
    public function htmlspecialchars()
120
    {
121
        return func_num_args() === 0 ?
122
            new static(htmlspecialchars($this->subject)) :
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with htmlspecialchars($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
123
            new static(htmlspecialchars($this->subject, func_get_arg(0)));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with htmlspecialchars($this->subject, func_get_arg(0)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
124
    }
125
126
    /**
127
     * Make a string's first character lowercase.
128
     *
129
     * @return static
130
     */
131
    public function lcfirst()
132
    {
133
        return new static(lcfirst($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with lcfirst($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
134
    }
135
136
    /**
137
     * Strip whitespace (or other characters) from the beginning of a string.
138
     *
139
     * @param string $characterMask
140
     * @return static
141
     */
142 1
    public function ltrim($characterMask = " \t\n\r\0\x0B")
143
    {
144 1
        return new static(ltrim($this->subject, $characterMask));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with ltrim($this->subject, $characterMask).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
145
    }
146
147
    /**
148
     * Calculate the md5 hash of a string.
149
     *
150
     * @param bool $rawOutput
151
     * @return static
152
     */
153
    public function md5($rawOutput = false)
154
    {
155
        return new static(md5($this->subject, $rawOutput));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with md5($this->subject, $rawOutput).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
156
    }
157
158
    /**
159
     * Inserts HTML line breaks before all newlines in a string.
160
     *
161
     * @param bool $isXHTML
162
     * @return static
163
     */
164
    public function nl2br($isXHTML = true)
165
    {
166
        return new static(nl2br($this->subject, $isXHTML));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with nl2br($this->subject, $isXHTML).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
167
    }
168
169
    /**
170
     * Parses the string into variables.
171
     *
172
     * @return \Recca0120\Lodash\JArray
173
     */
174
    public function parse()
175
    {
176
        $results = [];
177
        parse_str($this->subject, $results);
178
179
        return new JArray($results);
180
    }
181
182
    /**
183
     * Strip whitespace (or other characters) from the end of a string.
184
     *
185
     * @param string $characterMask
186
     * @return static
187
     */
188 1
    public function rtrim($characterMask = " \t\n\r\0\x0B")
189
    {
190 1
        return new static(rtrim($this->subject, $characterMask));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with rtrim($this->subject, $characterMask).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
191
    }
192
193
    /**
194
     * Calculate the sha1 hash of a string.
195
     *
196
     * @return static
197
     */
198
    public function sha1()
199
    {
200
        return new static(sha1($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with sha1($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
201
    }
202
203
    /**
204
     * Parses input from a string according to a format.
205
     *
206
     * @param string $format
207
     * @return \Recca0120\Lodash\JArray
208
     */
209
    public function sscanf($format)
210
    {
211
        return new JArray(sscanf($this->subject, $format));
212
    }
213
214
    /**
215
     * Pad a string to a certain length with another string.
216
     *
217
     * @param int $length
218
     * @param string $chars
219
     * @param int $type
220
     * @return static
221
     */
222
    public function pad($length = 0, $chars = ' ', $type = STR_PAD_BOTH)
223
    {
224
        return new static(str_pad($this->subject, $length, $chars, $type));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with str_pad($this->subject, $length, $chars, $type).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
225
    }
226
227
    /**
228
     * Perform the rot13 transform on a string.
229
     *
230
     * @return static
231
     */
232
    public function rot13()
233
    {
234
        return new static(str_rot13($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with str_rot13($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
235
    }
236
237
    /**
238
     * Randomly shuffles a string.
239
     *
240
     * @return static
241
     */
242
    public function shuffle()
243
    {
244
        return new static(str_shuffle($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with str_shuffle($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
245
    }
246
247
    /**
248
     * Strip HTML and PHP tags from a string.
249
     *
250
     * @param string $allowable_tags
1 ignored issue
show
Bug introduced by
There is no parameter named $allowable_tags. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
251
     *
252
     * @return static
253
     */
254
    public function stripTags()
255
    {
256
        return func_num_args() === 0 ?
257
            new static(strip_tags($this->subject)) :
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with strip_tags($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
258
            new static(strip_tags($this->subject, func_get_arg(0)));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with strip_tags($this->subject, func_get_arg(0)).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
259
    }
260
261
    /**
262
     * Un-quote string quoted with addcslashes().
263
     *
264
     * @return static
265
     */
266
    public function stripcslashes()
267
    {
268
        return new static(stripcslashes($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with stripcslashes($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
269
    }
270
271
    /**
272
     * Un-quotes a quoted string.
273
     *
274
     * @return static
275
     */
276
    public function stripslashes()
277
    {
278
        return new static(stripslashes($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with stripslashes($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
279
    }
280
281
    /**
282
     * Reverse a string.
283
     *
284
     * @return static
285
     */
286
    public function reverse()
287
    {
288
        return new static(strrev($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with strrev($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
289
    }
290
291
    public function toFullCase()
292
    {
293
        return new static((new FullCase($this->subject))->toFullCase());
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with (new \Recca0120\Lodash\J...subject))->toFullCase().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
294
    }
295
296
    public function toHalfCase()
297
    {
298
        return new static((new FullCase($this->subject))->toHalfCase());
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with (new \Recca0120\Lodash\J...subject))->toHalfCase().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
299
    }
300
301
    /**
302
     * Make a string's first character uppercase.
303
     *
304
     * @return static
305
     */
306
    public function ucfirst()
307
    {
308
        return new static(ucfirst($this->subject));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with ucfirst($this->subject).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
309
    }
310
311
    /**
312
     * Uppercase the first character of each word in a string.
313
     *
314
     * @param string $delimiters
315
     *
316
     * @return static
317
     */
318
    public function ucwords($delimiters = " \t\r\n\f\v")
319
    {
320
        return new static(ucwords($this->subject, $delimiters));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with ucwords($this->subject, $delimiters).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
321
    }
322
323
    /**
324
     * Wraps a string to a given number of characters.
325
     *
326
     * @param int $width
327
     * @param string $break
328
     * @param bool $cut
329
     *
330
     * @return static
331
     */
332
    public function wordwrap($width = 75, $break = "\n", $cut = false)
0 ignored issues
show
Unused Code introduced by
The parameter $width is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
333
    {
334
        return new static(wordwrap($this->subject, $break, $cut));
1 ignored issue
show
Unused Code introduced by
The call to PHP::__construct() has too many arguments starting with wordwrap($this->subject, $break, $cut).

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
335
    }
336
}
337