Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryk authored and github-actions[bot] committed Sep 7, 2023
1 parent 1b2da0a commit b824866
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/Actions/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
abstract class Action implements JsonSerializable
{
use AuthorizedToSee;
use ProxiesCanSeeToGate;
use Make;
use ProxiesCanSeeToGate;
use Visibility;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/ActionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle()
*/
protected function buildClass($name)
{
if (false === Str::endsWith($name, 'Action')) {
if (Str::endsWith($name, 'Action') === false) {
$name .= 'Action';
}

Expand All @@ -48,7 +48,7 @@ protected function getStub()

protected function getPath($name)
{
if (false === Str::endsWith($name, 'Action')) {
if (Str::endsWith($name, 'Action') === false) {
$name .= 'Action';
}

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/FilterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function handle()

protected function buildClass($name)
{
if (false === Str::endsWith($name, 'Filter')) {
if (Str::endsWith($name, 'Filter') === false) {
$name .= 'Filter';
}

Expand Down Expand Up @@ -107,7 +107,7 @@ protected function getStub()

protected function getPath($name)
{
if (false === Str::endsWith($name, 'Filter')) {
if (Str::endsWith($name, 'Filter') === false) {
$name .= 'Filter';
}

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/GetterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle()
*/
protected function buildClass($name)
{
if (false === Str::endsWith($name, 'Getter')) {
if (Str::endsWith($name, 'Getter') === false) {
$name .= 'Getter';
}

Expand All @@ -48,7 +48,7 @@ protected function getStub()

protected function getPath($name)
{
if (false === Str::endsWith($name, 'Getter')) {
if (Str::endsWith($name, 'Getter') === false) {
$name .= 'Getter';
}

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/PolicyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function guessPolicyName()
{
$name = $this->getNameInput();

if (false === Str::endsWith($name, 'Policy')) {
if (Str::endsWith($name, 'Policy') === false) {
$name .= 'Policy';
}

Expand Down
8 changes: 4 additions & 4 deletions src/Commands/RepositoryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function handle()
*/
protected function buildClass($name)
{
if (false === Str::endsWith($name, 'Repository')) {
if (Str::endsWith($name, 'Repository') === false) {
$name .= 'Repository';
}

Expand Down Expand Up @@ -94,7 +94,7 @@ protected function buildMigration()

$guessMigration = 'Create'.Str::studly($table).'Table';

if (false === class_exists($guessMigration)) {
if (class_exists($guessMigration) === false) {
$migration = Str::snake($guessMigration);
$yes = $this->confirm("Do you want to generate the migration [{$migration}]?");

Expand All @@ -120,7 +120,7 @@ protected function buildModel()
{
$model = $this->guessQualifiedModelName();

if (false === class_exists($model)) {
if (class_exists($model) === false) {
$yes = $this->confirm("Do you want to generate the model [{$model}]?");

if ($yes) {
Expand All @@ -146,7 +146,7 @@ protected function getStub()

protected function getPath($name)
{
if (false === Str::endsWith($name, 'Repository')) {
if (Str::endsWith($name, 'Repository') === false) {
$name .= 'Repository';
}

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/StoreCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle()
*/
protected function buildClass($name)
{
if (false === Str::endsWith($name, 'Store')) {
if (Str::endsWith($name, 'Store') === false) {
$name .= 'Store';
}

Expand All @@ -52,7 +52,7 @@ protected function getStub()

protected function getPath($name)
{
if (false === Str::endsWith($name, 'Store')) {
if (Str::endsWith($name, 'Store') === false) {
$name .= 'Store';
}

Expand Down
2 changes: 1 addition & 1 deletion src/Eager/Related.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

class Related implements JsonSerializable
{
use Make;
use HasColumns;
use Make;

private string $relation;

Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

class Field extends OrganicField implements JsonSerializable
{
use Make;
use HasAction;
use Make;

/**
* The resource associated with the field.
Expand Down
4 changes: 2 additions & 2 deletions src/Fields/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class File extends Field implements StorableContract, DeletableContract
class File extends Field implements DeletableContract, StorableContract
{
use FileStorable;
use AcceptsTypes;
use Deletable;
use FileStorable;

/**
* The callback that should be used to determine the file's storage name.
Expand Down
1 change: 0 additions & 1 deletion src/Fields/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function __construct($relation, string $parentRepository = null)

/**
* @param Repository $repository
* @param null $attribute
* @return $this|EagerField|HasMany
*/
public function resolve($repository, $attribute = null)
Expand Down
4 changes: 2 additions & 2 deletions src/Fields/OrganicField.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function isShownOnShow(RestifyRequest $request, $repository): bool

public function isHiddenOnShow(RestifyRequest $request, $repository): bool
{
return false === $this->isShownOnShow($request, $repository);
return $this->isShownOnShow($request, $repository) === false;
}

public function isShownOnIndex(RestifyRequest $request, $repository): bool
Expand All @@ -99,7 +99,7 @@ public function isShownOnIndex(RestifyRequest $request, $repository): bool
return false;
}

return false === $this->isHiddenOnIndex($request, $repository);
return $this->isHiddenOnIndex($request, $repository) === false;
}

public function isHiddenOnIndex(RestifyRequest $request, $repository): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Filters/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

abstract class Filter implements JsonSerializable
{
use Make;
use HasMode;
use Make;
use Metable;

public string $type = 'value';
Expand Down
7 changes: 4 additions & 3 deletions src/Getters/Getter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
use JsonSerializable;
use ReturnTypeWillChange;
use Symfony\Component\HttpFoundation\Response;
use Throwable;

use function tap;
use function throw_unless;
use Throwable;

/**
* Class Getter
Expand All @@ -30,9 +31,9 @@
*/
abstract class Getter implements JsonSerializable
{
use Make;
use AuthorizedToSee;
use AuthorizedToRun;
use AuthorizedToSee;
use Make;
use ProxiesCanSeeToGate;
use Visibility;

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/RestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ abstract class RestController extends BaseController
{
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
use ForwardsCalls;
use ValidatesRequests;

protected RestResponse $response;

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/RestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function forRepository(Repository $repository, $withRelations = false): s
{
$model = $repository->model();

if (false === $model instanceof Model) {
if ($model instanceof Model === false) {
return $this;
}

Expand Down
22 changes: 11 additions & 11 deletions src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@
/**
* @property string $type
*/
class Repository implements RestifySearchable, JsonSerializable
class Repository implements JsonSerializable, RestifySearchable
{
use InteractWithSearch;
use ValidatingTrait;
use PerformsQueries;
use ConditionallyLoadsAttributes;
use DelegatesToResource;
use ResolvesActions;
use ResolvesGetters;
use RepositoryEvents;
use WithRoutePrefix;
use InteractWithFields;
use InteractsWithModel;
use InteractsWithAttachers;
use HasColumns;
use InteractsWithAttachers;
use InteractsWithModel;
use InteractWithFields;
use InteractWithSearch;
use Mockable;
use PerformsQueries;
use RepositoryEvents;
use ResolvesActions;
use ResolvesGetters;
use Testing;
use ValidatingTrait;
use WithRoutePrefix;

/**
* This is named `resource` because of the forwarding properties from DelegatesToResource trait.
Expand Down
2 changes: 0 additions & 2 deletions src/Repositories/ValidatingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ public static function validatorForStoringBulk(RestifyRequest $request, array $p

/**
* Validate a resource update request.
*
* @param null $resource
*/
public static function validateForUpdate(RestifyRequest $request, $resource = null)
{
Expand Down
1 change: 0 additions & 1 deletion src/Restify.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ public static function repositoriesFrom(string $directory, string $namespace): v
/**
* Get the URI path prefix utilized by Restify.
*
* @param null $plus
* @return string
*/
public static function path($plus = null, array $query = [])
Expand Down
6 changes: 3 additions & 3 deletions src/Traits/AuthorizableModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function authorizeToAttach(Request $request, $method, $model): bool
? Gate::check($method, [$this->model(), $model])
: abort(403, "Missing method [$method] in your [$policyClass] policy.");

if (false === $authorized) {
if ($authorized === false) {
abort(403,
'You cannot attach model:'.get_class($model).', to the model:'.get_class($this->model()).', check your permissions.');
}
Expand All @@ -130,7 +130,7 @@ public function authorizeToSync(Request $request, $method, Collection $keys): bo
? Gate::check($method, [$this->model(), $keys])
: abort(403, "Missing method [$method] in your [$policyClass] policy.");

if (false === $authorized) {
if ($authorized === false) {
abort(403,
'You cannot sync key to the model:'.get_class($this->model()).', check your permissions.');
}
Expand All @@ -148,7 +148,7 @@ public function authorizeToDetach(Request $request, $method, $model)
? Gate::check($method, [$this->model(), $model])
: false;

if (false === $authorized) {
if ($authorized === false) {
throw new AuthorizationException();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Visibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public function isShownOnShow(RestifyRequest $request, $repository): bool

public function isHiddenOnShow(RestifyRequest $request, $repository): bool
{
return false === $this->isShownOnShow($request, $repository);
return $this->isShownOnShow($request, $repository) === false;
}

public function isShownOnIndex(RestifyRequest $request, $repository): bool
{
return false === $this->isHiddenOnIndex($request, $repository);
return $this->isHiddenOnIndex($request, $repository) === false;
}

public function isHiddenOnIndex(RestifyRequest $request, $repository): bool
Expand Down
9 changes: 5 additions & 4 deletions tests/Assertables/AssertableModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
use Illuminate\Testing\Fluent\Concerns\Has;
use Illuminate\Testing\Fluent\Concerns\Interaction;
use Illuminate\Testing\Fluent\Concerns\Matching;

use function PHPUnit\Framework\assertNotNull;

abstract class AssertableModel
{
use Has;
use Matching;
use CarbonMatching;
use Debugging;
use Has;
use Interaction;
use Macroable;
use Tappable;
use Make;
use CarbonMatching;
use Matching;
use Tappable;

public function __construct(
protected Model $model,
Expand Down
1 change: 1 addition & 0 deletions tests/Controllers/RepositoryAttachControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use Illuminate\Testing\Fluent\AssertableJson;

use function PHPUnit\Framework\assertInstanceOf;

class RepositoryAttachControllerTest extends IntegrationTestCase
Expand Down
1 change: 1 addition & 0 deletions tests/Fields/FieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Binaryk\LaravelRestify\Tests\IntegrationTestCase;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Routing\Route;

use function PHPUnit\Framework\assertInstanceOf;
use function PHPUnit\Framework\assertSame;

Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
* @property string avatar_size
* @property string avatar_original
*/
class User extends Authenticatable implements Sanctumable, MustVerifyEmail
class User extends Authenticatable implements MustVerifyEmail, Sanctumable
{
use HasFactory;
use \Illuminate\Auth\MustVerifyEmail;
use Notifiable;
use HasFactory;

public static $search = ['id', 'email'];

Expand Down

0 comments on commit b824866

Please sign in to comment.