From fcae2063d046aef5eecedbf13f7e005427deb190 Mon Sep 17 00:00:00 2001 From: Jacob Baker-Kretzmar Date: Thu, 9 May 2019 19:45:26 -0400 Subject: [PATCH] Clean up --- .gitignore | 8 ++++---- CHANGELOG.md | 2 +- src/Http/Controllers/SettingsToolController.php | 17 +++++++++++++++-- src/Http/Middleware/Authorize.php | 4 ---- src/SettingsTool.php | 4 ---- src/SettingsToolServiceProvider.php | 12 +++++------- tests/SettingsToolControllerTest.php | 4 +--- tests/TestCase.php | 3 +-- webpack.mix.js | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 34e2ee3..041f552 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -/vendor /node_modules -package-lock.json -composer.lock -.phpunit.result.cache +/vendor .DS_Store +.phpunit.result.cache +composer.lock +package-lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 7138767..231c1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to `nova-settings-tool` will be documented in this file. -## 0.3.0 – 2019-04-09 +## 0.2.1 – 2019-04-09 - Add `textarea` setting type ([#11](https://github.com/bakerkretzmar/nova-settings-tool/pull/11)) - Fix bug translating the "Settings saved!" message diff --git a/src/Http/Controllers/SettingsToolController.php b/src/Http/Controllers/SettingsToolController.php index 48c0864..eb65071 100644 --- a/src/Http/Controllers/SettingsToolController.php +++ b/src/Http/Controllers/SettingsToolController.php @@ -3,19 +3,29 @@ namespace Bakerkretzmar\SettingsTool\Http\Controllers; use Illuminate\Http\Request; -use Spatie\Valuestore\Valuestore; use Illuminate\Routing\Controller; +use Spatie\Valuestore\Valuestore; + class SettingsToolController extends Controller { - /** @var string */ + /** + * Path to the settings file on disk. + * @var string + */ protected $settingsPath; + /** + * Create a new controller instance. + */ public function __construct(string $settingsPath = null) { $this->settingsPath = $settingsPath ?? storage_path(config('settings.path', 'app/settings.json')); } + /** + * Retrieve and format settings from a file. + */ public function read(Request $request) { $settings = Valuestore::make($this->settingsPath)->all(); @@ -36,6 +46,9 @@ public function read(Request $request) ]); } + /** + * Save updated settings to a file. + */ public function write(Request $request) { $settings = Valuestore::make($this->settingsPath); diff --git a/src/Http/Middleware/Authorize.php b/src/Http/Middleware/Authorize.php index 4373c64..9ae6268 100644 --- a/src/Http/Middleware/Authorize.php +++ b/src/Http/Middleware/Authorize.php @@ -8,10 +8,6 @@ class Authorize { /** * Handle the incoming request. - * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * @return \Illuminate\Http\Response */ public function handle($request, $next) { diff --git a/src/SettingsTool.php b/src/SettingsTool.php index b115a6b..7d87d43 100644 --- a/src/SettingsTool.php +++ b/src/SettingsTool.php @@ -14,8 +14,6 @@ public function __construct(string $title = null) /** * Perform any tasks that need to happen when the tool is booted. - * - * @return void */ public function boot() { @@ -24,8 +22,6 @@ public function boot() /** * Build the view that renders the navigation links for the tool. - * - * @return \Illuminate\View\View */ public function renderNavigation() { diff --git a/src/SettingsToolServiceProvider.php b/src/SettingsToolServiceProvider.php index 826145a..718f68b 100644 --- a/src/SettingsToolServiceProvider.php +++ b/src/SettingsToolServiceProvider.php @@ -2,17 +2,17 @@ namespace Bakerkretzmar\SettingsTool; -use Laravel\Nova\Nova; -use Illuminate\Support\Facades\Route; -use Illuminate\Support\ServiceProvider; use Bakerkretzmar\SettingsTool\Http\Middleware\Authorize; +use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Route; + +use Laravel\Nova\Nova; + class SettingsToolServiceProvider extends ServiceProvider { /** * Bootstrap any application services. - * - * @return void */ public function boot() { @@ -29,8 +29,6 @@ public function boot() /** * Register the tool's routes. - * - * @return void */ protected function routes() { diff --git a/tests/SettingsToolControllerTest.php b/tests/SettingsToolControllerTest.php index d8b9aea..73d33c5 100644 --- a/tests/SettingsToolControllerTest.php +++ b/tests/SettingsToolControllerTest.php @@ -8,7 +8,6 @@ class SettingsToolControllerTest extends TestCase { - public function setUp() { parent::setUp(); @@ -55,7 +54,7 @@ public function it_will_start_from_the_ending_of_the_file_when_no_starting_line_ // 'text' => '', // 'lastRetrievedLineNumber' => 10, // ]); - + $this->assertTrue(true); } @@ -77,5 +76,4 @@ public function it_can_start_from_a_specific_line() // SettingsToolServiceProvider::class, // ]; // } - } diff --git a/tests/TestCase.php b/tests/TestCase.php index 4b5c2c1..02c8d35 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,13 +3,13 @@ namespace Bakerkretzmar\SettingsTool\Tests; use Bakerkretzmar\SettingsTool\SettingsToolServiceProvider; + use Illuminate\Support\Facades\Route; use Orchestra\Testbench\TestCase as Orchestra; abstract class TestCase extends Orchestra { - public function setUp() { parent::setUp(); @@ -23,5 +23,4 @@ protected function getPackageProviders($app) SettingsToolServiceProvider::class, ]; } - } diff --git a/webpack.mix.js b/webpack.mix.js index 704e54e..aaab5bb 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -3,4 +3,4 @@ let mix = require('laravel-mix') mix.disableSuccessNotifications() mix.setPublicPath('dist') - .js('resources/js/tool.js', 'js') + .js('resources/js/tool.js', 'js')