1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00

minor code sniffer changes

This commit is contained in:
devfake 2017-01-24 16:11:47 +01:00 committed by Tim Meier
parent 5f024b151f
commit 96cb94f2ed
14 changed files with 24 additions and 25 deletions

View File

@ -6,7 +6,7 @@
class HomeController {
public function app($uri = null, Storage $storage)
public function app(Storage $storage, $uri = null)
{
$language = $storage->parseLanguage();

View File

@ -2,15 +2,12 @@
namespace App\Http\Controllers;
use App\AlternativeTitle;
use App\Episode;
use App\Item;
use App\Services\Models\AlternativeTitleService;
use App\Services\Models\EpisodeService;
use App\Services\Models\ItemService;
use App\Services\Storage;
use App\Services\TMDB;
use App\Setting;
use Illuminate\Support\Facades\Input;
class ItemController {

View File

@ -20,12 +20,14 @@
private $episodes;
private $storage;
private $version;
private $setting;
public function __construct(Item $item, Episode $episodes, Storage $storage)
public function __construct(Item $item, Episode $episodes, Storage $storage, Setting $setting)
{
$this->item = $item;
$this->episodes = $episodes;
$this->storage = $storage;
$this->setting = $setting;
$this->version = config('app.version');
}
@ -82,7 +84,7 @@
*
* @return string
*/
public function checkUpdate()
public function checkForUpdate()
{
$client = new Client();
$response = json_decode($client->get('https://api.github.com/repos/devfake/flox/releases')->getBody());
@ -100,7 +102,7 @@
{
set_time_limit(3000);
$items = Item::all();
$items = $this->item->all();
foreach($items as $item) {
if( ! $item->genre) {
@ -131,10 +133,10 @@
*/
public function settings()
{
$settings = Setting::first();
$settings = $this->setting->first();
if( ! $settings) {
$settings = Setting::create([
$settings = $this->setting->create([
'show_genre' => 0,
'show_date' => 1,
'episode_spoiler_protection' => 1,
@ -155,7 +157,7 @@
*/
public function changeSettings()
{
Setting::first()->update([
$this->setting->first()->update([
'show_genre' => Input::get('genre'),
'show_date' => Input::get('date'),
'episode_spoiler_protection' => Input::get('spoiler'),

View File

@ -46,7 +46,7 @@
*/
public function parseLanguage()
{
$alternative = config('app.TRANSLATION') ?: 'EN';
$alternative = config('app.TRANSLATION');
$filename = strtolower($alternative) . '.json';
// Get english fallback

View File

@ -6,7 +6,7 @@
'version' => '1.2.2',
'TMDB_API_KEY' => env('TMDB_API_KEY'),
'TRANSLATION' => env('TRANSLATION'),
'TRANSLATION' => env('TRANSLATION', 'EN'),
'LOADING_ITEMS' => env('LOADING_ITEMS'),
'CLIENT_URI' => env('CLIENT_URI'),

View File

@ -17,7 +17,7 @@
Route::get('/export', 'SettingController@export');
Route::post('/import', 'SettingController@import');
Route::get('/check-update', 'SettingController@checkUpdate');
Route::get('/check-update', 'SettingController@checkForUpdate');
// todo: POST
Route::get('/fetch-files', 'SettingController@fetchFiles');