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,11 +6,11 @@
class HomeController {
public function app($uri = null, Storage $storage)
public function app(Storage $storage, $uri = null)
{
$language = $storage->parseLanguage();
return view('app')
->withLang($language);
}
}
}

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 {
@ -20,7 +17,7 @@
private $tmdb;
/**
* Get the amount of loading items and create an instance for 'item'.
* Get the amount of loading items and create an instance for 'item'.
*
* @param Item $item
* @param Storage $storage

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'),
@ -173,4 +175,4 @@
$parser->store($files);
}
}
}

View File

@ -33,4 +33,4 @@
{
return $this->tmdb->upcoming();
}
}
}

View File

@ -72,4 +72,4 @@
return redirect('/');
}
}
}

View File

@ -153,4 +153,4 @@
'last_fetch_to_file_parser' => Carbon::now(),
]);
}
}
}

View File

@ -57,4 +57,4 @@
$this->create($item);
});
}
}
}

View File

@ -86,4 +86,4 @@
]);
});
}
}
}

View File

@ -129,4 +129,4 @@
return $this->model->findByTmdbId($value)->first();
}
}
}

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
@ -56,4 +56,4 @@
return LaravelStorage::disk('languages')->get($filename);
}
}
}

View File

@ -336,4 +336,4 @@
{
return (int) $response->getHeader('X-RateLimit-Remaining')[0] > 1;
}
}
}

View File

@ -17,4 +17,4 @@
'episode_spoiler_protection',
'last_fetch_to_file_parser',
];
}
}

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');