@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | */ |
54 | 54 | private function dropSeries() |
55 | 55 | { |
56 | - Schema::table('rainlab_blog_posts', function ($table) { |
|
57 | - $table->dropForeign([Series::TABLE_NAME . '_id']); |
|
56 | + Schema::table('rainlab_blog_posts', function($table) { |
|
57 | + $table->dropForeign([ Series::TABLE_NAME . '_id' ]); |
|
58 | 58 | $table->dropColumn(Series::TABLE_NAME . '_id'); |
59 | 59 | }); |
60 | 60 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | Schema::create( |
70 | 70 | Tag::TABLE_NAME, |
71 | - function ($table) { |
|
71 | + function($table) { |
|
72 | 72 | $table->engine = 'InnoDB'; |
73 | 73 | |
74 | 74 | $table->increments('id'); |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | |
81 | 81 | Schema::create( |
82 | 82 | Tag::CROSS_REFERENCE_TABLE_NAME, |
83 | - function ($table) { |
|
83 | + function($table) { |
|
84 | 84 | $table->engine = 'InnoDB'; |
85 | 85 | |
86 | 86 | $table->integer('tag_id')->unsigned()->nullable()->default(null); |
87 | 87 | $table->integer('post_id')->unsigned()->nullable()->default(null); |
88 | - $table->index(['tag_id', 'post_id']); |
|
88 | + $table->index([ 'tag_id', 'post_id' ]); |
|
89 | 89 | $table->foreign('tag_id', 'Tag reference')->references('id')->on(Tag::TABLE_NAME)->onDelete('cascade'); |
90 | 90 | $table->foreign('post_id', 'Post reference')->references('id')->on('rainlab_blog_posts')->onDelete('cascade'); |
91 | 91 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | Schema::create( |
101 | 101 | Series::TABLE_NAME, |
102 | - function ($table) { |
|
102 | + function($table) { |
|
103 | 103 | $table->engine = 'InnoDB'; |
104 | 104 | |
105 | 105 | $table->increments('id'); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | ); |
112 | 112 | |
113 | - Schema::table('rainlab_blog_posts', function ($table) { |
|
113 | + Schema::table('rainlab_blog_posts', function($table) { |
|
114 | 114 | $table->integer(Series::TABLE_NAME . '_id')->unsigned()->nullable()->default(null); |
115 | 115 | $table->foreign(Series::TABLE_NAME . '_id')->references('id')->on(Series::TABLE_NAME)->onDelete('cascade'); |
116 | 116 | }); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function onBulkDelete() |
56 | 56 | { |
57 | - if (($checkedIds = (array)post('checked', []))) { |
|
57 | + if (($checkedIds = (array)post('checked', [ ]))) { |
|
58 | 58 | $delete = Tag::whereIn('id', $checkedIds)->delete(); |
59 | 59 | } |
60 | 60 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $this->asExtension('FormController')->update(post('record_id')); |
119 | 119 | |
120 | - $this->vars['recordId'] = post('record_id'); |
|
120 | + $this->vars[ 'recordId' ] = post('record_id'); |
|
121 | 121 | |
122 | 122 | return $this->makePartial('tag_update_modal_form'); |
123 | 123 | } |
@@ -10,7 +10,6 @@ |
||
10 | 10 | use Backend\Behaviors\FormController; |
11 | 11 | use Backend\Behaviors\ListController; |
12 | 12 | use October\Rain\Exception\SystemException; |
13 | -use October\Rain\Flash\FlashBag; |
|
14 | 13 | |
15 | 14 | /** |
16 | 15 | * Class Tags |
@@ -31,7 +31,7 @@ |
||
31 | 31 | /** |
32 | 32 | * @var array |
33 | 33 | */ |
34 | - protected $slugs = ['slug' => 'name']; |
|
34 | + protected $slugs = [ 'slug' => 'name' ]; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Relations |
@@ -86,7 +86,7 @@ |
||
86 | 86 | * |
87 | 87 | * @var array |
88 | 88 | */ |
89 | - public static $sortingOptions = [ |
|
89 | + public static $sortingOptions = [ |
|
90 | 90 | 'name asc' => Plugin::LOCALIZATION_KEY . 'order_options.name_asc', |
91 | 91 | 'name desc' => Plugin::LOCALIZATION_KEY . 'order_options.name_desc', |
92 | 92 | 'created_at asc' => Plugin::LOCALIZATION_KEY . 'order_options.created_at_asc', |
@@ -83,7 +83,7 @@ |
||
83 | 83 | /** |
84 | 84 | * @var array |
85 | 85 | */ |
86 | - protected $slugs = ['slug' => 'title']; |
|
86 | + protected $slugs = [ 'slug' => 'title' ]; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @return mixed |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | protected function getPostsQuery() |
66 | 66 | { |
67 | - $query = Post::whereHas('tags', function ($query) { |
|
67 | + $query = Post::whereHas('tags', function($query) { |
|
68 | 68 | $query->where('slug', $this->tag->slug); |
69 | 69 | })->isPublished(); |
70 | 70 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | protected function getPostsQuery() |
64 | 64 | { |
65 | - $query = Post::whereHas('series', function ($query) { |
|
65 | + $query = Post::whereHas('series', function($query) { |
|
66 | 66 | $query->where('slug', $this->series->slug); |
67 | 67 | })->isPublished(); |
68 | 68 |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace GinoPane\BlogTaxonomy\Components; |
4 | 4 | |
5 | 5 | use Cms\Classes\Page; |
6 | -use RainLab\Blog\Models\Post; |
|
7 | 6 | use GinoPane\BlogTaxonomy\Plugin; |
8 | 7 | use GinoPane\BlogTaxonomy\Models\Series; |
9 | 8 |
@@ -109,8 +109,8 @@ |
||
109 | 109 | { |
110 | 110 | $this->postPage = $this->property('postPage'); |
111 | 111 | $this->seriesPage = $this->property('seriesPage'); |
112 | - $this->slug = $this->page['slug'] = $this->property('slug'); |
|
113 | - $this->series = $this->page['series'] = $this->listSeries(); |
|
112 | + $this->slug = $this->page[ 'slug' ] = $this->property('slug'); |
|
113 | + $this->series = $this->page[ 'series' ] = $this->listSeries(); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @var Collection | array |
23 | 23 | */ |
24 | - public $tags = []; |
|
24 | + public $tags = [ ]; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Reference to the page name for linking to tags page |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->orderBy = $this->getProperty('orderBy'); |
151 | 151 | $this->postSlug = $this->property('postSlug'); |
152 | 152 | $this->displayEmpty = $this->getProperty('displayEmpty'); |
153 | - $this->limit = $this->getProperty('limit'); |
|
153 | + $this->limit = $this->getProperty('limit'); |
|
154 | 154 | |
155 | 155 | $this->tags = $this->listTags(); |
156 | 156 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | $tagComponent = $this->getComponent(TagPosts::NAME, $this->tagsPage); |
171 | 171 | |
172 | - $this->setUrls($tags, $this->tagsPage, $this->controller, ['tag' => $this->urlProperty($tagComponent, 'tag')]); |
|
172 | + $this->setUrls($tags, $this->tagsPage, $this->controller, [ 'tag' => $this->urlProperty($tagComponent, 'tag') ]); |
|
173 | 173 | |
174 | 174 | return $tags; |
175 | 175 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | ); |
75 | 75 | |
76 | 76 | if (!empty($this->categoryPage) && $post->categories->count()) { |
77 | - $post->categories->each(function ($category) use ($blogCategoriesComponent) { |
|
77 | + $post->categories->each(function($category) use ($blogCategoriesComponent) { |
|
78 | 78 | /** @var Category $category */ |
79 | 79 | $category->setUrl( |
80 | 80 | $this->categoryPage, |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getProperty(string $property, $default = null) |
115 | 115 | { |
116 | - return $this->property($property, $this->defineProperties()[$property]['default'] ?? $default); |
|
116 | + return $this->property($property, $this->defineProperties()[ $property ][ 'default' ] ?? $default); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $component = $page->getComponent($componentName); |
132 | 132 | } |
133 | 133 | |
134 | - if (!empty($component) && is_callable([$this->controller, 'setComponentPropertiesFromParams'])) { |
|
134 | + if (!empty($component) && is_callable([ $this->controller, 'setComponentPropertiesFromParams' ])) { |
|
135 | 135 | $this->controller->setComponentPropertiesFromParams($component); |
136 | 136 | } |
137 | 137 |