Applied StyleCi changes, updated php deps

This commit is contained in:
Dan Brown 2022-08-29 17:46:41 +01:00
parent e537d0c4e8
commit 1cc7c649dc
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
26 changed files with 435 additions and 526 deletions

View File

@ -31,7 +31,7 @@ class OidcOAuthProvider extends AbstractProvider
protected $tokenEndpoint;
/**
* Scopes to use for the OIDC authorization call
* Scopes to use for the OIDC authorization call.
*/
protected array $scopes = ['openid', 'profile', 'email'];

View File

@ -2,9 +2,8 @@
namespace BookStack\Auth\Access\Oidc;
use BookStack\Auth\Access\GroupSyncService;
use Illuminate\Support\Arr;
use function auth;
use BookStack\Auth\Access\GroupSyncService;
use BookStack\Auth\Access\LoginService;
use BookStack\Auth\Access\RegistrationService;
use BookStack\Auth\User;
@ -12,6 +11,7 @@ use BookStack\Exceptions\JsonDebugException;
use BookStack\Exceptions\StoppedAuthenticationException;
use BookStack\Exceptions\UserRegistrationException;
use function config;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Cache;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
@ -38,8 +38,7 @@ class OidcService
LoginService $loginService,
HttpClient $httpClient,
GroupSyncService $groupService
)
{
) {
$this->registrationService = $registrationService;
$this->loginService = $loginService;
$this->httpClient = $httpClient;

View File

@ -58,6 +58,7 @@ class RegenerateCommentContent extends Command
DB::setDefaultConnection($connection);
$this->comment('Comment HTML content has been regenerated');
return 0;
}
}

View File

@ -50,6 +50,7 @@ class RegeneratePermissions extends Command
DB::setDefaultConnection($connection);
$this->comment('Permissions regenerated');
return 0;
}
}

View File

@ -53,6 +53,7 @@ class RegenerateReferences extends Command
DB::setDefaultConnection($connection);
$this->comment('References have been regenerated');
return 0;
}
}

View File

@ -36,8 +36,7 @@ class PageRepo
RevisionRepo $revisionRepo,
ReferenceStore $referenceStore,
ReferenceUpdater $referenceUpdater
)
{
) {
$this->baseRepo = $baseRepo;
$this->revisionRepo = $revisionRepo;
$this->referenceStore = $referenceStore;

View File

@ -23,7 +23,6 @@ class ChapterController extends Controller
protected ChapterRepo $chapterRepo;
protected ReferenceFetcher $referenceFetcher;
public function __construct(ChapterRepo $chapterRepo, ReferenceFetcher $referenceFetcher)
{
$this->chapterRepo = $chapterRepo;

View File

@ -99,5 +99,4 @@ class CrossLinkParser
new BookshelfLinkModelResolver(),
]);
}
}

View File

@ -2,7 +2,6 @@
namespace BookStack\References;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;

View File

@ -28,7 +28,7 @@ class ReferenceFetcher
->with([
'from' => fn (Relation $query) => $query->select(Page::$listAttributes),
'from.book' => fn (Relation $query) => $query->scopes('visible'),
'from.chapter' => fn(Relation $query) => $query->scopes('visible')
'from.chapter' => fn (Relation $query) => $query->scopes('visible'),
]);
$references = $this->permissions->restrictEntityRelationQuery(

View File

@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Collection;
class ReferenceStore
{
/**
* Update the outgoing references for the given page.
*/
@ -67,5 +66,4 @@ class ReferenceStore
Reference::query()->insert($referenceDataChunk);
}
}
}

821
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -374,7 +374,7 @@ class OidcTest extends TestCase
$resp = $this->runLogin([
'email' => 'benny@example.com',
'sub' => 'benny1010101',
'groups' => ['Wizards', 'Zookeepers']
'groups' => ['Wizards', 'Zookeepers'],
]);
$resp->assertRedirect('/');
@ -401,10 +401,10 @@ class OidcTest extends TestCase
'my' => [
'custom' => [
'groups' => [
'attr' => ['Wizards']
]
]
]
'attr' => ['Wizards'],
],
],
],
]);
$resp->assertRedirect('/');

View File

@ -2,14 +2,12 @@
namespace Tests\References;
use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Page;
use BookStack\References\CrossLinkParser;
use Tests\TestCase;
class CrossLinkParserTest extends TestCase
{
public function test_instance_with_entity_resolvers_matches_entity_links()
{
$entities = $this->getEachEntityType();

View File

@ -12,7 +12,6 @@ use Tests\TestCase;
class ReferencesTest extends TestCase
{
public function test_references_created_on_page_update()
{
/** @var Page $pageA */
@ -24,7 +23,7 @@ class ReferencesTest extends TestCase
$this->asEditor()->put($pageA->getUrl(), [
'name' => 'Reference test',
'html' => '<a href="' . $pageB->getUrl() . '">Testing</a>'
'html' => '<a href="' . $pageB->getUrl() . '">Testing</a>',
]);
$this->assertDatabaseHas('references', [
@ -141,7 +140,7 @@ class ReferencesTest extends TestCase
$this->assertStringContainsString('href="http://localhost/books/my-updated-book-slugaroo"', $page->html);
$this->assertDatabaseHas('page_revisions', [
'page_id' => $page->id,
'summary' => 'System auto-update of internal links'
'summary' => 'System auto-update of internal links',
]);
}
}
@ -184,5 +183,4 @@ class ReferencesTest extends TestCase
'to_id' => $to->id,
])->save();
}
}