Skip to content

Commit

Permalink
Apply fixes from StyleCI (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna authored Mar 5, 2020
1 parent 1ae1aae commit f36d4f6
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion install-stubs/Orchid/Entities/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Post extends Many
*
* @return \Illuminate\Database\Eloquent\Model
*/
public function create(Model $model) : Model
public function create(Model $model): Model
{
return $model->load(['attachment', 'tags', 'taxonomies'])
->setAttribute('category', $model->taxonomies->map(function ($item) {
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/TemplateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function handle(Dashboard $dashboard)
$this->call('vendor:publish', [
'--provider' => PressServiceProvider::class,
'--force' => true,
]);
]);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/Many.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

abstract class Many implements EntityContract, UrlRoutable
{
use Structure, Actions;

use Structure;
use Actions;
/**
* Eloquent Eager Loading.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/Single.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

abstract class Single implements EntityContract, UrlRoutable
{
use Structure, Actions;

use Structure;
use Actions;
/**
* Registered fields for main.
*
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Layouts/Comment/CommentListLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public function columns(): array
->render(function ($comment) {
if (!is_null($comment->post)) {
return '<a href="'.route('platform.entities.type.edit', [
$comment->post->type,
$comment->post->id,
]).'"><i class="icon-text-center mx-3"></i></a>';
$comment->post->type,
$comment->post->id,
]).'"><i class="icon-text-center mx-3"></i></a>';
}

return '<i class="icon-close mx-3"></i>';
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Screens/Category/CategoryListScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CategoryListScreen extends Screen
*
* @return array
*/
public function query() : array
public function query(): array
{
$categories = Category::where('parent_id', null)->with('allChildrenTerm')->get();
$allCategories = collect();
Expand Down Expand Up @@ -71,7 +71,7 @@ private function getCategory(Category $category, $delimiter = '')
*
* @return Link[]
*/
public function commandBar() : array
public function commandBar(): array
{
return [
Link::make(__('Add'))
Expand All @@ -85,7 +85,7 @@ public function commandBar() : array
*
* @return Layout[]
*/
public function layout() : array
public function layout(): array
{
return [
CategoryListLayout::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Screens/Comment/CommentListScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function query(): array
*
* @return Link[]
*/
public function commandBar() : array
public function commandBar(): array
{
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Screens/EntityEditScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function layout(): array
*
* @return RedirectResponse
*/
public function save(EntityContract $type, Request $request, Post $post): RedirectResponse
public function save(EntityContract $type, Request $request, Post $post): RedirectResponse
{
$this->checkPermission(Post::POST_PERMISSION_PREFIX.$type->slug);
$type->isValid();
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Screens/EntityListScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function layout(): array
*
* @return RedirectResponse
*/
public function restore(EntityContract $type, int $id) : RedirectResponse
public function restore(EntityContract $type, int $id): RedirectResponse
{
Post::onlyTrashed()->findOrFail($id)->restore();

Expand Down
8 changes: 4 additions & 4 deletions src/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class Category extends Taxonomy
{
use Attachable,
AsMultiSource,
Filterable;
use Attachable;
use AsMultiSource;
use Filterable;

/**
* Used to set the post's type.
Expand All @@ -24,7 +24,7 @@ class Category extends Taxonomy
*
* @return self
*/
public function setTaxonomy() : self
public function setTaxonomy(): self
{
$this['taxonomy'] = $this->taxonomy;

Expand Down
2 changes: 1 addition & 1 deletion src/Models/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function parent(): HasOne
/**
* @return string
*/
public function getRoute() :string
public function getRoute(): string
{
if ((strpos($this->slug, ',') > 0) && (is_array($routearray = explode(',', $this->slug)))) {
$routearray = array_filter($routearray, function ($element) {
Expand Down
20 changes: 10 additions & 10 deletions src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
*/
class Post extends Model
{
use Taggable,
SoftDeletes,
Sluggable,
AsMultiSource,
Searchable,
Attachable,
Filterable;
use Taggable;
use SoftDeletes;
use Sluggable;
use AsMultiSource;
use Searchable;
use Attachable;
use Filterable;

/**
* Prefix for permission.
Expand Down Expand Up @@ -461,14 +461,14 @@ public function createSlug($slug = null)
Dashboard::modelClass(self::class),
'slug',
$slug, [
'includeTrashed' => true,
]));
'includeTrashed' => true,
]));
}

/**
* @return string
*/
public function getRouteKeyName() : string
public function getRouteKeyName(): string
{
return 'slug';
}
Expand Down
8 changes: 4 additions & 4 deletions src/Traits/Taggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static function setTagsModel(string $model)
/**
* @return string
*/
public static function getSlugGenerator() : string
public static function getSlugGenerator(): string
{
return static::$slugGenerator;
}
Expand Down Expand Up @@ -273,7 +273,7 @@ public function removeTag(string $name)
*
* @return array
*/
public function prepareTags($tags) : array
public function prepareTags($tags): array
{
if (is_null($tags)) {
return [];
Expand Down Expand Up @@ -305,7 +305,7 @@ public static function createTagsModel()
*
* @return string
*/
protected function generateTagSlug(string $name) : string
protected function generateTagSlug(string $name): string
{
return call_user_func(static::$slugGenerator, $name);
}
Expand All @@ -315,7 +315,7 @@ protected function generateTagSlug(string $name) : string
*
* @return string
*/
protected function getEntityClassName() : string
protected function getEntityClassName(): string
{
return $this->tags()->getMorphClass();
}
Expand Down

0 comments on commit f36d4f6

Please sign in to comment.