From a149731c46ad46620d069480c4867ef524375ca3 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 27 Sep 2015 13:50:39 +0200 Subject: [PATCH] Fix some typos in variable names and strings Most of them were found by codespell. Signed-off-by: Stefan Weil --- src/mibew/js/source/chat/app.js | 4 ++-- src/mibew/js/source/mibewapi.js | 12 ++++++------ src/mibew/libs/classes/Mibew/API/API.php | 2 +- src/mibew/libs/classes/Mibew/Cache/CacheFactory.php | 4 ++-- src/mibew/libs/classes/Mibew/Plugin/Utils.php | 2 +- .../client_side/qunit/test_cases/mibewapi_tests.js | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/mibew/js/source/chat/app.js b/src/mibew/js/source/chat/app.js index e567a316..ea7ace5f 100644 --- a/src/mibew/js/source/chat/app.js +++ b/src/mibew/js/source/chat/app.js @@ -51,7 +51,7 @@ app.Invitation.start(options.invitationOptions); break; default: - throw new Error('Dont know how to start!'); + throw new Error("Don't know how to start!"); break; } }); @@ -61,4 +61,4 @@ Mibew.Objects.server.runUpdater(); }); -})(Mibew, _); \ No newline at end of file +})(Mibew, _); diff --git a/src/mibew/js/source/mibewapi.js b/src/mibew/js/source/mibewapi.js index a4f36eb1..7b6818b1 100644 --- a/src/mibew/js/source/mibewapi.js +++ b/src/mibew/js/source/mibewapi.js @@ -185,7 +185,7 @@ MibewAPI.prototype.checkPackage = function (packageObject) { * * @param {Object[]} functionsList Array of functions. See MibewAPI for * function structure details - * @param {Boolean|null} [existance="null"] (optional) Control existance of + * @param {Boolean|null} [existence="null"] (optional) Control existence of * the 'result' function in request. Use boolean true if 'result' function * must exists in request, boolean false if must not and null if it doesn't * matter. @@ -193,9 +193,9 @@ MibewAPI.prototype.checkPackage = function (packageObject) { * null otherwise * @throws Error */ -MibewAPI.prototype.getResultFunction = function(functionsList, existance){ - if (typeof existance == "undefined") { - existance = null; +MibewAPI.prototype.getResultFunction = function(functionsList, existence){ + if (typeof existence == "undefined") { + existence = null; } var resultFunction = null; // Try to find result function @@ -214,11 +214,11 @@ MibewAPI.prototype.getResultFunction = function(functionsList, existance){ resultFunction = functionsList[i]; } } - if (existance === true && resultFunction === null) { + if (existence === true && resultFunction === null) { // 'result' function must present in request throw new Error("There is no 'result' function in functions list"); } - if (existance === false && resultFunction !== null) { + if (existence === false && resultFunction !== null) { throw new Error("There is 'result' function in functions list"); } return resultFunction; diff --git a/src/mibew/libs/classes/Mibew/API/API.php b/src/mibew/libs/classes/Mibew/API/API.php index d0cf1cf3..76aec366 100644 --- a/src/mibew/libs/classes/Mibew/API/API.php +++ b/src/mibew/libs/classes/Mibew/API/API.php @@ -288,7 +288,7 @@ class API * * @param array $functions_list Array of functions. See Mibew API * specification for function structure details. - * @param mixed $existance Control existance of the 'result' function in + * @param mixed $existence Control existence of the 'result' function in * request. Use boolean true if 'result' function must exists in request, * boolean false if must not and null if it doesn't matter. * @return mixed Function array if 'result' function found and NULL diff --git a/src/mibew/libs/classes/Mibew/Cache/CacheFactory.php b/src/mibew/libs/classes/Mibew/Cache/CacheFactory.php index 9c576fdf..b0658718 100644 --- a/src/mibew/libs/classes/Mibew/Cache/CacheFactory.php +++ b/src/mibew/libs/classes/Mibew/Cache/CacheFactory.php @@ -152,7 +152,7 @@ class CacheFactory // Convert structure from the "memcached_servers" option to the // form used in cache driver. - $formated_servers = array_map(function ($server) { + $formatted_servers = array_map(function ($server) { return array( $server['host'], intval($server['port']), @@ -162,7 +162,7 @@ class CacheFactory $driver = new MemcacheDriver(); $driver->setOptions(array( - 'servers' => $formated_servers, + 'servers' => $formatted_servers, // Use only PHP's "memcached" extension. 'extension' => 'memcached' )); diff --git a/src/mibew/libs/classes/Mibew/Plugin/Utils.php b/src/mibew/libs/classes/Mibew/Plugin/Utils.php index 88481385..c18dd1c7 100644 --- a/src/mibew/libs/classes/Mibew/Plugin/Utils.php +++ b/src/mibew/libs/classes/Mibew/Plugin/Utils.php @@ -84,7 +84,7 @@ class Utils public static function getPluginClassName($plugin_name) { if (!self::isValidPluginName($plugin_name)) { - throw new \InvalidArgumentException('Wrong formated plugin name'); + throw new \InvalidArgumentException('Wrong formatted plugin name'); } list($vendor, $short_name) = explode(':', $plugin_name, 2); diff --git a/src/tests/client_side/qunit/test_cases/mibewapi_tests.js b/src/tests/client_side/qunit/test_cases/mibewapi_tests.js index 2611e394..0aa00e99 100644 --- a/src/tests/client_side/qunit/test_cases/mibewapi_tests.js +++ b/src/tests/client_side/qunit/test_cases/mibewapi_tests.js @@ -425,7 +425,7 @@ test("getResult", function() { } // Try to get 'result' function from functions list that have no 'result' - // function. 'existance' argument set to true + // function. 'existence' argument set to true try { mibewAPI.getResultFunction({}, true); } catch (e) { @@ -437,25 +437,25 @@ test("getResult", function() { } // Try to get 'result' function from functions list that have no 'result' - // function. 'existance' argument set to false + // function. 'existence' argument set to false equal( mibewAPI.getResultFunction({}, false), null, - "Test with no 'result' function in functions list, 'existance' " + + "Test with no 'result' function in functions list, 'existence' " + "argument equals to false and null as the result functionon returned" ); // Try to get 'result' function from functions list that have no 'result' - // function. 'existance' argument set to null + // function. 'existence' argument set to null equal( mibewAPI.getResultFunction({}, null), null, - "Test with no 'result' function in functions list, 'existance' " + + "Test with no 'result' function in functions list, 'existence' " + "argument equals to null and null as the result functionon returned" ); // Try to get 'result' function from functions list that have 'result' - // function. 'existance' argument set to false + // function. 'existence' argument set to false try { mibewAPI.getResultFunction([ {"function" : "result"}