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

Apply fixes from StyleCI #1205

Merged
merged 1 commit into from
Jan 17, 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
66 changes: 33 additions & 33 deletions Blacklight/Binaries.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function __construct(array $options = [])
/**
* Download new headers for all active groups.
*
* @param int $maxHeaders (Optional) How many headers to download max.
* @param int $maxHeaders (Optional) How many headers to download max.
* @return void
*
* @throws \Exception
Expand Down Expand Up @@ -307,8 +307,8 @@ public function logIndexerStart(): void
/**
* Download new headers for a single group.
*
* @param array $groupMySQL Array of MySQL results for a single group.
* @param int $maxHeaders (Optional) How many headers to download max.
* @param array $groupMySQL Array of MySQL results for a single group.
* @param int $maxHeaders (Optional) How many headers to download max.
* @return void
*
* @throws \Exception
Expand Down Expand Up @@ -535,11 +535,11 @@ public function updateGroup(array $groupMySQL, int $maxHeaders = 0): void
/**
* Loop over range of wanted headers, insert headers into DB.
*
* @param array $groupMySQL The group info from mysql.
* @param int $first The oldest wanted header.
* @param int $last The newest wanted header.
* @param string $type Is this partrepair or update or backfill?
* @param array|null $missingParts If we are running in partrepair, the list of missing article numbers.
* @param array $groupMySQL The group info from mysql.
* @param int $first The oldest wanted header.
* @param int $last The newest wanted header.
* @param string $type Is this partrepair or update or backfill?
* @param array|null $missingParts If we are running in partrepair, the list of missing article numbers.
* @return array Empty on failure.
*
* @throws \Exception
Expand Down Expand Up @@ -1019,7 +1019,7 @@ protected function outputHeaderDuration(): void
/**
* If we failed to insert Collections/Binaries/Parts, rollback the transaction and add the parts to part repair.
*
* @param array $headers Array of headers containing sub-arrays with parts.
* @param array $headers Array of headers containing sub-arrays with parts.
* @return array Array of article numbers to add to part repair.
*
* @throws \Exception
Expand All @@ -1041,7 +1041,7 @@ protected function _rollbackAddToPartRepair(array $headers): array
/**
* Attempt to get missing article headers.
*
* @param array $groupArr The info for this group from mysql.
* @param array $groupArr The info for this group from mysql.
* @return void
*
* @throws \Exception
Expand Down Expand Up @@ -1169,7 +1169,7 @@ public function partRepair(array $groupArr): void
/**
* Returns unix time for an article number.
*
* @param int $post The article number to get the time from.
* @param int $post The article number to get the time from.
* @param array $groupData Usenet group info from NNTP selectGroup method.
* @return int Timestamp.
*
Expand Down Expand Up @@ -1238,8 +1238,8 @@ public function postdate(int $post, array $groupData): int
/**
* Returns article number based on # of days.
*
* @param int $days How many days back we want to go.
* @param array $data Group data from usenet.
* @param int $days How many days back we want to go.
* @param array $data Group data from usenet.
* @return string
*
* @throws \Exception
Expand Down Expand Up @@ -1335,8 +1335,8 @@ public function daytopost(int $days, array $data): string
/**
* Add article numbers from missing headers to DB.
*
* @param array $numbers The article numbers of the missing headers.
* @param int $groupID The ID of this groups.
* @param array $numbers The article numbers of the missing headers.
* @param int $groupID The ID of this groups.
* @return string
*/
private function addMissingParts(array $numbers, int $groupID): string
Expand All @@ -1355,7 +1355,7 @@ private function addMissingParts(array $numbers, int $groupID): string
* Clean up part repair table.
*
* @param array $numbers The article numbers.
* @param int $groupID The ID of the group.
* @param int $groupID The ID of the group.
* @return void
*
* @throws \Throwable
Expand All @@ -1381,7 +1381,7 @@ private function removeRepairedParts(array $numbers, int $groupID): void
/**
* Get blacklist and cache it. Return if already cached.
*
* @param string $groupName
* @param string $groupName
* @return void
*/
protected function _retrieveBlackList(string $groupName): void
Expand All @@ -1398,8 +1398,8 @@ protected function _retrieveBlackList(string $groupName): void
/**
* Check if an article is blacklisted.
*
* @param array $msg The article header (OVER format).
* @param string $groupName The group name.
* @param array $msg The article header (OVER format).
* @param string $groupName The group name.
* @return bool
*/
public function isBlackListed(array $msg, string $groupName): bool
Expand Down Expand Up @@ -1451,10 +1451,10 @@ public function isBlackListed(array $msg, string $groupName): bool
/**
* Return all blacklists.
*
* @param bool $activeOnly Only display active blacklists ?
* @param int|string $opType Optional, get white or black lists (use Binaries constants).
* @param string $groupName Optional, group.
* @param bool $groupRegex Optional Join groups / binaryblacklist using regexp for equals.
* @param bool $activeOnly Only display active blacklists ?
* @param int|string $opType Optional, get white or black lists (use Binaries constants).
* @param string $groupName Optional, group.
* @param bool $groupRegex Optional Join groups / binaryblacklist using regexp for equals.
* @return array
*/
public function getBlacklist(bool $activeOnly = true, int|string $opType = -1, string $groupName = '', bool $groupRegex = false): array
Expand Down Expand Up @@ -1485,7 +1485,7 @@ public function getBlacklist(bool $activeOnly = true, int|string $opType = -1, s
}

/**
* @param int $id
* @param int $id
* @return \App\Models\BinaryBlacklist|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
*/
public function getBlacklistByID(int $id)
Expand All @@ -1496,15 +1496,15 @@ public function getBlacklistByID(int $id)
/**
* Delete a blacklist.
*
* @param int $id The ID of the blacklist.
* @param int $id The ID of the blacklist.
*/
public function deleteBlacklist(int $id): void
{
BinaryBlacklist::query()->where('id', $id)->delete();
}

/**
* @param array $blacklistArray
* @param array $blacklistArray
* @return void
*/
public function updateBlacklist(array $blacklistArray): void
Expand All @@ -1524,7 +1524,7 @@ public function updateBlacklist(array $blacklistArray): void
/**
* Adds a new blacklist from binary blacklist edit admin web page.
*
* @param array $blacklistArray
* @param array $blacklistArray
*/
public function addBlacklist(array $blacklistArray): void
{
Expand All @@ -1543,7 +1543,7 @@ public function addBlacklist(array $blacklistArray): void
/**
* Delete Collections/Binaries/Parts for a Collection ID.
*
* @param int $collectionID Collections table ID
* @param int $collectionID Collections table ID
*
* @note A trigger automatically deletes the parts/binaries.
*
Expand All @@ -1561,9 +1561,9 @@ public function delete(int $collectionID): void
/**
* Log / Echo message.
*
* @param string $message Message to log.
* @param string $method Method that called this.
* @param string $color ColorCLI method name.
* @param string $message Message to log.
* @param string $method Method that called this.
* @param string $color ColorCLI method name.
*/
private function log(string $message, string $method, string $color): void
{
Expand All @@ -1575,8 +1575,8 @@ private function log(string $message, string $method, string $color): void
/**
* Check if we should ignore the file count and return true or false.
*
* @param string $groupName
* @param string $subject
* @param string $groupName
* @param string $subject
* @return bool
*/
protected function _ignoreFileCount(string $groupName, string $subject): bool
Expand Down
10 changes: 5 additions & 5 deletions Blacklight/Categorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function __construct()
* Returns Category::OTHER_MISC if no category is appropriate.
*
* @param $groupId
* @param string $releaseName
* @param string $poster
* @param string $releaseName
* @param string $poster
* @return array
*
* @throws \Exception
Expand Down Expand Up @@ -1442,9 +1442,9 @@ public function isMisc(): bool
}

/**
* @param string $regex Regex to use for match
* @param string $fromName Poster that needs to be matched by regex
* @param string $category Category to set if there is a match
* @param string $regex Regex to use for match
* @param string $fromName Poster that needs to be matched by regex
* @param string $category Category to set if there is a match
* @return bool
*/
public function checkPoster(string $regex, string $fromName, string $category): bool
Expand Down
2 changes: 1 addition & 1 deletion Blacklight/Tmux.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function microtime_float(): float
}

/**
* @param float $bytes
* @param float $bytes
* @return string
*/
public function decodeSize(float $bytes): string
Expand Down
1 change: 1 addition & 0 deletions Blacklight/TmuxOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ protected function _getFormatMasks($compressed): array

/**
* @return string
*
* @throws \CzProject\GitPhp\GitException
*/
protected function _getHeader(): string
Expand Down