@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | // Fills the list of allowed show ids. |
72 | 72 | foreach ($shows as $show) { |
73 | - if ($user->hasAccess(['cosmicradiotv.podcast.access_show_' . $show->slug])) { |
|
73 | + if ($user->hasAccess(['cosmicradiotv.podcast.access_show_'.$show->slug])) { |
|
74 | 74 | $show_ids_allowed[] = $show->id; |
75 | 75 | } |
76 | 76 | } |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | // Add the permissions for individual shows |
119 | 119 | $shows = Show::all(); |
120 | 120 | foreach ($shows as $show) { |
121 | - $permissions['cosmicradiotv.podcast.access_show_' . $show->slug] = [ |
|
121 | + $permissions['cosmicradiotv.podcast.access_show_'.$show->slug] = [ |
|
122 | 122 | 'tab' => 'cosmicradiotv.podcast::lang.permissions.tab_labels.shows', |
123 | - 'label' => e(trans('cosmicradiotv.podcast::lang.permissions.labels.access_show')) . ' ' . $show->name |
|
123 | + 'label' => e(trans('cosmicradiotv.podcast::lang.permissions.labels.access_show')).' '.$show->name |
|
124 | 124 | ]; |
125 | 125 | } |
126 | 126 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function up() |
16 | 16 | { |
17 | - DB::transaction(function() { |
|
17 | + DB::transaction(function () { |
|
18 | 18 | Schema::create('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
19 | 19 | $table->engine = 'InnoDB'; |
20 | 20 | $table->increments('id'); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function up() |
16 | 16 | { |
17 | - DB::transaction(function() { |
|
17 | + DB::transaction(function () { |
|
18 | 18 | Schema::table('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
19 | 19 | $table->unsignedInteger('sort_order'); |
20 | 20 | }); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function down() |
28 | 28 | { |
29 | - DB::transaction(function() { |
|
29 | + DB::transaction(function () { |
|
30 | 30 | Schema::table('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
31 | 31 | $table->dropColumn([ |
32 | 32 | 'sort_order', |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $this->addCss('/plugins/cosmicradiotv/podcast/assets/stylesheet/release_type_sort.css'); |
34 | 34 | |
35 | 35 | $this->pageTitle = e(trans('cosmicradiotv.podcast::lang.release_type.reorder')); |
36 | - $this->vars['records'] = ReleaseType::query()->orderBy('sort_order','asc')->get(); |
|
36 | + $this->vars['records'] = ReleaseType::query()->orderBy('sort_order', 'asc')->get(); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function onSaveOrder() |
@@ -59,7 +59,7 @@ |
||
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | - $query->whereIn('show_id',$show_ids_allowed); |
|
62 | + $query->whereIn('show_id', $show_ids_allowed); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | |
51 | 51 | public $hasMany = [ |
52 | - 'releases' => ['CosmicRadioTV\Podcast\Models\Release','delete' => 'true'], |
|
52 | + 'releases' => ['CosmicRadioTV\Podcast\Models\Release', 'delete' => 'true'], |
|
53 | 53 | ]; |
54 | 54 | |
55 | 55 |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | public function next($ofShow = false) { |
131 | 131 | $query = self::query(); |
132 | 132 | if ($ofShow) { |
133 | - $query = $query->where('show_id',$this->show_id); |
|
133 | + $query = $query->where('show_id', $this->show_id); |
|
134 | 134 | } |
135 | - return $query->where('published',true)->where('release','>',$this->release)->orderBy('release','asc')->take(1)->get()->first(); |
|
135 | + return $query->where('published', true)->where('release', '>', $this->release)->orderBy('release', 'asc')->take(1)->get()->first(); |
|
136 | 136 | } |
137 | 137 | /** |
138 | 138 | * Returns the previous episode |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | public function previous($ofShow = false) { |
143 | 143 | $query = self::query(); |
144 | 144 | if ($ofShow) { |
145 | - $query = $query->where('show_id',$this->show_id); |
|
145 | + $query = $query->where('show_id', $this->show_id); |
|
146 | 146 | } |
147 | - return $query->where('published',true)->where('release','<',$this->release)->orderBy('release','desc')->take(1)->get()->first(); |
|
147 | + return $query->where('published', true)->where('release', '<', $this->release)->orderBy('release', 'desc')->take(1)->get()->first(); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if (starts_with($rulePart, 'unique')) { |
173 | 173 | // Has format up to current instance's ID |
174 | 174 | if ($data['show_id']) { |
175 | - $ruleParts[$key] .= ',id,show_id,' . $data['show_id']; |
|
175 | + $ruleParts[$key] .= ',id,show_id,'.$data['show_id']; |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | while ($this->newQuery()->where('show_id', $this->show_id)->where($name, $_value)->count() > 0) { |
207 | 207 | $counter++; |
208 | - $_value = $value . $separator . $counter; |
|
208 | + $_value = $value.$separator.$counter; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | return $_value; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | case 'youtube': |
63 | 63 | // http://stackoverflow.com/a/8260383 |
64 | 64 | if (preg_match('/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/', $this->url, $matches)) { |
65 | - return 'https://youtube.com/embed/' . $matches[1]; |
|
65 | + return 'https://youtube.com/embed/'.$matches[1]; |
|
66 | 66 | } else { |
67 | 67 | return $this->url; |
68 | 68 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function beforeSave() { |
80 | 80 | $dirty = $this->getDirty(); |
81 | - if (in_array($this->release_type->type,['video','audio']) && $this->size == 0 && (isset($dirty['size']) || isset($dirty['url']))) { |
|
81 | + if (in_array($this->release_type->type, ['video', 'audio']) && $this->size == 0 && (isset($dirty['size']) || isset($dirty['url']))) { |
|
82 | 82 | $ch = curl_init(); |
83 | 83 | curl_setopt($ch, CURLOPT_URL, $this->url); |
84 | 84 | curl_setopt($ch, CURLOPT_TIMEOUT, 20); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | parent::__construct($cmsObject, $properties); |
13 | 13 | |
14 | 14 | // Remove extra component from end |
15 | - if(ends_with($this->dirName, 'component')) { |
|
15 | + if (ends_with($this->dirName, 'component')) { |
|
16 | 16 | $this->dirName = substr($this->dirName, 0, -9); |
17 | 17 | } |
18 | 18 | } |