Update all the \Blacklight namespace classes with class PHPDOC block

This commit is contained in:
DariusIII
2019-01-01 23:07:45 +01:00
parent 519c13f739
commit 4104f34c54
42 changed files with 174 additions and 55 deletions
+5
View File
@@ -6,6 +6,11 @@ use App\Models\Category;
use App\Models\AnidbTitle;
use Illuminate\Support\Facades\DB;
/**
* Class AniDB
*
* @package Blacklight
*/
class AniDB
{
/**
+5
View File
@@ -6,6 +6,11 @@ use App\Models\Group;
use App\Models\Settings;
use Illuminate\Support\Facades\DB;
/**
* Class Backfill
*
* @package Blacklight
*/
class Backfill
{
/**
+7 -10
View File
@@ -7,11 +7,12 @@ use App\Models\Settings;
use Illuminate\Support\Carbon;
use App\Models\BinaryBlacklist;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Database\QueryException;
/**
* Class Binaries.
* Class Binaries
*
* @package Blacklight
*/
class Binaries
{
@@ -740,7 +741,6 @@ class Binaries
*
*
* @param array $headers
* @param bool $multiGroup
*
* @throws \Exception
* @throws \Throwable
@@ -770,16 +770,13 @@ class Binaries
$fileCount[1] = $fileCount[3] = 0;
}
$ckName = '';
$ckId = '';
$collMatch = $this->_collectionsCleaning->collectionsCleaner(
$this->header['matches'][1],
$ckName
''
);
// Used to group articles together when forming the release. MGR requires this to be group irrespective
$this->header['CollectionKey'] = $collMatch['name'].$ckId.$fileCount[3];
// Used to group articles together when forming the release.
$this->header['CollectionKey'] = $collMatch['name'].$fileCount[3];
// If this header's collection key isn't in memory, attempt to insert the collection
if (! isset($collectionIDs[$this->header['CollectionKey']])) {
@@ -826,7 +823,7 @@ class Binaries
$collectionID = $collectionIDs[$this->header['CollectionKey']];
}
// MGR or Standard, Binary Hash should be unique to the group
// Binary Hash should be unique to the group
$hash = md5($this->header['matches'][1].$this->header['From'].$this->groupMySQL['id']);
$binaryID = false;
+5
View File
@@ -19,6 +19,11 @@ use ApaiIO\ResponseTransformer\XmlToSimpleXmlObject;
use DariusIII\ItunesApi\Exceptions\EbookNotFoundException;
use DariusIII\ItunesApi\Exceptions\SearchNoResultsException;
/**
* Class Books
*
* @package Blacklight
*/
class Books
{
/**
+3
View File
@@ -9,7 +9,10 @@ use App\Models\Settings;
/**
* Categorizing of releases by name/group.
*
*
* Class Categorize
*
* @package Blacklight
*/
class Categorize
{
+14 -25
View File
@@ -5,7 +5,10 @@ namespace Blacklight;
/**
* Cleans names for collections/imports/namefixer.
*
*
* Class CollectionsCleaning
*
* @package Blacklight
*/
class CollectionsCleaning
{
@@ -77,34 +80,27 @@ class CollectionsCleaning
protected $_regexes;
/**
* @param array $options Class instances.
* CollectionsCleaning constructor.
*
* @throws \Exception
*/
public function __construct(array $options = [])
public function __construct()
{
// Extensions.
$this->e0 = self::REGEX_FILE_EXTENSIONS;
$this->e1 = self::REGEX_FILE_EXTENSIONS.self::REGEX_END;
$this->e2 = self::REGEX_FILE_EXTENSIONS.self::REGEX_SUBJECT_SIZE.self::REGEX_END;
$defaults = [
'Settings' => null,
];
$options += $defaults;
$this->_regexes = new Regexes(['Table_Name' => 'collection_regexes']);
}
/**
* Cleans a usenet subject returning a string that can be used to "merge" files together, a pretty subject, a categoryID and the name status.
*
* @param string $subject Subject to parse.
* @param string $groupName Group to work in.
*
* @return array The ID of the Regex Matched and the cleaned collection name
* @param $subject
* @param $groupName
* @return array
* @throws \Exception
*/
public function collectionsCleaner($subject, $groupName): ?array
public function collectionsCleaner($subject, $groupName): array
{
$this->subject = $subject;
$this->groupName = $groupName;
@@ -118,23 +114,16 @@ class CollectionsCleaning
];
}
switch ($groupName) {
/*
case 'alt.binaries.this.is.an.example':
return $this->_example_method_name();
*/
case null:
default:
return $this->generic();
}
return $this->generic();
}
/**
* Cleans usenet subject before inserting, used for collectionhash. If no regexes matched on collectionsCleaner.
*
* @return array|null
*
* @return array
*/
protected function generic(): ?array
protected function generic(): array
{
// For non music groups.
if (! preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) {
+5
View File
@@ -4,6 +4,11 @@ namespace Blacklight;
use League\CLImate\CLImate;
/**
* Class ColorCLI
*
* @package Blacklight
*/
class ColorCLI
{
/**
+3 -1
View File
@@ -21,7 +21,9 @@ use ApaiIO\Configuration\GenericConfiguration;
use ApaiIO\ResponseTransformer\XmlToSimpleXmlObject;
/**
* Class Console.
* Class Console
*
* @package Blacklight
*/
class Console
{
+3 -1
View File
@@ -3,7 +3,9 @@
namespace Blacklight;
/**
* Class ConsoleTools.
* Class ConsoleTools
*
* @package Blacklight
*/
class ConsoleTools
{
+5
View File
@@ -5,6 +5,11 @@ namespace Blacklight;
use App\Models\User;
use App\Models\Content;
/**
* Class Contents
*
* @package Blacklight
*/
class Contents
{
public const TYPEUSEFUL = 1;
+3 -1
View File
@@ -24,7 +24,9 @@ namespace Blacklight;
use GuzzleHttp\Client;
/**
* Class CouchPotato.
* Class CouchPotato
*
* @package Blacklight
*/
class CouchPotato
{
+5
View File
@@ -15,6 +15,11 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use GuzzleHttp\Exception\ClientException;
/**
* Class Games
*
* @package Blacklight
*/
class Games
{
protected const GAME_MATCH_PERCENTAGE = 85;
+5
View File
@@ -7,6 +7,11 @@ use App\Models\Category;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
/**
* Class Genres
*
* @package Blacklight
*/
class Genres
{
public const CONSOLE_TYPE = Category::GAME_ROOT;
+3
View File
@@ -7,7 +7,10 @@ use Blacklight\utility\Utility;
/**
* Basic IRC client for fetching IRCScraper.
*
*
* Class IRCClient
*
* @package Blacklight
*/
class IRCClient
{
+3 -1
View File
@@ -8,7 +8,9 @@ use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
/**
* Class IRCScraper.
* Class IRCScraper
*
* @package Blacklight
*/
class IRCScraper extends IRCClient
{
+3 -1
View File
@@ -25,7 +25,9 @@ use DariusIII\ItunesApi\Exceptions\MovieNotFoundException;
use DariusIII\ItunesApi\Exceptions\SearchNoResultsException;
/**
* Class Movie.
* Class Movie
*
* @package Blacklight
*/
class Movie
{
+3 -1
View File
@@ -22,7 +22,9 @@ use DariusIII\ItunesApi\Exceptions\ArtistNotFoundException;
use DariusIII\ItunesApi\Exceptions\SearchNoResultsException;
/**
* Class Music.
* Class Music
*
* @package Blacklight
*/
class Music
{
+5
View File
@@ -9,6 +9,11 @@ use App\Extensions\util\PhpYenc;
* Class for connecting to the usenet, retrieving articles and article headers,
* decoding yEnc articles, decompressing article headers.
* Extends PEAR's Net_NNTP_Client class, overrides some functions.
*
*
* Class NNTP
*
* @package Blacklight
*/
class NNTP extends \Net_NNTP_Client
{
+5
View File
@@ -9,6 +9,11 @@ use Illuminate\Support\Facades\File;
/**
* Class for reading and writing NZB files on the hard disk,
* building folder paths to store the NZB files.
*
*
* Class NZB
*
* @package Blacklight
*/
class NZB
{
+3
View File
@@ -10,7 +10,10 @@ use Blacklight\processing\PostProcess;
/**
* Gets information contained within the NZB.
*
*
* Class NZBContents
*
* @package Blacklight
*/
class NZBContents
{
+3 -1
View File
@@ -7,7 +7,9 @@ use Blacklight\utility\Utility;
use Illuminate\Support\Facades\File;
/**
* Class NZBExport.
* Class NZBExport
*
* @package Blacklight
*/
class NZBExport
{
+5 -2
View File
@@ -8,9 +8,12 @@ use GuzzleHttp\Psr7\Request;
use Blacklight\utility\Utility;
/**
* Class NZBGet.
*
* Transfers data between an NZBGet server and a nntmux website.
*
*
* Class NZBGet
*
* @package Blacklight
*/
class NZBGet
{
+3 -2
View File
@@ -9,8 +9,9 @@ use Blacklight\utility\Utility;
use Illuminate\Support\Facades\File;
/**
* Import NZB files into the database.
* Class NZBImport.
* Class NZBImport
*
* @package Blacklight
*/
class NZBImport
{
+7 -2
View File
@@ -5,10 +5,15 @@ namespace Blacklight;
use Page;
use App\Models\User;
/**
* Class NZBVortex
*
* @package Blacklight
*/
final class NZBVortex
{
protected $nonce = null;
protected $session = null;
private $nonce = null;
private $session = null;
public function __construct()
{
+3 -1
View File
@@ -10,7 +10,9 @@ use Blacklight\utility\Utility;
use Blacklight\processing\PostProcess;
/**
* Class NameFixer.
* Class NameFixer
*
* @package Blacklight
*/
class NameFixer
{
+2 -1
View File
@@ -14,7 +14,8 @@ use Blacklight\processing\PostProcess;
/**
* Class Nfo
* Class for handling fetching/storing of NFO files.
*
* @package Blacklight
*/
class Nfo
{
+5
View File
@@ -10,6 +10,11 @@ use App\Models\CollectionRegex;
use App\Models\ReleaseNamingRegex;
use Illuminate\Support\Facades\DB;
/**
* Class Regexes
*
* @package Blacklight
*/
class Regexes
{
/**
+5
View File
@@ -7,6 +7,11 @@ use App\Models\Predb;
/**
* Cleans names for releases/imports/namefixer.
* Names of group functions should match between CollectionsCleaning and this file.
*
*
* Class ReleaseCleaning
*
* @package Blacklight
*/
class ReleaseCleaning
{
+5
View File
@@ -10,6 +10,11 @@ use App\Models\ReleaseExtraFull;
use Illuminate\Support\Facades\DB;
use Mhor\MediaInfo\Container\MediaInfoContainer;
/**
* Class ReleaseExtra
*
* @package Blacklight
*/
class ReleaseExtra
{
/**
+3
View File
@@ -12,7 +12,10 @@ use Intervention\Image\Exception\NotWritableException;
/**
* Resize/save/delete images to disk.
*
*
* Class ReleaseImage
*
* @package Blacklight
*/
class ReleaseImage
{
+3
View File
@@ -8,7 +8,10 @@ use Illuminate\Support\Facades\DB;
/**
* Handles removing of various unwanted releases.
*
*
* Class ReleaseRemover
*
* @package Blacklight
*/
class ReleaseRemover
{
+5
View File
@@ -2,6 +2,11 @@
namespace Blacklight;
/**
* Class ReleaseSearch
*
* @package Blacklight
*/
class ReleaseSearch
{
/**
+3 -1
View File
@@ -13,7 +13,9 @@ use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Cache;
/**
* Class Releases.
* Class Releases
*
* @package Blacklight
*/
class Releases
{
+3 -1
View File
@@ -6,7 +6,9 @@ use GuzzleHttp\Client;
use App\Models\Settings;
/**
* Class SABnzbd.
* Class SABnzbd
*
* @package Blacklight
*/
class SABnzbd
{
+3 -1
View File
@@ -5,7 +5,9 @@ namespace Blacklight;
use Illuminate\Support\Facades\DB;
/**
* Class Sharing.
* Class Sharing
*
* @package Blacklight
*/
class Sharing
{
+5
View File
@@ -9,6 +9,11 @@ use Foolz\SphinxQL\SphinxQL;
use Illuminate\Support\Facades\DB;
use Foolz\SphinxQL\Drivers\Pdo\Connection;
/**
* Class SphinxSearch
*
* @package Blacklight
*/
class SphinxSearch
{
/**
+5
View File
@@ -6,6 +6,11 @@ use App\Models\Settings;
use App\Models\SteamApp;
use b3rs3rk\steamfront\Main;
/**
* Class Steam
*
* @package Blacklight
*/
class Steam
{
private const STEAM_MATCH_PERCENTAGE = 90;
+3 -1
View File
@@ -7,7 +7,9 @@ use App\Models\Settings;
use Illuminate\Support\Facades\DB;
/**
* Class Tmux.
* Class Tmux
*
* @package Blacklight
*/
class Tmux
{
+3
View File
@@ -7,7 +7,10 @@ use App\Extensions\util\Git;
/**
* Tmux output functions for printing monitor data.
*
*
* Class TmuxOutput
*
* @package Blacklight
*/
class TmuxOutput extends Tmux
{
+3
View File
@@ -8,7 +8,10 @@ use Illuminate\Support\Facades\DB;
/**
* Tmux pane shell exec functions for pane respawning.
*
*
* Class TmuxRun
*
* @package Blacklight
*/
class TmuxRun extends Tmux
{
+3 -1
View File
@@ -16,7 +16,9 @@ use Blacklight\processing\adult\Popporn;
use Blacklight\processing\adult\Hotmovies;
/**
* Class XXX.
* Class XXX
*
* @package Blacklight
*/
class XXX
{
+1
View File
@@ -1,4 +1,5 @@
2019-01-01 DariusIII
* Chg: Update all the \Blacklight namespace classes with class PHPDOC block
* Chg: Update friendsofphp/php-cs-fixer to version 2.13.2
* Fix: Fix NZB creation
* Fix: Fix typo in ProcessReleases class