Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in lib/private subdirectory #33380

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/App/CompareVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/private/AppFramework/Http/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function dispatch(Controller $controller, string $methodName): array {
$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);

Expand Down Expand Up @@ -156,7 +156,7 @@ public function dispatch(Controller $controller, string $methodName): array {

// 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(
Expand Down
2 changes: 1 addition & 1 deletion lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public function getParam(string $key, $default = null) {

/**
* 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Authentication/Token/IProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function getPassword(IToken $savedToken, string $tokenId): string;
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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Avatar/Avatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private function hashToInt(string $hash, int $maximum): int {
}

/**
* @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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Contacts/ContactsMenu/ContactsStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function getContacts(IUser $user, ?string $filter, ?int $limit = null, ?i
* 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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public function set($key, $value) {
* ->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();
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
/**
* 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
Expand Down Expand Up @@ -582,7 +582,7 @@ private function removeChildren(ICacheEntry $entry) {
$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);
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Cache/Propagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $c
* @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;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Cache/QuerySearchHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function searchInCaches(ISearchQuery $searchQuery, array $caches): array

$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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/Cache/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* 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
*/
Expand Down Expand Up @@ -135,7 +135,7 @@ public static function getStorageId(int $numericId): ?string {
* 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);
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Cache/StorageGlobal.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* 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
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/Cache/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public function __construct(\OC\Files\Storage\Storage $storage) {
}

/**
* 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;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Config/UserMountCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public function addSubEntry($data, $entryPath) {
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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Node/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public function search($query) {
$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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Node/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public function getByIdInPath(int $id, string $path): array {
$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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/SimpleFS/NewSimpleFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function putContent($data): void {

/**
* 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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/SimpleFS/SimpleFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function putContent($data): void {

/**
* 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
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ private function basicOperation($operation, $path, $hooks = [], $extraParam = nu
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;
}
Expand Down Expand Up @@ -1725,7 +1725,7 @@ public function getETag($path) {
/**
* 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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/HintException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* 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 {
}
2 changes: 1 addition & 1 deletion lib/private/Http/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private function getCertBundle(): string {
}

/**
* 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.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/private/MemoryInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private function memoryLimitToBytes(string $memoryLimit): int {
$last = strtolower(substr($memoryLimit, -1));
$memoryLimit = (int)substr($memoryLimit, 0, -1);

// intended fall trough
// intended fall through
switch ($last) {
case 'g':
$memoryLimit *= 1024;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Metadata/IMetadataManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function clearMetadata(int $fileId): void;
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;
}
2 changes: 1 addition & 1 deletion lib/private/OCS/DiscoveryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(ICacheFactory $cacheFactory,
*
* @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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/private/Profile/ProfileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ private function filterNotStoredProfileConfig(array $profileConfig): array {
* 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];
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Repair/RemoveLinkShares.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private function repair(IOutput $output, int $total): void {
$output->finishProgress();
$shareResult->closeCursor();

// Notifiy all admins
// Notify all admins
$adminGroup = $this->groupManager->get('admin');
$adminUsers = $adminGroup->getUsers();
foreach ($adminUsers as $user) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Route/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private function requireRouteFile($file, $appName) {
* 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
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Security/TrustedDomainHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function isTrustedDomain(string $domainWithPort): bool {
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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Session/Internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function getId(): string {
* @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.');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Share/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/private/Share/Share.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ protected static function groupItems($items, $itemType) {
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
Expand All @@ -757,7 +757,7 @@ protected static function groupItems($items, $itemType) {
/**
* 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
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Share20/DefaultShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ public function userDeletedFromGroup($uid, $gid) {
$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)))
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ public function currentUserCanEnumerateTargetUser(?IUser $currentUser, IUser $ta
/**
* Copied from \OC_Util::isSharingDisabledForUser
*
* TODO: Deprecate fuction from OC_Util
* TODO: Deprecate function from OC_Util
*
* @param string $userId
* @return bool
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Share20/Share.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public function getSharedWithAvatar() {
* @inheritdoc
*/
public function setPermissions($permissions) {
//TODO checkes
//TODO checks

$this->permissions = $permissions;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion lib/private/URLGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function linkToDefaultPageUrl(): string {
* @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;
}
Expand Down