mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Ran phpcbf and updated phpcs.xml
This commit is contained in:
parent
9a3e1490ff
commit
98a1e57ba9
@ -6,6 +6,7 @@ use BookStack\Auth\User;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
@ -23,7 +24,7 @@ class Activity extends Model
|
||||
/**
|
||||
* Get the entity for this activity.
|
||||
*/
|
||||
public function entity()
|
||||
public function entity(): MorphTo
|
||||
{
|
||||
if ($this->entity_type === '') {
|
||||
$this->entity_type = null;
|
||||
|
@ -48,4 +48,4 @@ class ActivityType
|
||||
const AUTH_PASSWORD_RESET_UPDATE = 'auth_password_reset_update';
|
||||
const AUTH_LOGIN = 'auth_login';
|
||||
const AUTH_REGISTER = 'auth_register';
|
||||
}
|
||||
}
|
||||
|
@ -142,5 +142,4 @@ class ApiDocsGenerator
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -163,4 +163,4 @@ class ApiTokenGuard implements Guard
|
||||
{
|
||||
$this->user = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -299,5 +299,4 @@ class ExternalBaseSessionGuard implements StatefulGuard
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ class LdapSessionGuard extends ExternalBaseSessionGuard
|
||||
/**
|
||||
* LdapSessionGuard constructor.
|
||||
*/
|
||||
public function __construct($name,
|
||||
public function __construct(
|
||||
$name,
|
||||
UserProvider $provider,
|
||||
Session $session,
|
||||
LdapService $ldapService,
|
||||
RegistrationService $registrationService
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->ldapService = $ldapService;
|
||||
parent::__construct($name, $provider, $session, $registrationService);
|
||||
}
|
||||
@ -119,5 +119,4 @@ class LdapSessionGuard extends ExternalBaseSessionGuard
|
||||
|
||||
return $this->registrationService->registerUser($details, null, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,5 +34,4 @@ class Saml2SessionGuard extends ExternalBaseSessionGuard
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,6 @@ class RegistrationService
|
||||
$message = trans('auth.email_confirm_send_error');
|
||||
throw new UserRegistrationException($message, '/register/confirm');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $newUser;
|
||||
@ -109,5 +108,4 @@ class RegistrationService
|
||||
throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), $redirect);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,4 @@ class CustomStrikeThroughExtension implements ExtensionInterface
|
||||
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
|
||||
$environment->addInlineRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,4 @@ class CustomStrikethroughRenderer implements InlineRendererInterface
|
||||
|
||||
return new HtmlElement('s', $inline->getData('attributes', []), $htmlRenderer->renderInlines($inline->children()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,5 +137,4 @@ class SearchOptions
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace BookStack\Exceptions;
|
||||
|
||||
class ApiAuthException extends UnauthorizedException {
|
||||
class ApiAuthException extends UnauthorizedException
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,4 @@ class JsonDebugException extends Exception
|
||||
{
|
||||
return response()->json($this->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,4 +14,4 @@ class UnauthorizedException extends Exception
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,4 @@ abstract class ApiController extends Controller
|
||||
{
|
||||
return $this->rules;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,5 +25,4 @@ class ApiDocsController extends ApiController
|
||||
$docs = ApiDocsGenerator::generateConsideringCache();
|
||||
return response()->json($docs);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -91,4 +91,4 @@ class BookApiController extends ApiController
|
||||
$this->bookRepo->destroy($book);
|
||||
return response('', 204);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -112,4 +112,4 @@ class BookshelfApiController extends ApiController
|
||||
$this->bookshelfRepo->destroy($shelf);
|
||||
return response('', 204);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,5 +195,4 @@ class LoginController extends Controller
|
||||
|
||||
return redirect('/login');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,5 +117,4 @@ class RegisterController extends Controller
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,5 +82,4 @@ class Saml2Controller extends Controller
|
||||
|
||||
return redirect()->intended();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -140,5 +140,4 @@ class UserApiTokenController extends Controller
|
||||
$token = ApiToken::query()->where('user_id', '=', $user->id)->where('id', '=', $tokenId)->firstOrFail();
|
||||
return [$user, $token];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,4 +33,4 @@ trait ChecksForEmailConfirmation
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,5 +14,4 @@ class ThrottleApiRequests extends Middleware
|
||||
{
|
||||
return (int) config('api.requests_per_minute');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,4 @@ interface Loggable
|
||||
* Get the string descriptor for this item.
|
||||
*/
|
||||
public function logDescriptor(): string;
|
||||
}
|
||||
}
|
||||
|
@ -17,5 +17,4 @@ class TranslationServiceProvider extends BaseProvider
|
||||
return new FileLoader($app['files'], $app['path.lang']);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class SettingService
|
||||
*/
|
||||
protected function formatArrayValue(array $value): string
|
||||
{
|
||||
$values = collect($value)->values()->filter(function(array $item) {
|
||||
$values = collect($value)->values()->filter(function (array $item) {
|
||||
return count(array_filter($item)) > 0;
|
||||
});
|
||||
return json_encode($values);
|
||||
|
@ -24,5 +24,4 @@ trait HasCreatorAndUpdater
|
||||
{
|
||||
return $this->belongsTo(User::class, 'updated_by');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,5 +15,4 @@ trait HasOwner
|
||||
{
|
||||
return $this->belongsTo(User::class, 'owned_by');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,4 +27,4 @@ class FileLoader extends BaseLoader
|
||||
|
||||
return $this->loadNamespaced($locale, $group, $namespace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,8 +70,7 @@ class ImageRepo
|
||||
int $uploadedTo = null,
|
||||
string $search = null,
|
||||
callable $whereClause = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
|
||||
|
||||
if ($uploadedTo !== null) {
|
||||
@ -102,8 +101,7 @@ class ImageRepo
|
||||
int $pageSize = 24,
|
||||
int $uploadedTo = null,
|
||||
string $search = null
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
$contextPage = $this->page->findOrFail($uploadedTo);
|
||||
$parentFilter = null;
|
||||
|
||||
|
@ -97,5 +97,4 @@ class UserAvatars
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
<ruleset name="PHP_CodeSniffer">
|
||||
<ruleset name="BookStack Standard">
|
||||
<!-- Format described at: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset -->
|
||||
<description>The coding standard for BookStack.</description>
|
||||
<file>app</file>
|
||||
<config name="php_version" value="70205"/>
|
||||
<file>./app</file>
|
||||
<exclude-pattern>*/migrations/*</exclude-pattern>
|
||||
<exclude-pattern>*/tests/*</exclude-pattern>
|
||||
<arg value="np"/>
|
||||
<arg name="colors"/>
|
||||
<rule ref="PSR2"/>
|
||||
</ruleset>
|
Loading…
Reference in New Issue
Block a user