Skip to content

Commit 6769af5

Browse files
committed
Merge pull request #19 from jadjoubran/analysis-zOvWBq
Applied fixes from StyleCI - php code style now inline with Laravel's code style
2 parents 3d69590 + 62cf4f4 commit 6769af5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1799
-1808
lines changed

app/Console/Commands/Inspire.php

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
<?php namespace App\Console\Commands;
1+
<?php
2+
3+
namespace App\Console\Commands;
24

35
use Illuminate\Console\Command;
46
use Illuminate\Foundation\Inspiring;
57

6-
class Inspire extends Command {
7-
8-
/**
9-
* The console command name.
10-
*
11-
* @var string
12-
*/
13-
protected $name = 'inspire';
14-
15-
/**
16-
* The console command description.
17-
*
18-
* @var string
19-
*/
20-
protected $description = 'Display an inspiring quote';
8+
class Inspire extends Command
9+
{
10+
/**
11+
* The console command name.
12+
*
13+
* @var string
14+
*/
15+
protected $name = 'inspire';
2116

22-
/**
23-
* Execute the console command.
24-
*
25-
* @return mixed
26-
*/
27-
public function handle()
28-
{
29-
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
30-
}
17+
/**
18+
* The console command description.
19+
*
20+
* @var string
21+
*/
22+
protected $description = 'Display an inspiring quote';
3123

24+
/**
25+
* Execute the console command.
26+
*
27+
* @return mixed
28+
*/
29+
public function handle()
30+
{
31+
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
32+
}
3233
}

app/Console/Kernel.php

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
<?php namespace App\Console;
1+
<?php
2+
3+
namespace App\Console;
24

35
use Illuminate\Console\Scheduling\Schedule;
46
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
57

6-
class Kernel extends ConsoleKernel {
7-
8-
/**
9-
* The Artisan commands provided by your application.
10-
*
11-
* @var array
12-
*/
13-
protected $commands = [
14-
'App\Console\Commands\Inspire',
15-
];
16-
17-
/**
18-
* Define the application's command schedule.
19-
*
20-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
21-
* @return void
22-
*/
23-
protected function schedule(Schedule $schedule)
24-
{
25-
$schedule->command('inspire')
26-
->hourly();
27-
}
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
'App\Console\Commands\Inspire',
17+
];
2818

19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
$schedule->command('inspire')
28+
->hourly();
29+
}
2930
}

app/Events/Event.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<?php namespace App\Events;
1+
<?php
22

3-
abstract class Event {
4-
5-
//
3+
namespace App\Events;
64

5+
abstract class Event
6+
{
7+
//
78
}

app/Exceptions/Handler.php

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
1-
<?php namespace App\Exceptions;
1+
<?php
2+
3+
namespace App\Exceptions;
24

35
use Exception;
46
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
57

6-
class Handler extends ExceptionHandler {
7-
8-
/**
9-
* A list of the exception types that should not be reported.
10-
*
11-
* @var array
12-
*/
13-
protected $dontReport = [
14-
'Symfony\Component\HttpKernel\Exception\HttpException'
15-
];
16-
17-
/**
18-
* Report or log an exception.
19-
*
20-
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
21-
*
22-
* @param \Exception $e
23-
* @return void
24-
*/
25-
public function report(Exception $e)
26-
{
27-
return parent::report($e);
28-
}
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* A list of the exception types that should not be reported.
12+
*
13+
* @var array
14+
*/
15+
protected $dontReport = [
16+
'Symfony\Component\HttpKernel\Exception\HttpException',
17+
];
2918

30-
/**
31-
* Render an exception into an HTTP response.
32-
*
33-
* @param \Illuminate\Http\Request $request
34-
* @param \Exception $e
35-
* @return \Illuminate\Http\Response
36-
*/
37-
public function render($request, Exception $e)
38-
{
39-
return parent::render($request, $e);
40-
}
19+
/**
20+
* Report or log an exception.
21+
*
22+
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
23+
*
24+
* @param \Exception $e
25+
* @return void
26+
*/
27+
public function report(Exception $e)
28+
{
29+
return parent::report($e);
30+
}
4131

32+
/**
33+
* Render an exception into an HTTP response.
34+
*
35+
* @param \Illuminate\Http\Request $request
36+
* @param \Exception $e
37+
* @return \Illuminate\Http\Response
38+
*/
39+
public function render($request, Exception $e)
40+
{
41+
return parent::render($request, $e);
42+
}
4243
}

app/Http/Controllers/AngularController.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22

33
namespace App\Http\Controllers;
44

5-
use Illuminate\Http\Request;
5+
class AngularController extends Controller
6+
{
7+
public function serveApp()
8+
{
9+
return view('index');
10+
}
611

7-
use App\Http\Requests;
8-
use App\Http\Controllers\Controller;
9-
10-
class AngularController extends Controller{
11-
12-
public function serveApp(){
13-
return view('index');
14-
}
15-
16-
public function unsupported(){
17-
return view('unsupported_browser');
18-
}
12+
public function unsupported()
13+
{
14+
return view('unsupported_browser');
15+
}
1916
}
Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,66 @@
1-
<?php namespace App\Http\Controllers\Auth;
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
24

35
use App\User;
46
use Validator;
57
use App\Http\Controllers\Controller;
6-
use Illuminate\Contracts\Auth\Guard;
7-
use Illuminate\Contracts\Auth\Registrar;
88
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
99

10-
class AuthController extends Controller {
11-
12-
/*
13-
|--------------------------------------------------------------------------
14-
| Registration & Login Controller
15-
|--------------------------------------------------------------------------
16-
|
17-
| This controller handles the registration of new users, as well as the
18-
| authentication of existing users. By default, this controller uses
19-
| a simple trait to add these behaviors. Why don't you explore it?
20-
|
21-
*/
22-
23-
use AuthenticatesAndRegistersUsers;
24-
25-
/**
26-
* Create a new authentication controller instance.
27-
*
28-
* @param \Illuminate\Contracts\Auth\Guard $auth
29-
* @param \Illuminate\Contracts\Auth\Registrar $registrar
30-
* @return void
31-
*/
32-
public function __construct()
33-
{
34-
$this->middleware('guest', ['except' => 'getLogout']);
35-
}
36-
10+
class AuthController extends Controller
11+
{
12+
/*
13+
|--------------------------------------------------------------------------
14+
| Registration & Login Controller
15+
|--------------------------------------------------------------------------
16+
|
17+
| This controller handles the registration of new users, as well as the
18+
| authentication of existing users. By default, this controller uses
19+
| a simple trait to add these behaviors. Why don't you explore it?
20+
|
21+
*/
3722

38-
/**
39-
* Get a validator for an incoming registration request.
40-
*
41-
* @param array $data
42-
* @return \Illuminate\Contracts\Validation\Validator
43-
*/
44-
public function validator(array $data)
45-
{
46-
return Validator::make($data, [
47-
'name' => 'required|max:255',
48-
'email' => 'required|email|max:255|unique:users',
49-
'password' => 'required|confirmed|min:6',
50-
]);
51-
}
23+
use AuthenticatesAndRegistersUsers;
5224

53-
/**
54-
* Create a new user instance after a valid registration.
55-
*
56-
* @param array $data
57-
* @return User
58-
*/
59-
public function create(array $data)
60-
{
61-
return User::create([
62-
'name' => $data['name'],
63-
'email' => $data['email'],
64-
'password' => bcrypt($data['password']),
65-
]);
66-
}
25+
/**
26+
* Create a new authentication controller instance.
27+
*
28+
* @param \Illuminate\Contracts\Auth\Guard $auth
29+
* @param \Illuminate\Contracts\Auth\Registrar $registrar
30+
* @return void
31+
*/
32+
public function __construct()
33+
{
34+
$this->middleware('guest', ['except' => 'getLogout']);
35+
}
6736

37+
/**
38+
* Get a validator for an incoming registration request.
39+
*
40+
* @param array $data
41+
* @return \Illuminate\Contracts\Validation\Validator
42+
*/
43+
public function validator(array $data)
44+
{
45+
return Validator::make($data, [
46+
'name' => 'required|max:255',
47+
'email' => 'required|email|max:255|unique:users',
48+
'password' => 'required|confirmed|min:6',
49+
]);
50+
}
6851

52+
/**
53+
* Create a new user instance after a valid registration.
54+
*
55+
* @param array $data
56+
* @return User
57+
*/
58+
public function create(array $data)
59+
{
60+
return User::create([
61+
'name' => $data['name'],
62+
'email' => $data['email'],
63+
'password' => bcrypt($data['password']),
64+
]);
65+
}
6966
}

0 commit comments

Comments
 (0)