diff --git a/.travis/verify-discovered-values-cleanup.php b/.travis/verify-discovered-values-cleanup.php index 2b2d212310..9b51253557 100644 --- a/.travis/verify-discovered-values-cleanup.php +++ b/.travis/verify-discovered-values-cleanup.php @@ -10,7 +10,7 @@ $fileContent = file_get_contents($file->getPathname()); preg_match_all('/([ ]+)(final[ ]+)?[a-z<>]+[ ]+([a-z]+)[ ]+=\s+PossibleValuesDiscoveryUtil\s*\.\s*discover\(/ims', $fileContent, $discovery); if ($discovery[0] !== []) { - /* match amount of calls */ + /* match number of calls */ preg_match_all('/([ ]+)('.implode('|', $discovery[3]).')\.clear\(/ims', $fileContent, $clearing); if (count($discovery[0]) !== count($clearing[0])) { $missingClear []= $file->getFilename(); diff --git a/docs/control-flow.md b/docs/control-flow.md index c43123b55b..1815241e90 100644 --- a/docs/control-flow.md +++ b/docs/control-flow.md @@ -77,7 +77,7 @@ Php Inspections (EA Extended) friendly way: ## If-return-return could be simplified The inspection finds places where conditional return-statements can be simplified (by Quick-Fixing), reducing code -complexity metrics and amount of maintainable codebase. +complexity metrics and size of maintainable codebase. ```php /* before */ diff --git a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/PrintfScanfArgumentsInspector.java b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/PrintfScanfArgumentsInspector.java index e123949b93..8fa185154b 100644 --- a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/PrintfScanfArgumentsInspector.java +++ b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/PrintfScanfArgumentsInspector.java @@ -32,7 +32,7 @@ public class PrintfScanfArgumentsInspector extends BasePhpInspection { private static final String messagePattern = "Pattern seems to be not valid."; - private static final String messageParameters = "Amount of expected parameters is %c%."; + private static final String messageParameters = "Number of expected parameters is %c%."; @NotNull @Override diff --git a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/debug/ForgottenDebugOutputInspector.java b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/debug/ForgottenDebugOutputInspector.java index 56b19fc13a..9db9bb6d56 100644 --- a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/debug/ForgottenDebugOutputInspector.java +++ b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/debug/ForgottenDebugOutputInspector.java @@ -185,7 +185,7 @@ public String getDisplayName() { private static final Map functionsRequirements = new HashMap<>(); static { - /* function name => amount of arguments considered legal */ + /* function name => number of arguments considered legal */ functionsRequirements.put("debug_print_backtrace", -1); functionsRequirements.put("debug_zval_dump", -1); functionsRequirements.put("phpinfo", 1); diff --git a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/fileSystem/CascadingDirnameCallsInspector.java b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/fileSystem/CascadingDirnameCallsInspector.java index a2d621b905..ab40ee6deb 100644 --- a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/fileSystem/CascadingDirnameCallsInspector.java +++ b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/apiUsage/fileSystem/CascadingDirnameCallsInspector.java @@ -29,7 +29,7 @@ */ public class CascadingDirnameCallsInspector extends BasePhpInspection { - private static final String messagePattern = "'%e%' can be used instead (reduces amount of calls)."; + private static final String messagePattern = "'%e%' can be used instead (reduces number of calls)."; @NotNull @Override diff --git a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessMethodDuplicationInspector.java b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessMethodDuplicationInspector.java index bec08cc3df..f4636489ea 100644 --- a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessMethodDuplicationInspector.java +++ b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessMethodDuplicationInspector.java @@ -70,7 +70,7 @@ public void visitPhpMethod(@NotNull Method method) { return; } - /* ensure parent, parent methods are existing and contains the same amount of expressions */ + /* ensure parent, parent methods are existing and contains the same number of expressions */ final PhpClass parent = OpenapiResolveUtil.resolveSuperClass(clazz); final Method parentMethod = null == parent ? null : OpenapiResolveUtil.resolveMethod(parent, method.getName()); if (parentMethod == null || parentMethod.isAbstract() || parentMethod.isDeprecated() || parentMethod.getModifier().isPrivate()) { diff --git a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessProxyMethodInspector.java b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessProxyMethodInspector.java index 70103f6e8d..e05d913275 100644 --- a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessProxyMethodInspector.java +++ b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/inspectors/semanticalAnalysis/classes/SenselessProxyMethodInspector.java @@ -123,7 +123,7 @@ public void visitPhpClass(@NotNull PhpClass clazz) { final Method nestedMethod = (Method) referenceResolved; final Parameter[] parentParameters = nestedMethod.getParameters(); - /* verify amount of parameters, visibility, static, abstract, final */ + /* verify number of parameters, visibility, static, abstract, final */ if ( parentParameters.length == methodParameters.length && nestedMethod.isAbstract() == method.isAbstract() && diff --git a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/openApi/BasePhpElementVisitor.java b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/openApi/BasePhpElementVisitor.java index e521ff003e..37314d79b0 100644 --- a/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/openApi/BasePhpElementVisitor.java +++ b/src/main/java/com/kalessil/phpStorm/phpInspectionsEA/openApi/BasePhpElementVisitor.java @@ -49,7 +49,7 @@ public void visitPhpDocTag(@NotNull PhpDocTag tag) public void visitPhpShellCommand(@NotNull PhpShellCommandExpression expression) {} public void visitPhpThrowExpression(@NotNull PhpThrowExpression expression) {} - /* overrides to reduce amount of 'com.jetbrains.php.lang.psi.visitors.PhpElementVisitor.visitElement' calls */ + /* overrides to reduce number of 'com.jetbrains.php.lang.psi.visitors.PhpElementVisitor.visitElement' calls */ @Override public void visitPhpFile(PhpFile PhpFile) {} @Override public void visitWhiteSpace(PsiWhiteSpace space) {} diff --git a/testData/fixtures/api/cascade-dirname.php b/testData/fixtures/api/cascade-dirname.php index 1658f13b79..750a0eedb0 100644 --- a/testData/fixtures/api/cascade-dirname.php +++ b/testData/fixtures/api/cascade-dirname.php @@ -1,9 +1,9 @@ dirname(dirname(dirname(__DIR__))); - dirname(dirname(dirname(trim(__DIR__)))); - dirname(dirname(__DIR__, $level)); - dirname(dirname(__DIR__, 1), 2); + dirname(dirname(dirname(__DIR__))); + dirname(dirname(dirname(trim(__DIR__)))); + dirname(dirname(__DIR__, $level)); + dirname(dirname(__DIR__, 1), 2); /* false-positives */ dirname(realpath(__DIR__), 2); diff --git a/testData/fixtures/api/printf-scanf.php b/testData/fixtures/api/printf-scanf.php index 71795c61c7..6da4aafffe 100644 --- a/testData/fixtures/api/printf-scanf.php +++ b/testData/fixtures/api/printf-scanf.php @@ -11,20 +11,20 @@ public function check($arg, $handle) { $pattern6 = '%*s %s'; /* all function reported */ - echo printf ($pattern4, $arg); - echo sprintf ($pattern4, $arg); - echo fprintf ($handle, $pattern4, $arg); - echo sscanf ($arg, $pattern4, $arg); - echo fscanf ($handle, $pattern4, $arg); + echo printf ($pattern4, $arg); + echo sprintf ($pattern4, $arg); + echo fprintf ($handle, $pattern4, $arg); + echo sscanf ($arg, $pattern4, $arg); + echo fscanf ($handle, $pattern4, $arg); /* sscanf/fscanf with partially provided containers */ - list($first, $second) = sscanf ($arg, $pattern4, $first); - list($first, $second) = fscanf ($handle, $pattern4, $first); + list($first, $second) = sscanf ($arg, $pattern4, $first); + list($first, $second) = fscanf ($handle, $pattern4, $first); /* test resolving string literal */ - echo sprintf (self::PATTERN1, $arg); - echo sprintf (self::$pattern2, $arg); - echo sprintf ($this->pattern3, $arg); + echo sprintf (self::PATTERN1, $arg); + echo sprintf (self::$pattern2, $arg); + echo sprintf ($this->pattern3, $arg); echo sprintf('%', $arg); diff --git a/testData/fixtures/lang/variable-functions-php53.php b/testData/fixtures/lang/variable-functions-php53.php index 0217813df1..b1155848f6 100644 --- a/testData/fixtures/lang/variable-functions-php53.php +++ b/testData/fixtures/lang/variable-functions-php53.php @@ -2,7 +2,7 @@ /* TODO: (configurable) call_user_func's first parameter validation - TODO: (configurable) amount of arguments validation for resolved methods/functions + TODO: (configurable) number of arguments validation for resolved methods/functions */ class ClassVFParent {