SmsirlaravelController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A delete() 0 4 1
A index() 0 4 1
1
<?php
2
3
namespace Ipecompany\Smsirlaravel\Controllers;
4
use Illuminate\Routing\Controller;
0 ignored issues
show
Bug introduced by
The type Illuminate\Routing\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
5
use Illuminate\Support\Facades\Route;
6
use Ipecompany\Smsirlaravel\Smsirlaravel;
7
use Ipecompany\Smsirlaravel\SmsirlaravelLogs;
8
9
10
class SmsirlaravelController extends Controller
11
{
12
13
	// the main index page for administrators
14
	public function index() {
15
		$credit = Smsirlaravel::credit();
16
		$smsirlaravel_logs = SmsirlaravelLogs::orderBy('id','DESC')->paginate(config('smsirlaravel.in-page'));
0 ignored issues
show
Bug introduced by
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
		$smsirlaravel_logs = SmsirlaravelLogs::orderBy('id','DESC')->paginate(/** @scrutinizer ignore-call */ config('smsirlaravel.in-page'));
Loading history...
17
		return view('smsirlaravel::index',compact('credit','smsirlaravel_logs'));
0 ignored issues
show
Bug introduced by
The function view was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
		return /** @scrutinizer ignore-call */ view('smsirlaravel::index',compact('credit','smsirlaravel_logs'));
Loading history...
18
	}
19
20
	// administrators can delete single log
21
	public function delete() {
22
		SmsirlaravelLogs::where('id',Route::current()->parameters['log'])->delete();
23
		// return the user back to sms-admin after delete the log
24
		return back();
0 ignored issues
show
Bug introduced by
The function back was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
		return /** @scrutinizer ignore-call */ back();
Loading history...
25
	}
26
}
27