Applied StyleCI changes, added php/larastan to attribution
This commit is contained in:
parent
bc291bee78
commit
5c6a6b50a0
|
@ -34,7 +34,7 @@ jobs:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-composer-${{ matrix.php }}
|
key: ${{ runner.os }}-composer-${{ matrix.php }}
|
||||||
|
|
||||||
- name: Install composer dependencies & Test
|
- name: Install composer dependencies
|
||||||
run: composer install --prefer-dist --no-interaction --ansi
|
run: composer install --prefer-dist --no-interaction --ansi
|
||||||
|
|
||||||
- name: Run PHPStan
|
- name: Run PHPStan
|
||||||
|
|
|
@ -45,7 +45,7 @@ jobs:
|
||||||
mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
|
mysql -uroot -proot -e "GRANT ALL ON \`bookstack-test\`.* TO 'bookstack-test'@'localhost';"
|
||||||
mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
|
mysql -uroot -proot -e 'FLUSH PRIVILEGES;'
|
||||||
|
|
||||||
- name: Install composer dependencies & Test
|
- name: Install composer dependencies
|
||||||
run: composer install --prefer-dist --no-interaction --ansi
|
run: composer install --prefer-dist --no-interaction --ansi
|
||||||
|
|
||||||
- name: Migrate and seed the database
|
- name: Migrate and seed the database
|
||||||
|
|
|
@ -28,7 +28,7 @@ class ApiDocsGenerator
|
||||||
if (Cache::has($cacheKey) && config('app.env') === 'production') {
|
if (Cache::has($cacheKey) && config('app.env') === 'production') {
|
||||||
$docs = Cache::get($cacheKey);
|
$docs = Cache::get($cacheKey);
|
||||||
} else {
|
} else {
|
||||||
$docs = (new ApiDocsGenerator)->generate();
|
$docs = (new ApiDocsGenerator())->generate();
|
||||||
Cache::put($cacheKey, $docs, 60 * 24);
|
Cache::put($cacheKey, $docs, 60 * 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,4 +48,4 @@ return [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -58,10 +58,10 @@ return [
|
||||||
|
|
||||||
'memcached' => [
|
'memcached' => [
|
||||||
'driver' => 'memcached',
|
'driver' => 'memcached',
|
||||||
'options' => [
|
'options' => [
|
||||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||||
],
|
],
|
||||||
'servers' => $memcachedServers ?? [],
|
'servers' => $memcachedServers ?? [],
|
||||||
],
|
],
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
|
|
|
@ -51,11 +51,13 @@ class CreateAdmin extends Command
|
||||||
}
|
}
|
||||||
if (mb_strlen($email) < 5 || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if (mb_strlen($email) < 5 || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
$this->error('Invalid email address provided');
|
$this->error('Invalid email address provided');
|
||||||
|
|
||||||
return SymfonyCommand::FAILURE;
|
return SymfonyCommand::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->userRepo->getByEmail($email) !== null) {
|
if ($this->userRepo->getByEmail($email) !== null) {
|
||||||
$this->error('A user with the provided email already exists!');
|
$this->error('A user with the provided email already exists!');
|
||||||
|
|
||||||
return SymfonyCommand::FAILURE;
|
return SymfonyCommand::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +67,7 @@ class CreateAdmin extends Command
|
||||||
}
|
}
|
||||||
if (mb_strlen($name) < 2) {
|
if (mb_strlen($name) < 2) {
|
||||||
$this->error('Invalid name provided');
|
$this->error('Invalid name provided');
|
||||||
|
|
||||||
return SymfonyCommand::FAILURE;
|
return SymfonyCommand::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +77,7 @@ class CreateAdmin extends Command
|
||||||
}
|
}
|
||||||
if (mb_strlen($password) < 5) {
|
if (mb_strlen($password) < 5) {
|
||||||
$this->error('Invalid password provided, Must be at least 5 characters');
|
$this->error('Invalid password provided, Must be at least 5 characters');
|
||||||
|
|
||||||
return SymfonyCommand::FAILURE;
|
return SymfonyCommand::FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +88,7 @@ class CreateAdmin extends Command
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$this->info("Admin account with email \"{$user->email}\" successfully created!");
|
$this->info("Admin account with email \"{$user->email}\" successfully created!");
|
||||||
|
|
||||||
return SymfonyCommand::SUCCESS;
|
return SymfonyCommand::SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ class SearchOptions
|
||||||
public static function fromString(string $search): self
|
public static function fromString(string $search): self
|
||||||
{
|
{
|
||||||
$decoded = static::decode($search);
|
$decoded = static::decode($search);
|
||||||
$instance = new SearchOptions;
|
$instance = new SearchOptions();
|
||||||
foreach ($decoded as $type => $value) {
|
foreach ($decoded as $type => $value) {
|
||||||
$instance->$type = $value;
|
$instance->$type = $value;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class SearchOptions
|
||||||
return static::fromString($request->get('term'));
|
return static::fromString($request->get('term'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$instance = new SearchOptions;
|
$instance = new SearchOptions();
|
||||||
$inputs = $request->only(['search', 'types', 'filters', 'exact', 'tags']);
|
$inputs = $request->only(['search', 'types', 'filters', 'exact', 'tags']);
|
||||||
$instance->searches = explode(' ', $inputs['search'] ?? []);
|
$instance->searches = explode(' ', $inputs['search'] ?? []);
|
||||||
$instance->exacts = array_filter($inputs['exact'] ?? []);
|
$instance->exacts = array_filter($inputs['exact'] ?? []);
|
||||||
|
|
|
@ -217,4 +217,5 @@ These are the great open-source projects used to help build BookStack:
|
||||||
* [pragmarx/google2fa](https://github.com/antonioribeiro/google2fa)
|
* [pragmarx/google2fa](https://github.com/antonioribeiro/google2fa)
|
||||||
* [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode)
|
* [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode)
|
||||||
* [phpseclib](https://github.com/phpseclib/phpseclib)
|
* [phpseclib](https://github.com/phpseclib/phpseclib)
|
||||||
* [Clockwork](https://github.com/itsgoingd/clockwork)
|
* [Clockwork](https://github.com/itsgoingd/clockwork)
|
||||||
|
* [PHPStan](https://phpstan.org/) & [Larastan](https://github.com/nunomaduro/larastan)
|
Loading…
Reference in New Issue