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