Pārlūkot izejas kodu

Fix typos in lib/private subdirectory

Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
luz paz 1 gadu atpakaļ
vecāks
revīzija
368f83095d
37 mainītis faili ar 44 papildinājumiem un 44 dzēšanām
  1. 1 1
      lib/private/App/CompareVersion.php
  2. 2 2
      lib/private/AppFramework/Http/Dispatcher.php
  3. 1 1
      lib/private/AppFramework/Http/Request.php
  4. 1 1
      lib/private/AppFramework/Middleware/MiddlewareDispatcher.php
  5. 1 1
      lib/private/Authentication/Token/IProvider.php
  6. 1 1
      lib/private/Avatar/Avatar.php
  7. 1 1
      lib/private/Contacts/ContactsMenu/ContactsStore.php
  8. 1 1
      lib/private/DB/QueryBuilder/QueryBuilder.php
  9. 2 2
      lib/private/Files/Cache/Cache.php
  10. 1 1
      lib/private/Files/Cache/Propagator.php
  11. 1 1
      lib/private/Files/Cache/QuerySearchHelper.php
  12. 2 2
      lib/private/Files/Cache/Storage.php
  13. 1 1
      lib/private/Files/Cache/StorageGlobal.php
  14. 2 2
      lib/private/Files/Cache/Updater.php
  15. 1 1
      lib/private/Files/Config/UserMountCache.php
  16. 1 1
      lib/private/Files/FileInfo.php
  17. 1 1
      lib/private/Files/Node/Folder.php
  18. 1 1
      lib/private/Files/Node/Root.php
  19. 1 1
      lib/private/Files/SimpleFS/NewSimpleFile.php
  20. 1 1
      lib/private/Files/SimpleFS/SimpleFile.php
  21. 2 2
      lib/private/Files/View.php
  22. 1 1
      lib/private/HintException.php
  23. 1 1
      lib/private/Http/Client/Client.php
  24. 1 1
      lib/private/MemoryInfo.php
  25. 1 1
      lib/private/Metadata/IMetadataManager.php
  26. 1 1
      lib/private/OCS/DiscoveryService.php
  27. 2 2
      lib/private/Profile/ProfileManager.php
  28. 1 1
      lib/private/Repair/RemoveLinkShares.php
  29. 1 1
      lib/private/Route/Router.php
  30. 1 1
      lib/private/Security/TrustedDomainHelper.php
  31. 1 1
      lib/private/Session/Internal.php
  32. 1 1
      lib/private/Share/Constants.php
  33. 2 2
      lib/private/Share/Share.php
  34. 1 1
      lib/private/Share20/DefaultShareProvider.php
  35. 1 1
      lib/private/Share20/Manager.php
  36. 1 1
      lib/private/Share20/Share.php
  37. 1 1
      lib/private/URLGenerator.php

+ 1 - 1
lib/private/App/CompareVersion.php

@@ -41,7 +41,7 @@ class CompareVersion {
 	 * so '13.0.1', '13.0' and '13' are valid.
 	 *
 	 * @param string $actual version as major.minor.patch notation
-	 * @param string $required version where major is requried and minor and patch are optional
+	 * @param string $required version where major is required and minor and patch are optional
 	 * @param string $comparator passed to `version_compare`
 	 * @return bool whether the requirement is fulfilled
 	 * @throws InvalidArgumentException if versions specified in an invalid format

+ 2 - 2
lib/private/AppFramework/Http/Dispatcher.php

@@ -118,7 +118,7 @@ class Dispatcher {
 		$out = [null, [], null];
 
 		try {
-			// prefill reflector with everything thats needed for the
+			// prefill reflector with everything that's needed for the
 			// middlewares
 			$this->reflector->reflect($controller, $methodName);
 
@@ -156,7 +156,7 @@ class Dispatcher {
 
 			// if an exception appears, the middleware checks if it can handle the
 			// exception and creates a response. If no response is created, it is
-			// assumed that theres no middleware who can handle it and the error is
+			// assumed that there's no middleware who can handle it and the error is
 			// thrown again
 		} catch (\Exception $exception) {
 			$response = $this->middlewareDispatcher->afterException(

+ 1 - 1
lib/private/AppFramework/Http/Request.php

@@ -342,7 +342,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
 
 	/**
 	 * Returns all params that were received, be it from the request
-	 * (as GET or POST) or throuh the URL by the route
+	 * (as GET or POST) or through the URL by the route
 	 * @return array the array with all parameters
 	 */
 	public function getParams(): array {

+ 1 - 1
lib/private/AppFramework/Middleware/MiddlewareDispatcher.php

@@ -46,7 +46,7 @@ class MiddlewareDispatcher {
 	private $middlewares;
 
 	/**
-	 * @var int counter which tells us what middlware was executed once an
+	 * @var int counter which tells us what middleware was executed once an
 	 *                  exception occurs
 	 */
 	private $middlewareCounter;

+ 1 - 1
lib/private/Authentication/Token/IProvider.php

@@ -158,7 +158,7 @@ interface IProvider {
 	public function setPassword(IToken $token, string $tokenId, string $password);
 
 	/**
-	 * Rotate the token. Usefull for for example oauth tokens
+	 * Rotate the token. Useful for for example oauth tokens
 	 *
 	 * @param IToken $token
 	 * @param string $oldTokenId

+ 1 - 1
lib/private/Avatar/Avatar.php

@@ -236,7 +236,7 @@ abstract class Avatar implements IAvatar {
 	}
 
 	/**
-	 * @return Color Object containting r g b int in the range [0, 255]
+	 * @return Color Object containing r g b int in the range [0, 255]
 	 */
 	public function avatarBackgroundColor(string $hash): Color {
 		// Normalize hash

+ 1 - 1
lib/private/Contacts/ContactsMenu/ContactsStore.php

@@ -123,7 +123,7 @@ class ContactsStore implements IContactsStore {
 	 *  2. if the `shareapi_exclude_groups` config option is enabled and the
 	 * current user is in an excluded group it will filter all local users.
 	 *  3. if the `shareapi_only_share_with_group_members` config option is
-	 * enabled it will filter all users which doens't have a common group
+	 * enabled it will filter all users which doesn't have a common group
 	 * with the current user.
 	 *
 	 * @param IUser $self

+ 1 - 1
lib/private/DB/QueryBuilder/QueryBuilder.php

@@ -852,7 +852,7 @@ class QueryBuilder implements IQueryBuilder {
 	 *         ->from('users', 'u')
 	 *         ->where('u.id = ?');
 	 *
-	 *     // You can optionally programatically build and/or expressions
+	 *     // You can optionally programmatically build and/or expressions
 	 *     $qb = $conn->getQueryBuilder();
 	 *
 	 *     $or = $qb->expr()->orx();

+ 2 - 2
lib/private/Files/Cache/Cache.php

@@ -64,7 +64,7 @@ use Psr\Log\LoggerInterface;
 /**
  * Metadata cache for a storage
  *
- * The cache stores the metadata for all files and folders in a storage and is kept up to date trough the following mechanisms:
+ * The cache stores the metadata for all files and folders in a storage and is kept up to date through the following mechanisms:
  *
  * - Scanner: scans the storage and updates the cache where needed
  * - Watcher: checks for changes made to the filesystem outside of the Nextcloud instance and rescans files and folder when a change is detected
@@ -582,7 +582,7 @@ class Cache implements ICache {
 		$parentIds = [$entry->getId()];
 		$queue = [$entry->getId()];
 
-		// we walk depth first trough the file tree, removing all filecache_extended attributes while we walk
+		// we walk depth first through the file tree, removing all filecache_extended attributes while we walk
 		// and collecting all folder ids to later use to delete the filecache entries
 		while ($entryId = array_pop($queue)) {
 			$children = $this->getFolderContentsById($entryId);

+ 1 - 1
lib/private/Files/Cache/Propagator.php

@@ -66,7 +66,7 @@ class Propagator implements IPropagator {
 	 * @param int $sizeDifference number of bytes the file has grown
 	 */
 	public function propagateChange($internalPath, $time, $sizeDifference = 0) {
-		// Do not propogate changes in ignored paths
+		// Do not propagate changes in ignored paths
 		foreach ($this->ignore as $ignore) {
 			if (strpos($internalPath, $ignore) === 0) {
 				return;

+ 1 - 1
lib/private/Files/Cache/QuerySearchHelper.php

@@ -158,7 +158,7 @@ class QuerySearchHelper {
 
 		$result->closeCursor();
 
-		// loop trough all caches for each result to see if the result matches that storage
+		// loop through all caches for each result to see if the result matches that storage
 		// results are grouped by the same array keys as the caches argument to allow the caller to distringuish the source of the results
 		$results = array_fill_keys(array_keys($caches), []);
 		foreach ($rawEntries as $rawEntry) {

+ 2 - 2
lib/private/Files/Cache/Storage.php

@@ -40,7 +40,7 @@ use Psr\Log\LoggerInterface;
  * 	a string id which is generated by the storage backend and reflects the configuration of the storage (e.g. 'smb://user@host/share')
  * 	and a numeric storage id which is referenced in the file cache
  *
- * A mapping between the two storage ids is stored in the database and accessible trough this class
+ * A mapping between the two storage ids is stored in the database and accessible through this class
  *
  * @package OC\Files\Cache
  */
@@ -135,7 +135,7 @@ class Storage {
 	 * Get the numeric of the storage with the provided string id
 	 *
 	 * @param $storageId
-	 * @return int|null either the numeric storage id or null if the storage id is not knwon
+	 * @return int|null either the numeric storage id or null if the storage id is not known
 	 */
 	public static function getNumericStorageId($storageId) {
 		$storageId = self::adjustStorageId($storageId);

+ 1 - 1
lib/private/Files/Cache/StorageGlobal.php

@@ -33,7 +33,7 @@ use OCP\IDBConnection;
  *    a string id which is generated by the storage backend and reflects the configuration of the storage (e.g. 'smb://user@host/share')
  *    and a numeric storage id which is referenced in the file cache
  *
- * A mapping between the two storage ids is stored in the database and accessible trough this class
+ * A mapping between the two storage ids is stored in the database and accessible through this class
  *
  * @package OC\Files\Cache
  */

+ 2 - 2
lib/private/Files/Cache/Updater.php

@@ -73,14 +73,14 @@ class Updater implements IUpdater {
 	}
 
 	/**
-	 * Disable updating the cache trough this updater
+	 * Disable updating the cache through this updater
 	 */
 	public function disable() {
 		$this->enabled = false;
 	}
 
 	/**
-	 * Re-enable the updating of the cache trough this updater
+	 * Re-enable the updating of the cache through this updater
 	 */
 	public function enable() {
 		$this->enabled = true;

+ 1 - 1
lib/private/Files/Config/UserMountCache.php

@@ -42,7 +42,7 @@ use OCP\IUserManager;
 use Psr\Log\LoggerInterface;
 
 /**
- * Cache mounts points per user in the cache so we can easilly look them up
+ * Cache mounts points per user in the cache so we can easily look them up
  */
 class UserMountCache implements IUserMountCache {
 	private IDBConnection $connection;

+ 1 - 1
lib/private/Files/FileInfo.php

@@ -414,7 +414,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
 		if (isset($data['etag'])) {
 			// prefix the etag with the relative path of the subentry to propagate etag on mount moves
 			$relativeEntryPath = substr($entryPath, strlen($this->getPath()));
-			// attach the permissions to propagate etag on permision changes of submounts
+			// attach the permissions to propagate etag on permission changes of submounts
 			$permissions = isset($data['permissions']) ? $data['permissions'] : 0;
 			$this->childEtags[] = $relativeEntryPath . '/' . $data['etag'] . $permissions;
 		}

+ 1 - 1
lib/private/Files/Node/Folder.php

@@ -262,7 +262,7 @@ class Folder extends Node implements \OCP\Files\Folder {
 		$searchHelper = \OC::$server->get(QuerySearchHelper::class);
 		$resultsPerCache = $searchHelper->searchInCaches($query, $caches);
 
-		// loop trough all results per-cache, constructing the FileInfo object from the CacheEntry and merge them all
+		// loop through all results per-cache, constructing the FileInfo object from the CacheEntry and merge them all
 		$files = array_merge(...array_map(function (array $results, $relativeMountPoint) use ($mountByMountPoint) {
 			$mount = $mountByMountPoint[$relativeMountPoint];
 			return array_map(function (ICacheEntry $result) use ($relativeMountPoint, $mount) {

+ 1 - 1
lib/private/Files/Node/Root.php

@@ -427,7 +427,7 @@ class Root extends Folder implements IRootFolder {
 			$mountsContainingFile = $mountCache->getMountsForFileId($id, $user);
 		}
 
-		// when a user has access trough the same storage trough multiple paths
+		// when a user has access through the same storage through multiple paths
 		// (such as an external storage that is both mounted for a user and shared to the user)
 		// the mount cache will only hold a single entry for the storage
 		// this can lead to issues as the different ways the user has access to a storage can have different permissions

+ 1 - 1
lib/private/Files/SimpleFS/NewSimpleFile.php

@@ -127,7 +127,7 @@ class NewSimpleFile implements ISimpleFile {
 
 	/**
 	 * Sometimes there are some issues with the AppData. Most of them are from
-	 * user error. But we should handle them gracefull anyway.
+	 * user error. But we should handle them gracefully anyway.
 	 *
 	 * If for some reason the current file can't be found. We remove it.
 	 * Then traverse up and check all folders if they exists. This so that the

+ 1 - 1
lib/private/Files/SimpleFS/SimpleFile.php

@@ -97,7 +97,7 @@ class SimpleFile implements ISimpleFile {
 
 	/**
 	 * Sometimes there are some issues with the AppData. Most of them are from
-	 * user error. But we should handle them gracefull anyway.
+	 * user error. But we should handle them gracefully anyway.
 	 *
 	 * If for some reason the current file can't be found. We remove it.
 	 * Then traverse up and check all folders if they exists. This so that the

+ 2 - 2
lib/private/Files/View.php

@@ -1164,7 +1164,7 @@ class View {
 					try {
 						$this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE);
 					} catch (LockedException $e) {
-						// release the shared lock we acquired before quiting
+						// release the shared lock we acquired before quitting
 						$this->unlockFile($path, ILockingProvider::LOCK_SHARED);
 						throw $e;
 					}
@@ -1725,7 +1725,7 @@ class View {
 	/**
 	 * Get the path of a file by id, relative to the view
 	 *
-	 * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file
+	 * Note that the resulting path is not guaranteed to be unique for the id, multiple paths can point to the same file
 	 *
 	 * @param int $id
 	 * @param int|null $storageId

+ 1 - 1
lib/private/HintException.php

@@ -31,7 +31,7 @@ namespace OC;
  * An Exception class with the intention to be presented to the end user
  *
  * @package OC
- * @depreacted 23.0.0 Use \OCP\HintException
+ * @deprecated 23.0.0 Use \OCP\HintException
  */
 class HintException extends \OCP\HintException {
 }

+ 1 - 1
lib/private/Http/Client/Client.php

@@ -128,7 +128,7 @@ class Client implements IClient {
 	}
 
 	/**
-	 * Returns a null or an associative array specifiying the proxy URI for
+	 * Returns a null or an associative array specifying the proxy URI for
 	 * 'http' and 'https' schemes, in addition to a 'no' key value pair
 	 * providing a list of host names that should not be proxied to.
 	 *

+ 1 - 1
lib/private/MemoryInfo.php

@@ -68,7 +68,7 @@ class MemoryInfo {
 		$last = strtolower(substr($memoryLimit, -1));
 		$memoryLimit = (int)substr($memoryLimit, 0, -1);
 
-		// intended fall trough
+		// intended fall through
 		switch ($last) {
 			case 'g':
 				$memoryLimit *= 1024;

+ 1 - 1
lib/private/Metadata/IMetadataManager.php

@@ -29,7 +29,7 @@ interface IMetadataManager {
 	public function fetchMetadataFor(string $group, array $fileIds): array;
 
 	/**
-	 * Get the capabilites as an array of mimetype regex to the type provided
+	 * Get the capabilities as an array of mimetype regex to the type provided
 	 */
 	public function getCapabilities(): array;
 }

+ 1 - 1
lib/private/OCS/DiscoveryService.php

@@ -62,7 +62,7 @@ class DiscoveryService implements IDiscoveryService {
 	 *
 	 * @param string $remote
 	 * @param string $service the service you want to discover
-	 * @param bool $skipCache We won't check if the data is in the cache. This is usefull if a background job is updating the status
+	 * @param bool $skipCache We won't check if the data is in the cache. This is useful if a background job is updating the status
 	 * @return array
 	 */
 	public function discover(string $remote, string $service, bool $skipCache = false): array {

+ 2 - 2
lib/private/Profile/ProfileManager.php

@@ -348,13 +348,13 @@ class ProfileManager {
 	 * Return the default profile config
 	 */
 	private function getDefaultProfileConfig(IUser $targetUser, ?IUser $visitingUser): array {
-		// Contruct the default config for actions
+		// Construct the default config for actions
 		$actionsConfig = [];
 		foreach ($this->getActions($targetUser, $visitingUser) as $action) {
 			$actionsConfig[$action->getId()] = ['visibility' => ProfileConfig::DEFAULT_VISIBILITY];
 		}
 
-		// Contruct the default config for account properties
+		// Construct the default config for account properties
 		$propertiesConfig = [];
 		foreach (ProfileConfig::DEFAULT_PROPERTY_VISIBILITY as $property => $visibility) {
 			$propertiesConfig[$property] = ['visibility' => $visibility];

+ 1 - 1
lib/private/Repair/RemoveLinkShares.php

@@ -217,7 +217,7 @@ class RemoveLinkShares implements IRepairStep {
 		$output->finishProgress();
 		$shareResult->closeCursor();
 
-		// Notifiy all admins
+		// Notify all admins
 		$adminGroup = $this->groupManager->get('admin');
 		$adminUsers = $adminGroup->getUsers();
 		foreach ($adminUsers as $user) {

+ 1 - 1
lib/private/Route/Router.php

@@ -409,7 +409,7 @@ class Router implements IRouter {
 	 * register the routes for the app. The application class will be chosen by
 	 * camelcasing the appname, e.g.: my_app will be turned into
 	 * \OCA\MyApp\AppInfo\Application. If that class does not exist, a default
-	 * App will be intialized. This makes it optional to ship an
+	 * App will be initialized. This makes it optional to ship an
 	 * appinfo/application.php by using the built in query resolver
 	 *
 	 * @param array $routes the application routes

+ 1 - 1
lib/private/Security/TrustedDomainHelper.php

@@ -97,7 +97,7 @@ class TrustedDomainHelper implements ITrustedDomainHelper {
 		if (preg_match(Request::REGEX_LOCALHOST, $domain) === 1) {
 			return true;
 		}
-		// Reject misformed domains in any case
+		// Reject malformed domains in any case
 		if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) {
 			return false;
 		}

+ 1 - 1
lib/private/Session/Internal.php

@@ -172,7 +172,7 @@ class Internal extends Session {
 	 * @throws \Exception
 	 */
 	public function reopen() {
-		throw new \Exception('The session cannot be reopened - reopen() is ony to be used in unit testing.');
+		throw new \Exception('The session cannot be reopened - reopen() is only to be used in unit testing.');
 	}
 
 	/**

+ 1 - 1
lib/private/Share/Constants.php

@@ -79,7 +79,7 @@ class Constants {
 	public const FORMAT_STATUSES = -2;
 	public const FORMAT_SOURCES = -3;  // ToDo Check if it is still in use otherwise remove it
 
-	public const RESPONSE_FORMAT = 'json'; // default resonse format for ocs calls
+	public const RESPONSE_FORMAT = 'json'; // default response format for ocs calls
 
 	public const TOKEN_LENGTH = 15; // old (oc7) length is 32, keep token length in db at least that for compatibility
 

+ 2 - 2
lib/private/Share/Share.php

@@ -732,7 +732,7 @@ class Share extends Constants {
 			foreach ($result as $key => $r) {
 				// for file/folder shares we need to compare file_source, otherwise we compare item_source
 				// only group shares if they already point to the same target, otherwise the file where shared
-				// before grouping of shares was added. In this case we don't group them toi avoid confusions
+				// before grouping of shares was added. In this case we don't group them to avoid confusions
 				if (($fileSharing && $item['file_source'] === $r['file_source'] && $item['file_target'] === $r['file_target']) ||
 					(!$fileSharing && $item['item_source'] === $r['item_source'] && $item['item_target'] === $r['item_target'])) {
 					// add the first item to the list of grouped shares
@@ -757,7 +757,7 @@ class Share extends Constants {
 	/**
 	 * construct select statement
 	 * @param int $format
-	 * @param boolean $fileDependent ist it a file/folder share or a generla share
+	 * @param boolean $fileDependent ist it a file/folder share or a general share
 	 * @param string $uidOwner
 	 * @return string select statement
 	 */

+ 1 - 1
lib/private/Share20/DefaultShareProvider.php

@@ -1294,7 +1294,7 @@ class DefaultShareProvider implements IShareProvider {
 			$chunks = array_chunk($ids, 100);
 			foreach ($chunks as $chunk) {
 				/*
-				 * Delete all special shares wit this users for the found group shares
+				 * Delete all special shares with this users for the found group shares
 				 */
 				$qb->delete('share')
 					->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_USERGROUP)))

+ 1 - 1
lib/private/Share20/Manager.php

@@ -2010,7 +2010,7 @@ class Manager implements IManager {
 	/**
 	 * Copied from \OC_Util::isSharingDisabledForUser
 	 *
-	 * TODO: Deprecate fuction from OC_Util
+	 * TODO: Deprecate function from OC_Util
 	 *
 	 * @param string $userId
 	 * @return bool

+ 1 - 1
lib/private/Share20/Share.php

@@ -319,7 +319,7 @@ class Share implements IShare {
 	 * @inheritdoc
 	 */
 	public function setPermissions($permissions) {
-		//TODO checkes
+		//TODO checks
 
 		$this->permissions = $permissions;
 		return $this;

+ 1 - 1
lib/private/URLGenerator.php

@@ -320,7 +320,7 @@ class URLGenerator implements IURLGenerator {
 	 * @return string base url of the current request
 	 */
 	public function getBaseUrl(): string {
-		// BaseUrl can be equal to 'http(s)://' during the first steps of the intial setup.
+		// BaseUrl can be equal to 'http(s)://' during the first steps of the initial setup.
 		if ($this->baseUrl === null || $this->baseUrl === "http://" || $this->baseUrl === "https://") {
 			$this->baseUrl = $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT;
 		}