From ce5cbaa850b1c67bc0b9bdb0f70f7c6248b264e8 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 27 Sep 2015 13:48:00 +0200 Subject: [PATCH] Fix some typos in comments (most of them found by codespell) Fix also an error string in Updater.php. Signed-off-by: Stefan Weil --- src/mibew/js/source/default/handlebars_helpers.js | 2 +- src/mibew/js/source/users/collections/threads.js | 2 +- src/mibew/js/source/users/models/queued_thread.js | 2 +- src/mibew/js/source/widget.js | 2 +- src/mibew/libs/chat.php | 2 +- src/mibew/libs/classes/Mibew/Application.php | 2 +- src/mibew/libs/classes/Mibew/Asset/Package.php | 2 +- .../Mibew/Controller/Chat/AbstractController.php | 2 +- .../classes/Mibew/Controller/InstallController.php | 2 +- .../Localization/JsTranslationController.php | 2 +- src/mibew/libs/classes/Mibew/Database.php | 7 ++++--- .../libs/classes/Mibew/EventDispatcher/Events.php | 2 +- .../libs/classes/Mibew/Maintenance/CronWorker.php | 2 +- src/mibew/libs/classes/Mibew/Maintenance/Installer.php | 4 ++-- .../libs/classes/Mibew/Maintenance/UpdateChecker.php | 4 ++-- src/mibew/libs/classes/Mibew/Maintenance/Updater.php | 4 ++-- .../libs/classes/Mibew/Plugin/DependencyGraph.php | 2 +- .../Mibew/RequestProcessor/AbstractProcessor.php | 4 ++-- .../classes/Mibew/RequestProcessor/ThreadProcessor.php | 2 +- src/mibew/libs/classes/Mibew/Thread.php | 6 +++--- src/mibew/libs/common/configurations.php | 2 +- src/mibew/libs/common/locale.php | 2 +- src/mibew/libs/invitation.php | 2 +- src/mibew/libs/pagination.php | 2 +- src/mibew/styles/chats/default/config.yml | 4 ++-- src/mibew/styles/chats/default/js/source/resize.js | 2 +- src/mibew/styles/invitations/default/config.yml | 4 ++-- src/mibew/styles/pages/default/config.yml | 4 ++-- src/tests/client_side/qunit/qunit.js | 10 +++++----- 29 files changed, 45 insertions(+), 44 deletions(-) diff --git a/src/mibew/js/source/default/handlebars_helpers.js b/src/mibew/js/source/default/handlebars_helpers.js index 063f0f26..7e98cb17 100644 --- a/src/mibew/js/source/default/handlebars_helpers.js +++ b/src/mibew/js/source/default/handlebars_helpers.js @@ -290,7 +290,7 @@ * */ Handlebars.registerHelper('override', function(name, options) { - // We need to provide unlimited inheritence level. Rendering is started + // We need to provide unlimited inheritance level. Rendering is started // from the deepest level template. If the content is in the block // storage it is related with the deepest level template. Thus we do not // need to override it. diff --git a/src/mibew/js/source/users/collections/threads.js b/src/mibew/js/source/users/collections/threads.js index 7f47d254..8765c630 100644 --- a/src/mibew/js/source/users/collections/threads.js +++ b/src/mibew/js/source/users/collections/threads.js @@ -37,7 +37,7 @@ // Initialize fields and methods /** - * Last threads revision number. Prevent transfering not + * Last threads revision number. Prevent transferring not * modified threads. * @type Number * @fieldOf Mibew.Collections.Threads diff --git a/src/mibew/js/source/users/models/queued_thread.js b/src/mibew/js/source/users/models/queued_thread.js index 5e36fab6..e66cf9fa 100644 --- a/src/mibew/js/source/users/models/queued_thread.js +++ b/src/mibew/js/source/users/models/queued_thread.js @@ -25,7 +25,7 @@ var controlsConstructors = []; /** - * Prepresent thread in users queue + * Represent thread in users queue * @class */ var QueuedThread = Mibew.Models.QueuedThread = Mibew.Models.Thread.extend( diff --git a/src/mibew/js/source/widget.js b/src/mibew/js/source/widget.js index 0eba7a7c..7583b8d0 100644 --- a/src/mibew/js/source/widget.js +++ b/src/mibew/js/source/widget.js @@ -215,7 +215,7 @@ var Mibew = Mibew || {}; } } - // Process all recieved handlers. Run handler if all dependencies loaded + // Process all received handlers. Run handler if all dependencies loaded // and add it to handlers list otherwise. for (var i = 0; i < handlers.length; i++) { // Create shortcuts diff --git a/src/mibew/libs/chat.php b/src/mibew/libs/chat.php index 12431eb3..b7b24933 100644 --- a/src/mibew/libs/chat.php +++ b/src/mibew/libs/chat.php @@ -28,7 +28,7 @@ use Mibew\Routing\Generator\SecureUrlGeneratorInterface as UrlGeneratorInterface use Symfony\Component\HttpFoundation\Request; /** - * Convert messages to formated text + * Convert messages to formatted text * * @param array $msg message object which most be formatted * diff --git a/src/mibew/libs/classes/Mibew/Application.php b/src/mibew/libs/classes/Mibew/Application.php index 9fca1adb..faa543cc 100644 --- a/src/mibew/libs/classes/Mibew/Application.php +++ b/src/mibew/libs/classes/Mibew/Application.php @@ -106,7 +106,7 @@ class Application implements } /** - * Handles incomming request. + * Handles incoming request. * * @param Request $request Incoming request * @return Response Resulting response diff --git a/src/mibew/libs/classes/Mibew/Asset/Package.php b/src/mibew/libs/classes/Mibew/Asset/Package.php index 1eea64c1..e7042d35 100644 --- a/src/mibew/libs/classes/Mibew/Asset/Package.php +++ b/src/mibew/libs/classes/Mibew/Asset/Package.php @@ -25,7 +25,7 @@ namespace Mibew\Asset; class Package { /** - * Indicates that assets sould not be sorted. + * Indicates that assets should not be sorted. */ const SORT_NONE = 'none'; /** diff --git a/src/mibew/libs/classes/Mibew/Controller/Chat/AbstractController.php b/src/mibew/libs/classes/Mibew/Controller/Chat/AbstractController.php index b64113f8..5e2d1f97 100644 --- a/src/mibew/libs/classes/Mibew/Controller/Chat/AbstractController.php +++ b/src/mibew/libs/classes/Mibew/Controller/Chat/AbstractController.php @@ -72,7 +72,7 @@ abstract class AbstractController extends BaseAbstractController /** * Generates JavaScript code that starts client side application. * - * @param Request $request Incomming request. + * @param Request $request Incoming request. * @param array $options Client side application options. At the moment the * method accepts the following options: * - "company": array, a set of company info. See {@link setup_logo()} diff --git a/src/mibew/libs/classes/Mibew/Controller/InstallController.php b/src/mibew/libs/classes/Mibew/Controller/InstallController.php index 5e139a25..ca4b8dcd 100644 --- a/src/mibew/libs/classes/Mibew/Controller/InstallController.php +++ b/src/mibew/libs/classes/Mibew/Controller/InstallController.php @@ -294,7 +294,7 @@ class InstallController extends AbstractController // The installation has been finished (or had not been started yet) // We should prevent access to this action but cannot use Access // Check functionallity becase the user should be redirected to the - // beginnig. + // beginning. return $this->redirect($this->generateUrl('install')); } diff --git a/src/mibew/libs/classes/Mibew/Controller/Localization/JsTranslationController.php b/src/mibew/libs/classes/Mibew/Controller/Localization/JsTranslationController.php index 21a9e97c..8ea6cd3c 100644 --- a/src/mibew/libs/classes/Mibew/Controller/Localization/JsTranslationController.php +++ b/src/mibew/libs/classes/Mibew/Controller/Localization/JsTranslationController.php @@ -66,7 +66,7 @@ class JsTranslationController extends AbstractController header_remove(); // The whole response body (JSON-encoded with a callback function) is - // cached via cache backend, thus it's simplier to use Symfony's + // cached via cache backend, thus it's simpler to use Symfony's // Response class instead of JsonResponse. $response = new Response(); $response->headers->set('Content-Type', 'text/javascript'); diff --git a/src/mibew/libs/classes/Mibew/Database.php b/src/mibew/libs/classes/Mibew/Database.php index 77bee3ef..a8440df9 100644 --- a/src/mibew/libs/classes/Mibew/Database.php +++ b/src/mibew/libs/classes/Mibew/Database.php @@ -107,8 +107,9 @@ class Database * Get instance of Database class. * * If no instance exists, creates new instance. - * Use Database::initialize() before try to get an instance. If database - * was not initilize coorectly triggers an error with E_USER_ERROR level. + * Use Database::initialize() before trying to get an instance. + * If database was not initialized correctly triggers an error + * with E_USER_ERROR level. * * @return Database * @see Database::initialize() @@ -274,7 +275,7 @@ class Database * @param array $params Array of query parameters. It can contains values * with following keys: * - 'return_rows' control if rows must be returned and how many rows must - * be returnd. The value can be Database::RETURN_ONE_ROW for olny one + * be returned. The value can be Database::RETURN_ONE_ROW for only one * row or Database::RETURN_ALL_ROWS for all rows. If this key not * specified, the function will not return any rows. * - 'fetch_type' control indexes in resulting rows. The value can be diff --git a/src/mibew/libs/classes/Mibew/EventDispatcher/Events.php b/src/mibew/libs/classes/Mibew/EventDispatcher/Events.php index 7830073b..1dc43244 100644 --- a/src/mibew/libs/classes/Mibew/EventDispatcher/Events.php +++ b/src/mibew/libs/classes/Mibew/EventDispatcher/Events.php @@ -550,7 +550,7 @@ final class Events * {@link \Symfony\Component\HttpFoundation\Request} which represents * incoming request. * - "response": array, set of data that will be sent to the widget. See - * description of its stucture and use case below. + * description of its structure and use case below. * - "route_url_generator": an instance of * {@link \Mibew\Routing\Generator\SecureUrlGeneratorInterface}. * - "asset_url_generator": an instance of diff --git a/src/mibew/libs/classes/Mibew/Maintenance/CronWorker.php b/src/mibew/libs/classes/Mibew/Maintenance/CronWorker.php index 731754ee..8765d63e 100644 --- a/src/mibew/libs/classes/Mibew/Maintenance/CronWorker.php +++ b/src/mibew/libs/classes/Mibew/Maintenance/CronWorker.php @@ -120,7 +120,7 @@ class CronWorker } /** - * Retuns list of all errors that took place during running periodical + * Returns list of all errors that took place during running periodical * actions. * * @return string[] diff --git a/src/mibew/libs/classes/Mibew/Maintenance/Installer.php b/src/mibew/libs/classes/Mibew/Maintenance/Installer.php index 792c5c90..ed412316 100644 --- a/src/mibew/libs/classes/Mibew/Maintenance/Installer.php +++ b/src/mibew/libs/classes/Mibew/Maintenance/Installer.php @@ -72,7 +72,7 @@ class Installer } /** - * Retuns list of all errors that took place during installation process. + * Returns list of all errors that took place during installation process. * * @return string[] */ @@ -590,7 +590,7 @@ class Installer * * For example, for PHP 5.3.3 the number 50303 will be returned. * - * @return integer Verison ID. + * @return integer Version ID. */ protected function getPhpVersionId() { diff --git a/src/mibew/libs/classes/Mibew/Maintenance/UpdateChecker.php b/src/mibew/libs/classes/Mibew/Maintenance/UpdateChecker.php index 0c9d7b8f..ef320d43 100644 --- a/src/mibew/libs/classes/Mibew/Maintenance/UpdateChecker.php +++ b/src/mibew/libs/classes/Mibew/Maintenance/UpdateChecker.php @@ -159,7 +159,7 @@ class UpdateChecker } if ($response_code != 200) { - // Unexpected HTTP recieved. + // Unexpected HTTP received. $this->errors[] = sprintf( 'Update server returns %u HTTP code instead of 200', $response_code @@ -265,7 +265,7 @@ class UpdateChecker $plugins_info = $this->getPluginsInfo(); foreach ($updates['plugins'] as $plugin_name => $update) { if (!isset($plugins_info[$plugin_name])) { - // It's strange. We recieve update info for a plugin that does + // It's strange. We receive update info for a plugin that does // not exist in the system. Just do nothing. continue; } diff --git a/src/mibew/libs/classes/Mibew/Maintenance/Updater.php b/src/mibew/libs/classes/Mibew/Maintenance/Updater.php index 763a4aa3..06c17bff 100644 --- a/src/mibew/libs/classes/Mibew/Maintenance/Updater.php +++ b/src/mibew/libs/classes/Mibew/Maintenance/Updater.php @@ -71,7 +71,7 @@ class Updater } /** - * Retuns list of all errors that took place during update process. + * Returns list of all errors that took place during update process. * * @return string[] */ @@ -102,7 +102,7 @@ class Updater if (!preg_match("/^([0-9]{1,2}\.){2}[0-9]{1,2}(-(alpha|beta|rc)\.[0-9]+)?$/", $current_version)) { $this->errors[] = getlocal( - 'The current version ({0}) is unknown or wrong formated', + 'The current version ({0}) is unknown or wrongly formatted', array($current_version) ); diff --git a/src/mibew/libs/classes/Mibew/Plugin/DependencyGraph.php b/src/mibew/libs/classes/Mibew/Plugin/DependencyGraph.php index 1577207d..bf240e93 100644 --- a/src/mibew/libs/classes/Mibew/Plugin/DependencyGraph.php +++ b/src/mibew/libs/classes/Mibew/Plugin/DependencyGraph.php @@ -169,7 +169,7 @@ class DependencyGraph * dependencies and sorts the others by loading turn. * * Together with {@link \Mibew\Plugin\DependencyGraph::doSortStep()} method - * is implements topological sorting algoritm. The only deference from the + * it implements topological sorting algorithm. The only deference from the * topological sorting the results are in reverse order. * * @return PluginInfo[] diff --git a/src/mibew/libs/classes/Mibew/RequestProcessor/AbstractProcessor.php b/src/mibew/libs/classes/Mibew/RequestProcessor/AbstractProcessor.php index 7c89f6ee..0fa4b928 100644 --- a/src/mibew/libs/classes/Mibew/RequestProcessor/AbstractProcessor.php +++ b/src/mibew/libs/classes/Mibew/RequestProcessor/AbstractProcessor.php @@ -155,7 +155,7 @@ abstract class AbstractProcessor } /** - * Proccess received packages + * Process received packages * * On any error function returns only boolean false. To handle error add * listener to the "RequestError" event. @@ -392,7 +392,7 @@ abstract class AbstractProcessor * Process request * * @param array $request 'Requests' array. See Mibew API for details. - * @param mixed $result_function Control existance of the 'result' function + * @param mixed $result_function 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 array Array of requests results. diff --git a/src/mibew/libs/classes/Mibew/RequestProcessor/ThreadProcessor.php b/src/mibew/libs/classes/Mibew/RequestProcessor/ThreadProcessor.php index 810a508b..b5a3bed8 100644 --- a/src/mibew/libs/classes/Mibew/RequestProcessor/ThreadProcessor.php +++ b/src/mibew/libs/classes/Mibew/RequestProcessor/ThreadProcessor.php @@ -310,7 +310,7 @@ class ThreadProcessor extends ClientSideProcessor implements */ protected function checkFunction($function) { - // Check recipient argument existance + // Check recipient argument existence if (!array_key_exists('recipient', $function['arguments'])) { throw new ThreadProcessorException( "'recipient' argument is not set in function '{$function['function']}'!", diff --git a/src/mibew/libs/classes/Mibew/Thread.php b/src/mibew/libs/classes/Mibew/Thread.php index a3948ac2..190d7313 100644 --- a/src/mibew/libs/classes/Mibew/Thread.php +++ b/src/mibew/libs/classes/Mibew/Thread.php @@ -855,8 +855,8 @@ class Thread * * One can attach arbitrary data to the message by setting 'data' item * in the $options array. DO NOT serialize data manually - it will be - * automatically coverted to array and serialized before save in database - * and unserialized after retreive form database. + * automatically converted to array and serialized before save in database + * and unserialized after retrieve form database. * * One can also set plugin item of the $options array to indicate that * message was sent by a plugin. @@ -1070,7 +1070,7 @@ class Thread */ public function renameUser($new_name) { - // Rename only if a new name is realy new + // Rename only if a new name is really new if ($this->userName != $new_name) { // Save old name $old_name = $this->userName; diff --git a/src/mibew/libs/common/configurations.php b/src/mibew/libs/common/configurations.php index 9b705bb6..4f82beff 100644 --- a/src/mibew/libs/common/configurations.php +++ b/src/mibew/libs/common/configurations.php @@ -34,7 +34,7 @@ function load_system_configs() $parser = new YamlParser(); $configs = $parser->parse(file_get_contents(MIBEW_FS_ROOT . '/configs/config.yml')); - // Mailer configs are not necessary and can be omited but the section + // Mailer configs are not necessary and can be omitted but the section // must exist anyway. Empty statement is used to make sure null, false // and "" will be converted to an empty array. if (empty($configs['mailer'])) { diff --git a/src/mibew/libs/common/locale.php b/src/mibew/libs/common/locale.php index 0cdbf6a9..fd8b5111 100644 --- a/src/mibew/libs/common/locale.php +++ b/src/mibew/libs/common/locale.php @@ -49,7 +49,7 @@ function locale_pattern_check($locale) /** * Gets available locales list. * - * Returns a list of locales wich are exist and are enabled in the system. That + * Returns a list of locales which exist and are enabled in the system. That * list is statically cached inside the function. * * @return string[] List of available locales codes. diff --git a/src/mibew/libs/invitation.php b/src/mibew/libs/invitation.php index 4781e66e..d97c17d6 100644 --- a/src/mibew/libs/invitation.php +++ b/src/mibew/libs/invitation.php @@ -257,7 +257,7 @@ function invitation_close_old() $db = Database::getInstance(); - // Remove links beteen visitors and invitations that will be closed. + // Remove links between visitors and invitations that will be closed. $db->query( ("UPDATE {sitevisitor} v, {thread} t SET " . "v.threadid = NULL " diff --git a/src/mibew/libs/pagination.php b/src/mibew/libs/pagination.php index a4bd0dc2..825d4009 100644 --- a/src/mibew/libs/pagination.php +++ b/src/mibew/libs/pagination.php @@ -49,7 +49,7 @@ function generate_pagination_link($page, $title) * The resulting markup is a div tag with specifed class and title. * * @param string $class Name of the CSS class which should be used. - * @param string $title Value of an 'title' atribute of the div tag. + * @param string $title Value of an 'title' attribute of the div tag. * @return string HTML markup */ function generate_pagination_arrow($class, $title) diff --git a/src/mibew/styles/chats/default/config.yml b/src/mibew/styles/chats/default/config.yml index dd082f72..296b18ed 100644 --- a/src/mibew/styles/chats/default/config.yml +++ b/src/mibew/styles/chats/default/config.yml @@ -17,9 +17,9 @@ mail: width: 603 resizable: false -# Screenshots section describe all screenshots shiped with style +# Screenshots section describe all screenshots shipped with style # Params names should be equals to file names without extension. Pictures # extension should be '.png' -# Params values should be equals to screenshot desription +# Params values should be equals to screenshot description screenshots: client_chat: "Client chat window" diff --git a/src/mibew/styles/chats/default/js/source/resize.js b/src/mibew/styles/chats/default/js/source/resize.js index e021ba5d..762523ed 100644 --- a/src/mibew/styles/chats/default/js/source/resize.js +++ b/src/mibew/styles/chats/default/js/source/resize.js @@ -35,7 +35,7 @@ * Stretch #messages-region to fill the window. * * @param {Boolean} recalculateHeight Indicates if height of elements must - * be recalculated. It can be usefull when elements set is changed. + * be recalculated. It can be useful when elements set is changed. */ var updateHeight = function(recalculateHeight) { if ($('#messages-region').size() == 0) { diff --git a/src/mibew/styles/invitations/default/config.yml b/src/mibew/styles/invitations/default/config.yml index 6b00f7c1..b5e66c00 100644 --- a/src/mibew/styles/invitations/default/config.yml +++ b/src/mibew/styles/invitations/default/config.yml @@ -1,9 +1,9 @@ # This file determines some invitation style options -# Screenshots section describe all screenshots shiped with style +# Screenshots section describe all screenshots shipped with style # Params names should be equals to file names without extension. Pictures # extension should be '.png' -# Params values should be equals to screenshot desription +# Params values should be equals to screenshot description screenshots: invitation: "Appearance of the invitation" location: "Location of the invitation on a page" diff --git a/src/mibew/styles/pages/default/config.yml b/src/mibew/styles/pages/default/config.yml index 22fa23fe..0cb03cbd 100644 --- a/src/mibew/styles/pages/default/config.yml +++ b/src/mibew/styles/pages/default/config.yml @@ -36,9 +36,9 @@ ban: height: 480 resizable: true -# Screenshots section describe all screenshots shiped with style +# Screenshots section describe all screenshots shipped with style # Params names should be equals to file names without extension. Pictures # extension should be '.png' -# Params values should be equals to screenshot desription +# Params values should be equals to screenshot description screenshots: home: "Operator's home page" diff --git a/src/tests/client_side/qunit/qunit.js b/src/tests/client_side/qunit/qunit.js index 9efedcb4..2c6c1c9f 100644 --- a/src/tests/client_side/qunit/qunit.js +++ b/src/tests/client_side/qunit/qunit.js @@ -347,7 +347,7 @@ QUnit = { test.queue(); }, - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. + // Specify the number of expected assertions to guarantee that failed test (no assertions are run at all) don't slip through. expect: function( asserts ) { config.current.expected = asserts; }, @@ -1022,7 +1022,7 @@ addEvent( window, "load", QUnit.load ); onErrorFnPrev = window.onerror; // Cover uncaught exceptions -// Returning true will surpress the default browser handler, +// Returning true will suppress the default browser handler, // returning false will let it run. window.onerror = function ( error, filePath, linerNr ) { var ret = false; @@ -1031,7 +1031,7 @@ window.onerror = function ( error, filePath, linerNr ) { } // Treat return value as window.onerror itself does, - // Only do our handling if not surpressed. + // Only do our handling if not suppressed. if ( ret !== true ) { if ( QUnit.config.current ) { if ( QUnit.config.current.ignoreGlobalErrors ) { @@ -1435,7 +1435,7 @@ QUnit.equiv = (function() { loop = false; for ( j = 0; j < parents.length; j++ ) { if ( parents[j] === a[i] ) { - loop = true;// dont rewalk array + loop = true;// don't rewalk array } } if ( !loop && !innerEquiv(a[i], b[i]) ) { @@ -1923,7 +1923,7 @@ QUnit.diff = (function() { }; }()); -// for CommonJS enviroments, export everything +// for CommonJS environments, export everything if ( typeof exports !== "undefined" ) { extend(exports, QUnit); }