Skip to content

Commit

Permalink
Apply fixes from StyleCI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan authored Feb 22, 2017
1 parent fcc1beb commit 84f0dd4
Show file tree
Hide file tree
Showing 54 changed files with 189 additions and 182 deletions.
5 changes: 3 additions & 2 deletions app/Console/Commands/MakeRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class MakeRule extends GeneratorCommand
{
/**
/**
* The type of class being generated.
*
* @var string
Expand Down Expand Up @@ -40,7 +40,8 @@ protected function getStub()
/**
* Get the default namespace for the class.
*
* @param string $rootNamespace
* @param string $rootNamespace
*
* @return string
*/
protected function getDefaultNamespace($rootNamespace)
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
4 changes: 2 additions & 2 deletions app/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public function __construct($node = null, $currentUri = null, $baseHref = null)

/**
* Get the original raw HTML.
*
* @return string
*
* @throws \Exception
*
* @return string
*/
public function getRaw()
{
Expand Down
13 changes: 8 additions & 5 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @param \Exception $exception
*
* @return void
*/
public function report(Exception $exception)
Expand All @@ -38,8 +39,9 @@ public function report(Exception $exception)
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
Expand All @@ -50,8 +52,9 @@ public function render($request, Exception $exception)
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
*
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
Expand Down
18 changes: 10 additions & 8 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers\Auth;

use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Validator;

class RegisterController extends Controller
{
Expand Down Expand Up @@ -42,29 +42,31 @@ public function __construct()
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @param array $data
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|min:6|confirmed',
]);
}

/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @param array $data
*
* @return User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];
}
7 changes: 4 additions & 3 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
Expand Down
1 change: 0 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Providers;

use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/BroadcastServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;

class BroadcastServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Providers;

use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
Expand Down
8 changes: 4 additions & 4 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Providers;

use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;

class RouteServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -53,7 +53,7 @@ protected function mapWebRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
'namespace' => $this->namespace,
], function ($router) {
require base_path('routes/web.php');
});
Expand All @@ -70,8 +70,8 @@ protected function mapApiRoutes()
{
Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
});
Expand Down
3 changes: 2 additions & 1 deletion app/Rules/AppIconsExist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class AppIconsExist extends Rule
{
/**
* {@inheritdoc}
*
* @throws \RuntimeException
*/
public function check()
Expand Down Expand Up @@ -46,7 +47,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
App icons are used when your web page is saved to the home screen of a mobile device. They are specified by `<link rel="apple-touch-icon">` for iOS and `<link rel="icon">` for Android. Note that you can specify more than one icon to cater for different resolutions.
You can read more about app icons for [iOS](https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html) and [Android](https://developer.chrome.com/multidevice/android/installtohomescreen), kupo!
MSG;
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/CharacterSetExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getCharset()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A valid [character set](https://en.wikipedia.org/wiki/Character_encodings_in_HTML) helps browsers display a page correctly.
Most of the time you’ll want a `UTF-8` encoding. For HTML5, all you need is a `<meta charset="UTF-8">` tag in `<head>`, kupo!
MSG;
Expand Down
3 changes: 2 additions & 1 deletion app/Rules/DocTypeCorrect.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class DocTypeCorrect extends Rule

/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function check()
Expand Down Expand Up @@ -40,7 +41,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A Doctype, or DOCTYPE, helps the HTML layout engines determine a layout mode, such as “[quirks mode](https://en.wikipedia.org/wiki/Quirks_mode)” or “standard mode.” For HTML5, a simple `<!DOCTYPE html>` declaration on top of your page should suffice, kupo!
MSG;
}
Expand Down
4 changes: 2 additions & 2 deletions app/Rules/FacebookOGTagsExist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Rules;

class FacebookOGTagsExist extends Rule
class FacebookOGTagsExist extends Rule
{
/**
* {@inheritdoc}
Expand Down Expand Up @@ -44,7 +44,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
Though not mandatory, a page should have valid Open Graph (OG) markups to take control over how the content appears on Facebook. You can about them [here](https://developers.facebook.com/docs/sharing/webmasters), kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/FaviconExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A [favicon](https://en.wikipedia.org/wiki/Favicon) (short for _favorite icon_) represents the site graphically on the tab bar or in bookmarks. If a favicon isn’t specified in the HTML markups, the browser will look for a file named `favicon.ico` at the root of the site, kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/GoogleAnalyticsInstalled.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
As [Google Analytics](https://analytics.google.com) is arguably the most popular web analytics service, it’s assumed here that you want to integrate your site with a GA account. Of course you can safely ignore this rule if it isn’t the case, kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/GzipEnabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
Compressing your web page helps reduce loading time and save bandwidth. If your server is Apache, this can be done with [some simple `.htaccess` rules](https://github.com/phanan/htaccess#compress-text-files), kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/HtmlHasLangAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A `lang` attribute in the `<html>` tag sets the language for all the text on the page, which is [a good thing to do](https://www.w3.org/International/questions/qa-lang-why.en), kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/ImgTagsHaveAlt.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
An `alt` attribute specifies the alternate text for an image, which comes in handy if the image cannot be displayed for some reason, or if the user uses a screen reader, kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/MetaDescriptionExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A meta description summarizes a page content and is often used by search engines to display as a snippet in search results. You can learn how to create the right meta description [here](https://yoast.com/meta-descriptions/), kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/RobotsAllowedInMetaTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A page can tell search engines to NOT index or follow its content with a `<meta name="robots" value="noindex, nofollow">` tag. Since you’re launching to public, this is hardly what you want, kupo!
MSG;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/RobotsAllowedInTxt.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function failedMessage()
*/
public function helpMessage()
{
return <<<MSG
return <<<'MSG'
A site can also specify crawling instructions in a file named [`robots.txt`](http://www.robotstxt.org/robotstxt.html), placed at the root of its public directory. Having
```
User-agent: *
Expand Down
6 changes: 5 additions & 1 deletion app/Rules/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function __construct(Crawler $crawler = null, $url = null)

/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function check(Crawler $crawler = null, $url = null)
Expand All @@ -37,6 +38,7 @@ public function level()

/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function passedMessage()
Expand All @@ -46,6 +48,7 @@ public function passedMessage()

/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function failedMessage()
Expand All @@ -56,8 +59,9 @@ public function failedMessage()
/**
* Get the help message for the rule.
*
* @return string
* @throws \Exception
*
* @return string
*/
public function helpMessage()
{
Expand Down
Loading

0 comments on commit 84f0dd4

Please sign in to comment.