PSR-2 for app.
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
|
||||
class Inspire extends Command {
|
||||
class Inspire extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
@@ -28,5 +29,4 @@ class Inspire extends Command {
|
||||
{
|
||||
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel {
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
@@ -25,5 +26,4 @@ class Kernel extends ConsoleKernel {
|
||||
$schedule->command('inspire')
|
||||
->hourly();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php namespace App\Events;
|
||||
|
||||
abstract class Event {
|
||||
|
||||
abstract class Event
|
||||
{
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler {
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
@@ -38,5 +39,4 @@ class Handler extends ExceptionHandler {
|
||||
{
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ use Validator;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
|
||||
class AuthController extends Controller {
|
||||
class AuthController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -59,5 +60,4 @@ class AuthController extends Controller {
|
||||
'password' => bcrypt($data['password']),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class PasswordController extends Controller {
|
||||
class PasswordController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -34,5 +35,4 @@ class PasswordController extends Controller {
|
||||
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
class HomeController extends Controller {
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -32,5 +33,4 @@ class HomeController extends Controller {
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
class WelcomeController extends Controller {
|
||||
class WelcomeController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -32,5 +33,4 @@ class WelcomeController extends Controller {
|
||||
{
|
||||
return view('welcome');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel {
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
@@ -28,5 +29,4 @@ class Kernel extends HttpKernel {
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
class Authenticate {
|
||||
class Authenticate
|
||||
{
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
@@ -32,19 +33,14 @@ class Authenticate {
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->guest())
|
||||
{
|
||||
if ($request->ajax())
|
||||
{
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class RedirectIfAuthenticated {
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
@@ -33,12 +34,10 @@ class RedirectIfAuthenticated {
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->check())
|
||||
{
|
||||
if ($this->auth->check()) {
|
||||
return new RedirectResponse(url('/home'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
class VerifyCsrfToken extends BaseVerifier
|
||||
{
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
@@ -16,5 +17,4 @@ class VerifyCsrfToken extends BaseVerifier {
|
||||
{
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
abstract class Request extends FormRequest {
|
||||
|
||||
abstract class Request extends FormRequest
|
||||
{
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php namespace App\Jobs;
|
||||
|
||||
abstract class Job {
|
||||
abstract class Job
|
||||
{
|
||||
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider {
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
@@ -23,5 +24,4 @@ class AppServiceProvider extends ServiceProvider {
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider {
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
@@ -28,5 +29,4 @@ class EventServiceProvider extends ServiceProvider {
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider {
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* This namespace is applied to the controller routes in your routes file.
|
||||
@@ -35,10 +36,8 @@ class RouteServiceProvider extends ServiceProvider {
|
||||
*/
|
||||
public function map(Router $router)
|
||||
{
|
||||
$router->group(['namespace' => $this->namespace], function($router)
|
||||
{
|
||||
$router->group(['namespace' => $this->namespace], function ($router) {
|
||||
require app_path('Http/routes.php');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,8 @@ use Illuminate\Auth\Passwords\CanResetPassword;
|
||||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||||
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
||||
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
|
||||
{
|
||||
|
||||
use Authenticatable, CanResetPassword;
|
||||
|
||||
@@ -30,5 +31,4 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
$compiledPath = __DIR__.'/../storage/framework/compiled.php';
|
||||
|
||||
if (file_exists($compiledPath))
|
||||
{
|
||||
if (file_exists($compiledPath)) {
|
||||
require $compiledPath;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUsersTable extends Migration {
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -12,8 +13,7 @@ class CreateUsersTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
@@ -32,5 +32,4 @@ class CreateUsersTable extends Migration {
|
||||
{
|
||||
Schema::drop('users');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration {
|
||||
class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -12,8 +13,7 @@ class CreatePasswordResetsTable extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function(Blueprint $table)
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token')->index();
|
||||
$table->timestamp('created_at');
|
||||
@@ -29,5 +29,4 @@ class CreatePasswordResetsTable extends Migration {
|
||||
{
|
||||
Schema::drop('password_resets');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DatabaseSeeder extends Seeder {
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
@@ -16,5 +17,4 @@ class DatabaseSeeder extends Seeder {
|
||||
|
||||
// $this->call('UserTableSeeder');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ $uri = urldecode(
|
||||
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
|
||||
// built-in PHP web server. This provides a convenient way to test a Laravel
|
||||
// application without having installed a "real" web server software here.
|
||||
if ($uri !== '/' and file_exists(__DIR__.'/public'.$uri))
|
||||
{
|
||||
if ($uri !== '/' and file_exists(__DIR__.'/public'.$uri)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
class ExampleTest extends TestCase {
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* A basic functional test example.
|
||||
@@ -13,5 +14,4 @@ class ExampleTest extends TestCase {
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
@@ -15,5 +16,4 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user