Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve phpinsights #200

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lang/en/about.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'About the SiteBoss CMS',
'version' => 'Version',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/en/page.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

// TODO: update values to use proper naming convention
return [
'title' => 'Pages',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/passwords.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/en/preferences.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'User preferences',
'subtitle' => 'Here you can change your preferences',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'unauth' => 'Unauthorized user',
'tokenexp' => 'Token expired',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/support.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Support',
'breadcrumb' => 'Support',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/ui.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'save' => 'Save',
'save_no_redirect' => 'Save and stay on this page',
Expand Down
2 changes: 2 additions & 0 deletions lang/en/validation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/about.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Over SiteBoss CMS',
'version' => 'Versie',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/auth.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/page.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => "Pagina's",
'edit' => 'Wijzig pagina',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/passwords.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/preferences.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Gebruikersvoorkeuren',
'subtitle' => 'Wijzig hier je voorkeuren',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/redirects.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Doorverwijzingen',
'widget_title' => 'Overzicht van alle doorverwijzingen',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'unauth' => 'Gebruiker onbevoegd',
'tokenexp' => 'Token verlopen',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/support.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'title' => 'Support',
'breadcrumb' => 'Support',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/ui.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [
'save' => 'Opslaan',
'save_no_redirect' => 'Opslaan en op deze pagina blijven',
Expand Down
2 changes: 2 additions & 0 deletions lang/nl/validation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

return [

/*
Expand Down
11 changes: 6 additions & 5 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::prefix(config('siteboss.api_prefix'))->group(function () {

// Routes account management
Expand All @@ -44,7 +45,7 @@
Route::prefix('api')->group(function () {

// Unauthenticated routes
Route::namespace('Forms')->group(function () {
Route::namespace('Forms')->group(function (): void {
Route::post('forms/{form:id}/{langurl}', [DataController::class, 'create'])->middleware(ProtectAgainstSpam::class)->name('formbuilder.post');
Route::get('fields/{id}', [FieldController::class, 'readOneJson']);
// RIGHTS!!!!!
Expand All @@ -62,9 +63,9 @@
Route::get('settings', [InfoController::class, 'settings']);

// Authenticated routes
Route::group(['middleware' => ['auth:openid', 'api', EnsureEmailIsVerified::class]], function () {
Route::group(['middleware' => ['auth:openid', 'api', EnsureEmailIsVerified::class]], function (): void {
// Language for messages (not the language used for storing data)
Route::group(['prefix' => '/{locale}', 'middleware' => 'set-forget-locale'], function () {
Route::group(['prefix' => '/{locale}', 'middleware' => 'set-forget-locale'], function (): void {
Route::get('info', [InfoController::class, 'index']);

// TODO: remove this route?
Expand All @@ -76,7 +77,7 @@
// Form builder
Route::middleware('role:forms')->group(__DIR__.'/cms/forms.php');

Route::prefix('app')->group(function () {
Route::prefix('app')->group(function (): void {
if (file_exists(base_path().'/routes/siteboss.php')) {
Route::prefix('site')->group(
base_path().'/routes/siteboss.php'
Expand Down Expand Up @@ -109,7 +110,7 @@
Route::get('about', [AboutController::class, 'index']);

// Support page for SiteBoss CMS
Route::prefix('support')->group(function () {
Route::prefix('support')->group(function (): void {
Route::get('', [SupportController::class, 'index']);
Route::post('', [SupportController::class, 'update']);
});
Expand Down
20 changes: 10 additions & 10 deletions routes/cms/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
Route::post('table-export', [CmsEditorImportExportController::class, 'exportAllTables']);
Route::post('template-export', [CmsEditorImportExportController::class, 'exportAllTemplates']);
// table
Route::prefix('table')->group(function () {
Route::prefix('table')->group(function (): void {
Route::get('', [CmsEditorTableController::class, 'index']);
Route::post('', [CmsEditorTableController::class, 'create']);

Route::prefix('{table}')->group(function () {
Route::prefix('{table}')->group(function (): void {
Route::get('', [CmsEditorTableController::class, 'readOne']);
Route::post('', [CmsEditorTableController::class, 'update']);

Route::put('move', [CmsEditorTableController::class, 'updatePosition']);
Route::post('add-field', [CmsEditorTableController::class, 'addField']);

Route::prefix('{tableItem}')->group(function () {
Route::prefix('{tableItem}')->group(function (): void {
Route::get('', [CmsEditorTableItemController::class, 'readOne']);
Route::post('', [CmsEditorTableItemController::class, 'update']);
Route::post('enabled', [CmsEditorTableItemController::class, 'enabled']);
Expand All @@ -36,46 +36,46 @@
});

// pages
Route::prefix('page')->group(function () {
Route::prefix('page')->group(function (): void {
Route::get('', [CmsEditorTemplateController::class, 'index']);
Route::post('', [CmsEditorTemplateController::class, 'create']);

Route::prefix('{table}')->group(function () {
Route::prefix('{table}')->group(function (): void {
Route::get('', [CmsEditorTemplateController::class, 'readOne']);
Route::post('', [CmsEditorTemplateController::class, 'update']);
Route::post('import', [CmsEditorImportExportController::class, 'importTemplate']);

Route::put('move', [CmsEditorTemplateController::class, 'updatePosition']);
Route::post('add-field', [CmsEditorTemplateController::class, 'addField']);

Route::prefix('{tableItem}')->group(function () {
Route::prefix('{tableItem}')->group(function (): void {
Route::get('', [CmsEditorTemplateItemController::class, 'readOne']);
Route::post('', [CmsEditorTemplateItemController::class, 'update']);
Route::post('enabled', [CmsEditorTemplateItemController::class, 'enabled']);
});
});
});

Route::prefix('menu')->group(function () {
Route::prefix('menu')->group(function (): void {
Route::get('', [CmsEditorMenuController::class, 'index']);
Route::post('', [CmsEditorMenuController::class, 'addItem']);

Route::put('move', [CmsEditorMenuController::class, 'updatePosition']);

Route::prefix('{menuItem}')->group(function () {
Route::prefix('{menuItem}')->group(function (): void {
Route::get('', [CmsEditorMenuController::class, 'readOne']);
Route::post('', [CmsEditorMenuController::class, 'update']);
Route::delete('', [CmsEditorMenuController::class, 'deleteRecord']);
});
});

Route::prefix('lang')->group(function () {
Route::prefix('lang')->group(function (): void {
Route::get('', [CmsEditorLangController::class, 'index']);
Route::post('', [CmsEditorLangController::class, 'create']);

Route::put('move', [CmsEditorLangController::class, 'updatePosition']);

Route::prefix('{lang:id}')->group(function () {
Route::prefix('{lang:id}')->group(function (): void {
Route::get('', [CmsEditorLangController::class, 'readOne']);
Route::post('', [CmsEditorLangController::class, 'update']);
Route::delete('', [CmsEditorLangController::class, 'deleteRecord']);
Expand Down
16 changes: 8 additions & 8 deletions routes/cms/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
use NotFound\Framework\Http\Controllers\Forms\FieldController;
use NotFound\Framework\Http\Controllers\Forms\FormController;

Route::namespace('Forms')->group(function () {
Route::namespace('Forms')->group(function (): void {
// /forms
Route::prefix('forms')->group(function () {
Route::prefix('forms')->group(function (): void {
Route::post('', [FormController::class, 'create']);

Route::get('combinations', [FormController::class, 'readAllCombinations']);
Route::get('archive', [FormController::class, 'readAllArchive']);

// /forms/categories
Route::prefix('categories')->group(function () {
Route::prefix('categories')->group(function (): void {
Route::get('', [CategoryController::class, 'readAllBasedOnRights']);
Route::get('{category:slug}', [FormController::class, 'readAllBasedOnCategory']);
});

// /forms/{id}
Route::prefix('{form:id}')->group(function () {
Route::prefix('{form:id}')->group(function (): void {
Route::delete('', [FormController::class, 'delete']);
Route::put('', [FormController::class, 'update']);
Route::post('clone', [FormController::class, 'clone']);
Expand All @@ -31,13 +31,13 @@
Route::get('csv', [DownloadController::class, 'downloadReport']);

// /forms/{id}/settings
Route::prefix('settings')->group(function () {
Route::prefix('settings')->group(function (): void {
Route::get('', [FormController::class, 'getText']);
Route::put('', [FormController::class, 'updateText']);
});

// /forms/{id}/fields
Route::prefix('fields')->group(function () {
Route::prefix('fields')->group(function (): void {
Route::get('', [FieldController::class, 'readOne']);
Route::patch('', [FieldController::class, 'update']);

Expand All @@ -46,13 +46,13 @@
});

// /forms/{id}/data
Route::prefix('data')->group(function () {
Route::prefix('data')->group(function (): void {
Route::get('', [DataController::class, 'readOne']);
Route::get('all', [DataController::class, 'readOneAll']);
Route::get('filled', [DataController::class, 'readOneFilled']);

// /forms/{id}/data/{id}
Route::prefix('{recordId}')->group(function () {
Route::prefix('{recordId}')->group(function (): void {
Route::delete('', [DataController::class, 'deleteRow']);
Route::patch('', [DataController::class, 'updateField']);
});
Expand Down
4 changes: 2 additions & 2 deletions routes/cms/forwards.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

Route::get('/', [ForwardsController::class, 'getOptions']);

Route::prefix('domains')->group(function () {
Route::prefix('domains')->group(function (): void {
Route::get('/', [ForwardsController::class, 'readAll']);
Route::get('/{domain:id}', [ForwardsController::class, 'readOne']);
});

Route::prefix('options')->group(function () {
Route::prefix('options')->group(function (): void {
Route::get('/', [ForwardsController::class, 'readAll']);
Route::get('/rules/', [ForwardsController::class, 'readAll']);
});
2 changes: 1 addition & 1 deletion routes/cms/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Route::post('create/{menu}', [MenuController::class, 'create']);

// /app/page/{id}/editor/
Route::prefix('{menu}/editor/{langSlug}')->group(function () {
Route::prefix('{menu}/editor/{langSlug}')->group(function (): void {
Route::get('', [PageEditorController::class, 'index']);
Route::post('', [PageEditorController::class, 'update']);
Route::get('{fieldInternal}', [PageItemEditorController::class, 'ajaxGet']);
Expand Down
6 changes: 3 additions & 3 deletions routes/cms/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
use NotFound\Framework\Http\Controllers\Assets\TableItemEditorController;
use NotFound\Framework\Http\Controllers\Assets\TableOverviewController;

Route::prefix('{table:url}')->group(function () {
Route::prefix('{table:url}')->group(function (): void {
Route::get('', [TableOverviewController::class, 'index']);
Route::put('', [TableOverviewController::class, 'updateField']);
Route::post('', [TableOverviewController::class, 'create']);
Route::put('move', [TableOverviewController::class, 'updatePosition']);

// /table/{slug}/{recordId}
Route::prefix('{recordId}')->group(function () {
Route::prefix('{recordId}')->group(function (): void {
Route::delete('', [TableEditorController::class, 'deleteRecord']);

// /table/{slug}/{recordId}/{lang}
Route::prefix('{langSlug}')->group(function () {
Route::prefix('{langSlug}')->group(function (): void {
Route::get('', [TableEditorController::class, 'index']);
Route::post('', [TableEditorController::class, 'update']);

Expand Down
2 changes: 0 additions & 2 deletions routes/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
use NotFound\Framework\Services\Indexer\IndexBuilderService;

Artisan::command('siteboss:index-site {--debug : Whether debug messages should be displayed} {--clean : Truncate search table}', function ($debug, $clean) {

$indexer = new IndexBuilderService($debug, $clean);
$indexer->run();

return Command::SUCCESS;
})->purpose('Index site for local search');

Artisan::command('siteboss:cms-import {--debug : Whether debug messages should be displayed} {--dry : Dry Run}', function ($debug, $dry) {

$indexer = new ExchangeConsoleService($debug, $dry);
$indexer->import();

Expand Down
Loading
Loading