Fix couple of occurences of missed DS constant usage

This commit is contained in:
DariusIII
2023-04-01 23:05:58 +02:00
parent 2bd4f78a11
commit e577141d87
5 changed files with 15 additions and 25 deletions
+9 -20
View File
@@ -5,33 +5,22 @@ namespace Blacklight;
use App\Models\UsenetGroup;
use Blacklight\utility\Utility;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
/**
* Class NZBExport.
*/
class NZBExport
{
/**
* @var mixed
*/
protected $browser;
protected mixed $browser;
protected $retVal;
/**
* @var NZB
*/
protected $nzb;
protected NZB $nzb;
/**
* @var Releases
*/
protected $releases;
protected Releases $releases;
/**
* @var bool
*/
protected $echoCLI;
protected bool $echoCLI;
/**
* NZBExport constructor.
@@ -70,8 +59,8 @@ class NZBExport
$path = $params[0];
// Check if the path ends with dir separator.
if (substr($path, -1) !== DS) {
$path .= DS;
if (! Str::endsWith($path, '/')) {
$path .= '/';
}
// Check if it's a directory.
@@ -202,9 +191,9 @@ class NZBExport
}
/**
* @return bool|string
* @return true
*/
protected function returnValue()
protected function returnValue(): bool
{
return $this->browser ? $this->retVal : true;
}
+1 -1
View File
@@ -78,7 +78,7 @@ class Nfo
$this->tmpPath = (string) Settings::settingValue('..tmpunrarpath');
if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) {
$this->tmpPath .= DS;
$this->tmpPath .= '/';
}
}
@@ -428,7 +428,7 @@ class ProcessAdditional
// Check if it ends with a dir separator.
if (! preg_match('/[\/\\\\]$/', $this->_mainTmpPath)) {
$this->_mainTmpPath .= DS;
$this->_mainTmpPath .= '/';
}
// If we are doing per group, use the groupID has a inner path, so other scripts don't delete the files we are working on.
@@ -7,6 +7,7 @@ use Blacklight\NZBExport;
use Blacklight\NZBImport;
use Blacklight\Releases;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
class AdminNzbController extends BasePageController
{
@@ -39,8 +40,8 @@ class AdminNzbController extends BasePageController
// Get the path the user set in the browser if he put one.
$path = ($request->has('folder') ? $request->input('folder') : '');
if (substr($path, \strlen($path) - 1) !== DS) {
$path .= DS;
if (! Str::endsWith($path, '/')) {
$path .= '/';
}
// Get the files from the user specified path.
+1 -1
View File
@@ -35,6 +35,6 @@ $NE->beginExport(
// Group ID.
(strtolower($argv[4]) === 'false' ? 0 : (int) $argv[4]),
// Gzip.
(strtolower($argv[5]) === 'true' ? true : false),
strtolower($argv[5]) === 'true',
]
);