mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-07-16 16:22:44 +00:00
Ran phpcbf and updated helpers typehinting
This commit is contained in:
parent
b1566099a3
commit
be08dc1588
|
@ -20,5 +20,4 @@ class Application extends \Illuminate\Foundation\Application
|
|||
. 'Config'
|
||||
. ($path ? DIRECTORY_SEPARATOR.$path : $path);
|
||||
}
|
||||
|
||||
}
|
|
@ -36,5 +36,4 @@ class EmailConfirmationService extends UserTokenService
|
|||
return setting('registration-confirmation')
|
||||
|| setting('registration-restrict');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,5 +19,4 @@ class UserInviteService extends UserTokenService
|
|||
$token = $this->createTokenForUser($user);
|
||||
$user->notify(new UserInvite($token));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -131,5 +131,4 @@ class UserTokenService
|
|||
return Carbon::now()->subHours($this->expiryTime)
|
||||
->gt(new Carbon($tokenEntry->created_at));
|
||||
}
|
||||
|
||||
}
|
|
@ -14,8 +14,12 @@ if (env('CACHE_DRIVER') === 'memcached') {
|
|||
$memcachedServers = explode(',', trim(env('MEMCACHED_SERVERS', '127.0.0.1:11211:100'), ','));
|
||||
foreach ($memcachedServers as $index => $memcachedServer) {
|
||||
$memcachedServerDetails = explode(':', $memcachedServer);
|
||||
if (count($memcachedServerDetails) < 2) $memcachedServerDetails[] = '11211';
|
||||
if (count($memcachedServerDetails) < 3) $memcachedServerDetails[] = '100';
|
||||
if (count($memcachedServerDetails) < 2) {
|
||||
$memcachedServerDetails[] = '11211';
|
||||
}
|
||||
if (count($memcachedServerDetails) < 3) {
|
||||
$memcachedServerDetails[] = '100';
|
||||
}
|
||||
$memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
// REDIS
|
||||
// Split out configuration into an array
|
||||
if (env('REDIS_SERVERS', false)) {
|
||||
|
||||
$redisDefaults = ['host' => '127.0.0.1', 'port' => '6379', 'database' => '0', 'password' => null];
|
||||
$redisServers = explode(',', trim(env('REDIS_SERVERS', '127.0.0.1:6379:0'), ','));
|
||||
$redisConfig = ['client' => 'predis'];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php namespace BookStack\Exceptions;
|
||||
|
||||
class UserTokenExpiredException extends \Exception {
|
||||
class UserTokenExpiredException extends \Exception
|
||||
{
|
||||
|
||||
public $userId;
|
||||
|
||||
|
@ -14,6 +15,4 @@ class UserTokenExpiredException extends \Exception {
|
|||
$this->userId = $userId;
|
||||
parent::__construct($message);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
<?php namespace BookStack\Exceptions;
|
||||
|
||||
class UserTokenNotFoundException extends \Exception {}
|
||||
class UserTokenNotFoundException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,6 @@ class ConfirmEmailController extends Controller
|
|||
try {
|
||||
$userId = $this->emailConfirmationService->checkTokenAndGetUserId($token);
|
||||
} catch (Exception $exception) {
|
||||
|
||||
if ($exception instanceof UserTokenNotFoundException) {
|
||||
session()->flash('error', trans('errors.email_confirmation_invalid'));
|
||||
return redirect('/register');
|
||||
|
@ -114,5 +113,4 @@ class ConfirmEmailController extends Controller
|
|||
session()->flash('success', trans('auth.email_confirm_resent'));
|
||||
return redirect('/register/confirm');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -102,5 +102,4 @@ class UserInviteController extends Controller
|
|||
|
||||
throw $exception;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,5 +59,4 @@ class PageTemplateController extends Controller
|
|||
'markdown' => $page->markdown,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,5 +22,4 @@ class Request extends LaravelRequest
|
|||
|
||||
return $base;
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,7 @@ use BookStack\Settings\SettingService;
|
|||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
function versioned_asset($file = '') : string
|
||||
function versioned_asset(string $file = ''): string
|
||||
{
|
||||
static $version = null;
|
||||
|
||||
|
@ -96,7 +96,7 @@ function userCanOnAny(string $permission, string $entityClass = null) : bool
|
|||
* @param bool $default
|
||||
* @return bool|string|SettingService
|
||||
*/
|
||||
function setting($key = null, $default = false)
|
||||
function setting(string $key = null, bool $default = false)
|
||||
{
|
||||
$settingService = resolve(SettingService::class);
|
||||
if (is_null($key)) {
|
||||
|
@ -110,7 +110,7 @@ function setting($key = null, $default = false)
|
|||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
function theme_path($path = '') : string
|
||||
function theme_path(string $path = ''): string
|
||||
{
|
||||
$theme = config('view.theme');
|
||||
if (!$theme) {
|
||||
|
@ -130,7 +130,7 @@ function theme_path($path = '') : string
|
|||
* @param array $attrs
|
||||
* @return mixed
|
||||
*/
|
||||
function icon($name, $attrs = [])
|
||||
function icon(string $name, array $attrs = []): string
|
||||
{
|
||||
$attrs = array_merge([
|
||||
'class' => 'svg-icon',
|
||||
|
@ -158,12 +158,12 @@ function icon($name, $attrs = [])
|
|||
* Generate a url with multiple parameters for sorting purposes.
|
||||
* Works out the logic to set the correct sorting direction
|
||||
* Discards empty parameters and allows overriding.
|
||||
* @param $path
|
||||
* @param string $path
|
||||
* @param array $data
|
||||
* @param array $overrideData
|
||||
* @return string
|
||||
*/
|
||||
function sortUrl($path, $data, $overrideData = [])
|
||||
function sortUrl(string $path, array $data, array $overrideData = []): string
|
||||
{
|
||||
$queryStringSections = [];
|
||||
$queryData = array_merge($data, $overrideData);
|
||||
|
|
Loading…
Reference in New Issue
Block a user