Skip to content

Commit

Permalink
Additional cs fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Graham Campbell <graham@cachethq.io>
  • Loading branch information
Graham Campbell committed Jun 1, 2015
1 parent b3c65c7 commit 99c428b
Show file tree
Hide file tree
Showing 637 changed files with 5,178 additions and 5,616 deletions.
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/AuthManager.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use Illuminate\Support\Manager;

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/AuthServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use Illuminate\Support\ServiceProvider;

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/Authenticatable.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

trait Authenticatable
{
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/Console/ClearResetsCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Console;
<?php

namespace Illuminate\Auth\Console;

use Illuminate\Console\Command;

Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Database\ConnectionInterface;
Expand Down Expand Up @@ -101,7 +103,7 @@ public function retrieveByCredentials(array $credentials)
$query = $this->conn->table($this->table);

foreach ($credentials as $key => $value) {
if (! str_contains($key, 'password')) {
if (!str_contains($key, 'password')) {
$query->where($key, $value);
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Auth/EloquentUserProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
Expand Down Expand Up @@ -89,7 +91,7 @@ public function retrieveByCredentials(array $credentials)
$query = $this->createModel()->newQuery();

foreach ($credentials as $key => $value) {
if (! str_contains($key, 'password')) {
if (!str_contains($key, 'password')) {
$query->where($key, $value);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/GeneratorServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use Illuminate\Support\ServiceProvider;
use Illuminate\Auth\Console\ClearResetsCommand;
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/GenericUser.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use Illuminate\Contracts\Auth\Authenticatable as UserContract;

Expand Down
34 changes: 18 additions & 16 deletions src/Illuminate/Auth/Guard.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth;
<?php

namespace Illuminate\Auth;

use RuntimeException;
use Illuminate\Contracts\Events\Dispatcher;
Expand Down Expand Up @@ -106,7 +108,7 @@ public function __construct(UserProvider $provider,
*/
public function check()
{
return ! is_null($this->user());
return !is_null($this->user());
}

/**
Expand All @@ -116,7 +118,7 @@ public function check()
*/
public function guest()
{
return ! $this->check();
return !$this->check();
}

/**
Expand All @@ -133,7 +135,7 @@ public function user()
// If we have already retrieved the user for the current request we can just
// return it back immediately. We do not want to pull the user data every
// request into the method because that would tremendously slow an app.
if (! is_null($this->user)) {
if (!is_null($this->user)) {
return $this->user;
}

Expand All @@ -144,7 +146,7 @@ public function user()
// request, and if one exists, attempt to retrieve the user using that.
$user = null;

if (! is_null($id)) {
if (!is_null($id)) {
$user = $this->provider->retrieveById($id);
}

Expand All @@ -153,7 +155,7 @@ public function user()
// the application. Once we have a user we can return it to the caller.
$recaller = $this->getRecaller();

if (is_null($user) && ! is_null($recaller)) {
if (is_null($user) && !is_null($recaller)) {
$user = $this->getUserByRecaller($recaller);

if ($user) {
Expand Down Expand Up @@ -194,12 +196,12 @@ public function id()
*/
protected function getUserByRecaller($recaller)
{
if ($this->validRecaller($recaller) && ! $this->tokenRetrievalAttempted) {
if ($this->validRecaller($recaller) && !$this->tokenRetrievalAttempted) {
$this->tokenRetrievalAttempted = true;

list($id, $token) = explode('|', $recaller, 2);

$this->viaRemember = ! is_null($user = $this->provider->retrieveByToken($id, $token));
$this->viaRemember = !is_null($user = $this->provider->retrieveByToken($id, $token));

return $user;
}
Expand Down Expand Up @@ -235,7 +237,7 @@ protected function getRecallerId()
*/
protected function validRecaller($recaller)
{
if (! is_string($recaller) || ! str_contains($recaller, '|')) {
if (!is_string($recaller) || !str_contains($recaller, '|')) {
return false;
}

Expand Down Expand Up @@ -302,7 +304,7 @@ public function basic($field = 'email')
*/
public function onceBasic($field = 'email')
{
if (! $this->once($this->getBasicCredentials($this->getRequest(), $field))) {
if (!$this->once($this->getBasicCredentials($this->getRequest(), $field))) {
return $this->getBasicResponse();
}
}
Expand All @@ -316,7 +318,7 @@ public function onceBasic($field = 'email')
*/
protected function attemptBasic(Request $request, $field)
{
if (! $request->getUser()) {
if (!$request->getUser()) {
return false;
}

Expand Down Expand Up @@ -386,7 +388,7 @@ public function attempt(array $credentials = [], $remember = false, $login = tru
*/
protected function hasValidCredentials($user, $credentials)
{
return ! is_null($user) && $this->provider->validateCredentials($user, $credentials);
return !is_null($user) && $this->provider->validateCredentials($user, $credentials);
}

/**
Expand Down Expand Up @@ -498,7 +500,7 @@ public function loginUsingId($id, $remember = false)
*/
public function onceUsingId($id)
{
if (! is_null($user = $this->provider->retrieveById($id))) {
if (!is_null($user = $this->provider->retrieveById($id))) {
$this->setUser($user);

return true;
Expand Down Expand Up @@ -545,7 +547,7 @@ public function logout()
// listening for anytime a user signs out of this application manually.
$this->clearUserDataFromStorage();

if (! is_null($this->user)) {
if (!is_null($this->user)) {
$this->refreshRememberToken($user);
}

Expand Down Expand Up @@ -610,8 +612,8 @@ protected function createRememberTokenIfDoesntExist(UserContract $user)
*/
public function getCookieJar()
{
if (! isset($this->cookie)) {
throw new RuntimeException("Cookie jar has not been set.");
if (!isset($this->cookie)) {
throw new RuntimeException('Cookie jar has not been set.');
}

return $this->cookie;
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/Middleware/AuthenticateWithBasicAuth.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Middleware;
<?php

namespace Illuminate\Auth\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/Passwords/CanResetPassword.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Passwords;
<?php

namespace Illuminate\Auth\Passwords;

trait CanResetPassword
{
Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Passwords;
<?php

namespace Illuminate\Auth\Passwords;

use Carbon\Carbon;
use Illuminate\Database\ConnectionInterface;
Expand Down Expand Up @@ -109,7 +111,7 @@ public function exists(CanResetPasswordContract $user, $token)

$token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first();

return $token && ! $this->tokenExpired($token);
return $token && !$this->tokenExpired($token);
}

/**
Expand Down
16 changes: 9 additions & 7 deletions src/Illuminate/Auth/Passwords/PasswordBroker.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Passwords;
<?php

namespace Illuminate\Auth\Passwords;

use Closure;
use UnexpectedValueException;
Expand Down Expand Up @@ -110,7 +112,7 @@ public function emailResetLink(CanResetPasswordContract $user, $token, Closure $
return $this->mailer->send($view, compact('token', 'user'), function ($m) use ($user, $token, $callback) {
$m->to($user->getEmailForPasswordReset());

if (! is_null($callback)) {
if (!is_null($callback)) {
call_user_func($callback, $m, $user, $token);
}
});
Expand All @@ -130,7 +132,7 @@ public function reset(array $credentials, Closure $callback)
// the user is properly redirected having an error message on the post.
$user = $this->validateReset($credentials);

if (! $user instanceof CanResetPasswordContract) {
if (!$user instanceof CanResetPasswordContract) {
return $user;
}

Expand Down Expand Up @@ -158,11 +160,11 @@ protected function validateReset(array $credentials)
return PasswordBrokerContract::INVALID_USER;
}

if (! $this->validateNewPassword($credentials)) {
if (!$this->validateNewPassword($credentials)) {
return PasswordBrokerContract::INVALID_PASSWORD;
}

if (! $this->tokens->exists($user, $credentials['token'])) {
if (!$this->tokens->exists($user, $credentials['token'])) {
return PasswordBrokerContract::INVALID_TOKEN;
}

Expand Down Expand Up @@ -231,8 +233,8 @@ public function getUser(array $credentials)

$user = $this->users->retrieveByCredentials($credentials);

if ($user && ! $user instanceof CanResetPasswordContract) {
throw new UnexpectedValueException("User must implement CanResetPassword interface.");
if ($user && !$user instanceof CanResetPasswordContract) {
throw new UnexpectedValueException('User must implement CanResetPassword interface.');
}

return $user;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Passwords;
<?php

namespace Illuminate\Auth\Passwords;

use Illuminate\Support\ServiceProvider;
use Illuminate\Auth\Passwords\DatabaseTokenRepository as DbRepository;
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Auth/Passwords/TokenRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Auth\Passwords;
<?php

namespace Illuminate\Auth\Passwords;

use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Broadcasting/BroadcastEvent.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Broadcasting;
<?php

namespace Illuminate\Broadcasting;

use ReflectionClass;
use ReflectionProperty;
Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Broadcasting/BroadcastManager.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Broadcasting;
<?php

namespace Illuminate\Broadcasting;

use Pusher;
use Closure;
Expand Down Expand Up @@ -94,7 +96,7 @@ protected function resolve($name)
if (isset($this->customCreators[$config['driver']])) {
return $this->callCustomCreator($config);
} else {
return $this->{"create".ucfirst($config['driver'])."Driver"}($config);
return $this->{'create'.ucfirst($config['driver']).'Driver'}($config);
}
}

Expand Down Expand Up @@ -203,6 +205,6 @@ public function extend($driver, Closure $callback)
*/
public function __call($method, $parameters)
{
return call_user_func_array(array($this->driver(), $method), $parameters);
return call_user_func_array([$this->driver(), $method], $parameters);
}
}
4 changes: 3 additions & 1 deletion src/Illuminate/Broadcasting/BroadcastServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Broadcasting;
<?php

namespace Illuminate\Broadcasting;

use Illuminate\Support\ServiceProvider;

Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Broadcasting/Broadcasters/LogBroadcaster.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Broadcasting\Broadcasters;
<?php

namespace Illuminate\Broadcasting\Broadcasters;

use Psr\Log\LoggerInterface;
use Illuminate\Contracts\Broadcasting\Broadcaster;
Expand Down Expand Up @@ -26,7 +28,7 @@ public function __construct(LoggerInterface $logger)
/**
* {@inheritdoc}
*/
public function broadcast(array $channels, $event, array $payload = array())
public function broadcast(array $channels, $event, array $payload = [])
{
$channels = implode(', ', $channels);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace Illuminate\Broadcasting\Broadcasters;
<?php

namespace Illuminate\Broadcasting\Broadcasters;

use Pusher;
use Illuminate\Contracts\Broadcasting\Broadcaster;
Expand Down Expand Up @@ -26,7 +28,7 @@ public function __construct(Pusher $pusher)
/**
* {@inheritdoc}
*/
public function broadcast(array $channels, $event, array $payload = array())
public function broadcast(array $channels, $event, array $payload = [])
{
$this->pusher->trigger($channels, $event, $payload);
}
Expand Down
Loading

0 comments on commit 99c428b

Please sign in to comment.