Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
ConsoleTVs authored and StyleCIBot committed May 3, 2017
1 parent cb6a513 commit fe1c9b3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Controllers/APIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Laralum\Statistics\Controllers;

use App\Http\Controllers\Controller;
use Laralum\Statistics\Models\View;
use Illuminate\Http\Request;
use Laralum\Statistics\Models\View;

class APIController extends Controller
{
Expand Down Expand Up @@ -72,6 +72,7 @@ public function getMostUsedLanguage(Request $request)
* Get the most used resource.
*
* @param string $resource
*
* @return \Illuminate\Http\Response
*/
private function mostUsed($resource)
Expand Down
10 changes: 6 additions & 4 deletions src/Controllers/StatisticController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class StatisticController extends Controller
*/
public function index()
{
$labels = []; $normal_views = []; $unique_views = [];
$labels = [];
$normal_views = [];
$unique_views = [];
$all_views = View::all();

for ($i = 0; $i < 7; $i++) {
Expand All @@ -31,7 +33,7 @@ public function index()
->labels(array_reverse($labels))
->dataset(__('laralum_statistics::general.views'), array_reverse($normal_views))
->dataset(__('laralum_statistics::general.unique_visitors'), array_reverse($unique_views));

$labels = $all_views->unique('os')->pluck('os');

$values = [];
Expand Down Expand Up @@ -60,8 +62,8 @@ public function index()

return view('laralum_statistics::index', [
'latest_views_chart' => $latest_views_chart,
'browsers_chart' => $browsers_chart,
'oss_chart' => $oss_chart
'browsers_chart' => $browsers_chart,
'oss_chart' => $oss_chart,
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
Route::post('/statistics/most/os', 'APIController@getMostUsedOs')->name('statistics.mostUsedOs');
Route::post('/statistics/most/browser', 'APIController@getMostUsedBrowser')->name('statistics.mostUsedBrowser');
Route::post('/statistics/most/language', 'APIController@getMostUsedLanguage')->name('statistics.mostUsedLanguage');
});
});

0 comments on commit fe1c9b3

Please sign in to comment.