Merge branch 'stweil-typos'

This commit is contained in:
Dmitriy Simushev 2016-06-02 12:09:21 +00:00
commit 199438285c
6 changed files with 18 additions and 18 deletions

View File

@ -51,7 +51,7 @@
app.Invitation.start(options.invitationOptions); app.Invitation.start(options.invitationOptions);
break; break;
default: default:
throw new Error('Dont know how to start!'); throw new Error("Don't know how to start!");
break; break;
} }
}); });
@ -61,4 +61,4 @@
Mibew.Objects.server.runUpdater(); Mibew.Objects.server.runUpdater();
}); });
})(Mibew, _); })(Mibew, _);

View File

@ -185,7 +185,7 @@ MibewAPI.prototype.checkPackage = function (packageObject) {
* *
* @param {Object[]} functionsList Array of functions. See MibewAPI for * @param {Object[]} functionsList Array of functions. See MibewAPI for
* function structure details * 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 * 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 * must exists in request, boolean false if must not and null if it doesn't
* matter. * matter.
@ -193,9 +193,9 @@ MibewAPI.prototype.checkPackage = function (packageObject) {
* null otherwise * null otherwise
* @throws Error * @throws Error
*/ */
MibewAPI.prototype.getResultFunction = function(functionsList, existance){ MibewAPI.prototype.getResultFunction = function(functionsList, existence){
if (typeof existance == "undefined") { if (typeof existence == "undefined") {
existance = null; existence = null;
} }
var resultFunction = null; var resultFunction = null;
// Try to find result function // Try to find result function
@ -214,11 +214,11 @@ MibewAPI.prototype.getResultFunction = function(functionsList, existance){
resultFunction = functionsList[i]; resultFunction = functionsList[i];
} }
} }
if (existance === true && resultFunction === null) { if (existence === true && resultFunction === null) {
// 'result' function must present in request // 'result' function must present in request
throw new Error("There is no 'result' function in functions list"); 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"); throw new Error("There is 'result' function in functions list");
} }
return resultFunction; return resultFunction;

View File

@ -288,7 +288,7 @@ class API
* *
* @param array $functions_list Array of functions. See Mibew API * @param array $functions_list Array of functions. See Mibew API
* specification for function structure details. * 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, * request. Use boolean true if 'result' function must exists in request,
* boolean false if must not and null if it doesn't matter. * boolean false if must not and null if it doesn't matter.
* @return mixed Function array if 'result' function found and NULL * @return mixed Function array if 'result' function found and NULL

View File

@ -152,7 +152,7 @@ class CacheFactory
// Convert structure from the "memcached_servers" option to the // Convert structure from the "memcached_servers" option to the
// form used in cache driver. // form used in cache driver.
$formated_servers = array_map(function ($server) { $formatted_servers = array_map(function ($server) {
return array( return array(
$server['host'], $server['host'],
intval($server['port']), intval($server['port']),
@ -162,7 +162,7 @@ class CacheFactory
$driver = new MemcacheDriver(); $driver = new MemcacheDriver();
$driver->setOptions(array( $driver->setOptions(array(
'servers' => $formated_servers, 'servers' => $formatted_servers,
// Use only PHP's "memcached" extension. // Use only PHP's "memcached" extension.
'extension' => 'memcached' 'extension' => 'memcached'
)); ));

View File

@ -84,7 +84,7 @@ class Utils
public static function getPluginClassName($plugin_name) public static function getPluginClassName($plugin_name)
{ {
if (!self::isValidPluginName($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); list($vendor, $short_name) = explode(':', $plugin_name, 2);

View File

@ -425,7 +425,7 @@ test("getResult", function() {
} }
// Try to get 'result' function from functions list that have no 'result' // 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 { try {
mibewAPI.getResultFunction({}, true); mibewAPI.getResultFunction({}, true);
} catch (e) { } catch (e) {
@ -437,25 +437,25 @@ test("getResult", function() {
} }
// Try to get 'result' function from functions list that have no 'result' // 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( equal(
mibewAPI.getResultFunction({}, false), mibewAPI.getResultFunction({}, false),
null, 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" "argument equals to false and null as the result functionon returned"
); );
// Try to get 'result' function from functions list that have no 'result' // 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( equal(
mibewAPI.getResultFunction({}, null), mibewAPI.getResultFunction({}, null),
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" "argument equals to null and null as the result functionon returned"
); );
// Try to get 'result' function from functions list that have 'result' // Try to get 'result' function from functions list that have 'result'
// function. 'existance' argument set to false // function. 'existence' argument set to false
try { try {
mibewAPI.getResultFunction([ mibewAPI.getResultFunction([
{"function" : "result"} {"function" : "result"}