use BookStack\Entities\Models\Entity;
use BookStack\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Support\Str;
/**
/**
* Get the entity for this activity.
*/
- public function entity()
+ public function entity(): MorphTo
{
if ($this->entity_type === '') {
$this->entity_type = null;
const AUTH_PASSWORD_RESET_UPDATE = 'auth_password_reset_update';
const AUTH_LOGIN = 'auth_login';
const AUTH_REGISTER = 'auth_register';
-}
\ No newline at end of file
+}
];
});
}
-
-}
\ No newline at end of file
+}
{
$this->user = null;
}
-}
\ No newline at end of file
+}
/**
* 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);
}
return $this->registrationService->registerUser($details, null, false);
}
-
}
$message = trans('auth.email_confirm_send_error');
throw new UserRegistrationException($message, '/register/confirm');
}
-
}
return $newUser;
throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), $redirect);
}
}
-
-}
\ No newline at end of file
+}
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
$environment->addInlineRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
}
-}
\ No newline at end of file
+}
return new HtmlElement('s', $inline->getData('attributes', []), $htmlRenderer->renderInlines($inline->children()));
}
-}
\ No newline at end of file
+}
return $string;
}
-
-}
\ No newline at end of file
+}
namespace BookStack\Exceptions;
-class ApiAuthException extends UnauthorizedException {
+class ApiAuthException extends UnauthorizedException
+{
-}
\ No newline at end of file
+}
{
return response()->json($this->data);
}
-}
\ No newline at end of file
+}
{
parent::__construct($message, $code);
}
-}
\ No newline at end of file
+}
{
return $this->rules;
}
-}
\ No newline at end of file
+}
$docs = ApiDocsGenerator::generateConsideringCache();
return response()->json($docs);
}
-
}
$this->bookRepo->destroy($book);
return response('', 204);
}
-}
\ No newline at end of file
+}
$this->bookshelfRepo->destroy($shelf);
return response('', 204);
}
-}
\ No newline at end of file
+}
return redirect('/login');
}
-
}
'password' => Hash::make($data['password']),
]);
}
-
}
return redirect()->intended();
}
-
}
$token = ApiToken::query()->where('user_id', '=', $user->id)->where('id', '=', $tokenId)->firstOrFail();
return [$user, $token];
}
-
}
return false;
}
-}
\ No newline at end of file
+}
{
return (int) config('api.requests_per_minute');
}
-
-}
\ No newline at end of file
+}
* Get the string descriptor for this item.
*/
public function logDescriptor(): string;
-}
\ No newline at end of file
+}
return new FileLoader($app['files'], $app['path.lang']);
});
}
-
-}
\ No newline at end of file
+}
*/
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);
{
return $this->belongsTo(User::class, 'updated_by');
}
-
}
{
return $this->belongsTo(User::class, 'owned_by');
}
-
}
return $this->loadNamespaced($locale, $group, $namespace);
}
-}
\ No newline at end of file
+}
int $uploadedTo = null,
string $search = null,
callable $whereClause = null
- ): array
- {
+ ): array {
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
if ($uploadedTo !== null) {
int $pageSize = 24,
int $uploadedTo = null,
string $search = null
- ): array
- {
+ ): array {
$contextPage = $this->page->findOrFail($uploadedTo);
$parentFilter = null;
return $url;
}
-
-}
\ No newline at end of file
+}
<?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>
\ No newline at end of file