aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php25
-rw-r--r--phpBB/assets/javascript/core.js2
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php1
3 files changed, 16 insertions, 12 deletions
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
index 16e3427bd9..f81ec46579 100644
--- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
@@ -153,19 +153,24 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
$start_argument = $phpcsFile->findPrevious(array(T_OPEN_PARENTHESIS, T_COMMA), $argument);
$argument_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($start_argument + 1), $argument);
- $argument_class_name_end = $phpcsFile->findNext($find, ($argument_class_name_start + 1), null, true);
- $argument_class_name = $phpcsFile->getTokensAsString($argument_class_name_start, ($argument_class_name_end - $argument_class_name_start - 1));
-
- if ($argument_class_name === $class_name_full)
+ // Skip the parameter if no type is defined.
+ if ($argument_class_name_start !== false)
{
- $error = 'Either use statement or full name must be used.';
- $phpcsFile->addError($error, $function_declaration, 'FullName');
- }
+ $argument_class_name_end = $phpcsFile->findNext($find, ($argument_class_name_start + 1), null, true);
- if ($argument_class_name === $class_name_short)
- {
- $ok = true;
+ $argument_class_name = $phpcsFile->getTokensAsString($argument_class_name_start, ($argument_class_name_end - $argument_class_name_start - 1));
+
+ if ($argument_class_name === $class_name_full)
+ {
+ $error = 'Either use statement or full name must be used.';
+ $phpcsFile->addError($error, $function_declaration, 'FullName');
+ }
+
+ if ($argument_class_name === $class_name_short)
+ {
+ $ok = true;
+ }
}
}
}
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 2c35875dca..b905c4c82d 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -272,7 +272,7 @@ phpbb.ajaxify = function(options) {
* Handler for AJAX errors
*/
function errorHandler(jqXHR, textStatus, errorThrown) {
- if (console && console.log) {
+ if (typeof console !== 'undefined' && console.log) {
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
}
phpbb.clearLoadingTimeout();
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index ade1bf6e23..dee70ad016 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -148,7 +148,6 @@ class phpbb_test_case_helpers
{
$config_php_file->set_config_file($test_config);
extract($config_php_file->get_all());
- unset($dbpasswd);
$config = array_merge($config, array(
'dbms' => $config_php_file->convert_30_dbms_to_31($dbms),