Skip to content

Commit

Permalink
Apply CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mzur committed Jul 3, 2017
1 parent 600e0bd commit cbfefed
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public function destroyOwn(Request $request, Guard $auth)
}

/**
* Transform the input email to lowercase
* Transform the input email to lowercase.
*
* @param Request $request
*
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Biigle\Http\Middleware\AuthenticateAPI;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Views/Admin/LogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class LogsController extends Controller
{
/**
* Shows the available logfiles
* Shows the available logfiles.
*
* @return \Illuminate\Http\Response
*/
Expand All @@ -27,7 +27,7 @@ public function index()
}

/**
* Shows a specific logfile
* Shows a specific logfile.
*
* @return \Illuminate\Http\Response
*/
Expand Down
2 changes: 1 addition & 1 deletion app/LabelTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LabelTree extends Model
public static $createRules = [
'name' => 'required|max:256',
'visibility_id' => 'required|integer|exists:visibilities,id',
'project_id' => 'filled|integer|exists:projects,id'
'project_id' => 'filled|integer|exists:projects,id',
];

/**
Expand Down
8 changes: 3 additions & 5 deletions app/Services/Auth/ApiGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ public function user()
// If we've already retrieved the user for the current request we can just
// return it back immediately. We do not want to fetch the user data on
// every call to this method because that would be tremendously slow.
if (! is_null($this->user)) {
if (!is_null($this->user)) {
return $this->user;
}

$user = null;

$token = $this->getTokenForRequest();

if (! empty($token)) {
if (!empty($token)) {
$user = $this->provider->retrieveByCredentials(
['email' => strtolower($this->request->getUser())]
);
}

if (! empty($user)) {
if (!empty($user)) {
$candidates = ApiToken::where('owner_id', $user->id)
->select('id', 'hash')
->get();
Expand All @@ -44,8 +44,6 @@ public function user()
}
}
}

return null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function setSettings(array $settings)
}

/**
* Get settings of a specific key
* Get settings of a specific key.
*
* @param string $key
* @param mixed $default Default value if the settings key was not set
Expand Down
5 changes: 3 additions & 2 deletions app/Volume.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ protected function collectMetaInfo($only = [])
}

/**
* Get a dynamic attribute from the JSON attrs column
* Get a dynamic attribute from the JSON attrs column.
*
* @param string $name Name of the attribute
*
Expand All @@ -493,11 +493,12 @@ protected function collectMetaInfo($only = [])
protected function getJsonAttr($name)
{
$attrs = $this->attrs ?: [];

return array_key_exists($name, $attrs) ? $attrs[$name] : null;
}

/**
* Set a dynamic attribute to the JSON attrs column
* Set a dynamic attribute to the JSON attrs column.
*
* @param string $name Name of the attribute
* @param mixed $value
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"php vendor/bin/phpunit"
],
"fix": [
"php-cs-fixer --config-file='.php_cs' fix"
"php-cs-fixer fix --config-file='.php_cs'"
],
"doc": [
"rm -rf public/doc/api",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Biigle\User;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class TransformEmailToLowercase extends Migration
Expand Down
1 change: 0 additions & 1 deletion tests/php/Http/Controllers/Api/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ public function testStore()

public function testStoreEmailCaseInsensitive()
{

$this->beGlobalAdmin();

$this->editor()->email = '[email protected]';
Expand Down

0 comments on commit cbfefed

Please sign in to comment.