Skip to content

Commit c9b9c39

Browse files
authored
Fix incorrect usage of "amount" instead of "number". (#1842)
1 parent 6b04399 commit c9b9c39

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

.travis/verify-discovered-values-cleanup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
$fileContent = file_get_contents($file->getPathname());
1111
preg_match_all('/([ ]+)(final[ ]+)?[a-z<>]+[ ]+([a-z]+)[ ]+=\s+PossibleValuesDiscoveryUtil\s*\.\s*discover\(/ims', $fileContent, $discovery);
1212
if ($discovery[0] !== []) {
13-
/* match amount of calls */
13+
/* match number of calls */
1414
preg_match_all('/([ ]+)('.implode('|', $discovery[3]).')\.clear\(/ims', $fileContent, $clearing);
1515
if (count($discovery[0]) !== count($clearing[0])) {
1616
$missingClear []= $file->getFilename();

docs/control-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Php Inspections (EA Extended) friendly way:
7777
## If-return-return could be simplified
7878

7979
The inspection finds places where conditional return-statements can be simplified (by Quick-Fixing), reducing code
80-
complexity metrics and amount of maintainable codebase.
80+
complexity metrics and size of maintainable codebase.
8181

8282
```php
8383
/* before */

src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/PrintfScanfArgumentsInspector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
public class PrintfScanfArgumentsInspector extends BasePhpInspection {
3434
private static final String messagePattern = "Pattern seems to be not valid.";
35-
private static final String messageParameters = "Amount of expected parameters is %c%.";
35+
private static final String messageParameters = "Number of expected parameters is %c%.";
3636

3737
@NotNull
3838
@Override

src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/debug/ForgottenDebugOutputInspector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public String getDisplayName() {
185185

186186
private static final Map<String, Integer> functionsRequirements = new HashMap<>();
187187
static {
188-
/* function name => amount of arguments considered legal */
188+
/* function name => number of arguments considered legal */
189189
functionsRequirements.put("debug_print_backtrace", -1);
190190
functionsRequirements.put("debug_zval_dump", -1);
191191
functionsRequirements.put("phpinfo", 1);

src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/fileSystem/CascadingDirnameCallsInspector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030

3131
public class CascadingDirnameCallsInspector extends BasePhpInspection {
32-
private static final String messagePattern = "'%e%' can be used instead (reduces amount of calls).";
32+
private static final String messagePattern = "'%e%' can be used instead (reduces number of calls).";
3333

3434
@NotNull
3535
@Override

src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessMethodDuplicationInspector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void visitPhpMethod(@NotNull Method method) {
7070
return;
7171
}
7272

73-
/* ensure parent, parent methods are existing and contains the same amount of expressions */
73+
/* ensure parent, parent methods are existing and contains the same number of expressions */
7474
final PhpClass parent = OpenapiResolveUtil.resolveSuperClass(clazz);
7575
final Method parentMethod = null == parent ? null : OpenapiResolveUtil.resolveMethod(parent, method.getName());
7676
if (parentMethod == null || parentMethod.isAbstract() || parentMethod.isDeprecated() || parentMethod.getModifier().isPrivate()) {

src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessProxyMethodInspector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public void visitPhpClass(@NotNull PhpClass clazz) {
123123
final Method nestedMethod = (Method) referenceResolved;
124124
final Parameter[] parentParameters = nestedMethod.getParameters();
125125

126-
/* verify amount of parameters, visibility, static, abstract, final */
126+
/* verify number of parameters, visibility, static, abstract, final */
127127
if (
128128
parentParameters.length == methodParameters.length &&
129129
nestedMethod.isAbstract() == method.isAbstract() &&

src/main/java/com/kalessil/phpStorm/phpInspectionsEA/openApi/BasePhpElementVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void visitPhpDocTag(@NotNull PhpDocTag tag)
4949
public void visitPhpShellCommand(@NotNull PhpShellCommandExpression expression) {}
5050
public void visitPhpThrowExpression(@NotNull PhpThrowExpression expression) {}
5151

52-
/* overrides to reduce amount of 'com.jetbrains.php.lang.psi.visitors.PhpElementVisitor.visitElement' calls */
52+
/* overrides to reduce number of 'com.jetbrains.php.lang.psi.visitors.PhpElementVisitor.visitElement' calls */
5353
@Override public void visitPhpFile(PhpFile PhpFile) {}
5454
@Override public void visitWhiteSpace(PsiWhiteSpace space) {}
5555

testData/fixtures/api/cascade-dirname.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
<warning descr="[EA] 'dirname(__DIR__, 3)' can be used instead (reduces amount of calls).">dirname(dirname(dirname(__DIR__)))</warning>;
4-
<warning descr="[EA] 'dirname(trim(__DIR__), 3)' can be used instead (reduces amount of calls).">dirname(dirname(dirname(trim(__DIR__))))</warning>;
5-
<warning descr="[EA] 'dirname(__DIR__, 1 + $level)' can be used instead (reduces amount of calls).">dirname(dirname(__DIR__, $level))</warning>;
6-
<warning descr="[EA] 'dirname(__DIR__, 3)' can be used instead (reduces amount of calls).">dirname(dirname(__DIR__, 1), 2)</warning>;
3+
<warning descr="[EA] 'dirname(__DIR__, 3)' can be used instead (reduces number of calls).">dirname(dirname(dirname(__DIR__)))</warning>;
4+
<warning descr="[EA] 'dirname(trim(__DIR__), 3)' can be used instead (reduces number of calls).">dirname(dirname(dirname(trim(__DIR__))))</warning>;
5+
<warning descr="[EA] 'dirname(__DIR__, 1 + $level)' can be used instead (reduces number of calls).">dirname(dirname(__DIR__, $level))</warning>;
6+
<warning descr="[EA] 'dirname(__DIR__, 3)' can be used instead (reduces number of calls).">dirname(dirname(__DIR__, 1), 2)</warning>;
77

88
/* false-positives */
99
dirname(realpath(__DIR__), 2);

testData/fixtures/api/printf-scanf.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ public function check($arg, $handle) {
1111
$pattern6 = '%*s %s';
1212

1313
/* all function reported */
14-
echo <error descr="[EA] Amount of expected parameters is 3.">printf</error> ($pattern4, $arg);
15-
echo <error descr="[EA] Amount of expected parameters is 3.">sprintf</error> ($pattern4, $arg);
16-
echo <error descr="[EA] Amount of expected parameters is 4.">fprintf</error> ($handle, $pattern4, $arg);
17-
echo <error descr="[EA] Amount of expected parameters is 4.">sscanf</error> ($arg, $pattern4, $arg);
18-
echo <error descr="[EA] Amount of expected parameters is 4.">fscanf</error> ($handle, $pattern4, $arg);
14+
echo <error descr="[EA] Number of expected parameters is 3.">printf</error> ($pattern4, $arg);
15+
echo <error descr="[EA] Number of expected parameters is 3.">sprintf</error> ($pattern4, $arg);
16+
echo <error descr="[EA] Number of expected parameters is 4.">fprintf</error> ($handle, $pattern4, $arg);
17+
echo <error descr="[EA] Number of expected parameters is 4.">sscanf</error> ($arg, $pattern4, $arg);
18+
echo <error descr="[EA] Number of expected parameters is 4.">fscanf</error> ($handle, $pattern4, $arg);
1919

2020
/* sscanf/fscanf with partially provided containers */
21-
list($first, $second) = <error descr="[EA] Amount of expected parameters is 4.">sscanf</error> ($arg, $pattern4, $first);
22-
list($first, $second) = <error descr="[EA] Amount of expected parameters is 4.">fscanf</error> ($handle, $pattern4, $first);
21+
list($first, $second) = <error descr="[EA] Number of expected parameters is 4.">sscanf</error> ($arg, $pattern4, $first);
22+
list($first, $second) = <error descr="[EA] Number of expected parameters is 4.">fscanf</error> ($handle, $pattern4, $first);
2323

2424
/* test resolving string literal */
25-
echo <error descr="[EA] Amount of expected parameters is 3.">sprintf</error> (self::PATTERN1, $arg);
26-
echo <error descr="[EA] Amount of expected parameters is 3.">sprintf</error> (self::$pattern2, $arg);
27-
echo <error descr="[EA] Amount of expected parameters is 3.">sprintf</error> ($this->pattern3, $arg);
25+
echo <error descr="[EA] Number of expected parameters is 3.">sprintf</error> (self::PATTERN1, $arg);
26+
echo <error descr="[EA] Number of expected parameters is 3.">sprintf</error> (self::$pattern2, $arg);
27+
echo <error descr="[EA] Number of expected parameters is 3.">sprintf</error> ($this->pattern3, $arg);
2828
echo sprintf(<error descr="[EA] Pattern seems to be not valid.">'%'</error>, $arg);
2929

3030

testData/fixtures/lang/variable-functions-php53.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/*
44
TODO: (configurable) call_user_func's first parameter validation
5-
TODO: (configurable) amount of arguments validation for resolved methods/functions
5+
TODO: (configurable) number of arguments validation for resolved methods/functions
66
*/
77

88
class ClassVFParent {

0 commit comments

Comments
 (0)