@@ -146,19 +146,19 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | $movie = Movies::find($id); |
| 148 | 148 | |
| 149 | - $likes = session('likes', []); |
|
| 149 | + $likes = session('likes', [ ]); |
|
| 150 | 150 | |
| 151 | 151 | // si l'action est "like" |
| 152 | 152 | if ($action == 'like') { |
| 153 | 153 | |
| 154 | 154 | // J'ajoute mon movie dans le tableaux des likes en session |
| 155 | - $likes[$id] = $movie->id; |
|
| 155 | + $likes[ $id ] = $movie->id; |
|
| 156 | 156 | Session::flash('danger', "Le film {$movie->title} a bien été liké"); |
| 157 | 157 | } else { |
| 158 | 158 | |
| 159 | 159 | // je supprime le like dans le tableaux des likes |
| 160 | 160 | // unset() supprimer un element dans un tableau en PHP |
| 161 | - unset($likes[$id]); |
|
| 161 | + unset($likes[ $id ]); |
|
| 162 | 162 | |
| 163 | 163 | Session::flash('success', "Le film {$movie->title} a bien été disliké"); |
| 164 | 164 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | foreach ($actors as $actor) { |
| 208 | 208 | DB::table('actors_movies') |
| 209 | 209 | ->insert([ |
| 210 | - ['movies_id' => $movie->id, 'actors_id' => $actor], |
|
| 210 | + [ 'movies_id' => $movie->id, 'actors_id' => $actor ], |
|
| 211 | 211 | ]); |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | foreach ($directors as $director) { |
| 218 | 218 | DB::table('directors_movies') |
| 219 | 219 | ->insert([ |
| 220 | - ['movies_id' => $movie->id, 'directors_id' => $director], |
|
| 220 | + [ 'movies_id' => $movie->id, 'directors_id' => $director ], |
|
| 221 | 221 | ]); |
| 222 | 222 | } |
| 223 | 223 | } |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - protected $fillable = ['name', 'email', 'password']; |
|
| 31 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * The attributes excluded from the model's JSON form. |
| 35 | 35 | * |
| 36 | 36 | * @var array |
| 37 | 37 | */ |
| 38 | - protected $hidden = ['password', 'remember_token']; |
|
| 38 | + protected $hidden = [ 'password', 'remember_token' ]; |
|
| 39 | 39 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class Movies extends Model implements ItemInterface |
| 15 | 15 | { |
| 16 | - protected $fillable = ['title', 'description', 'categories_id']; |
|
| 16 | + protected $fillable = [ 'title', 'description', 'categories_id' ]; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Décrit le nom de la table |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function handle() |
| 38 | 38 | { |
| 39 | - $infos = \Thujohn\Twitter\Facades\Twitter::getUsersLookup(['screen_name' => 'Symfomany', 'format' => 'php']); |
|
| 39 | + $infos = \Thujohn\Twitter\Facades\Twitter::getUsersLookup([ 'screen_name' => 'Symfomany', 'format' => 'php' ]); |
|
| 40 | 40 | $manager = new \MongoDB\Driver\Manager("mongodb://localhost:27017"); |
| 41 | 41 | $collection = new \MongoDB\Collection($manager, "laravel.tweets"); |
| 42 | 42 | |
| 43 | 43 | if (!empty($infos)) { |
| 44 | 44 | |
| 45 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'infos']); |
|
| 45 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'infos' ]); |
|
| 46 | 46 | |
| 47 | 47 | $stat = [ |
| 48 | 48 | "origin" => "Twitter", |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $tweets = \Thujohn\Twitter\Facades\Twitter::getDmsOut(['format' => 'php']); |
|
| 57 | + $tweets = \Thujohn\Twitter\Facades\Twitter::getDmsOut([ 'format' => 'php' ]); |
|
| 58 | 58 | if (!empty($tweets)) { |
| 59 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'dmsout']); |
|
| 59 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'dmsout' ]); |
|
| 60 | 60 | |
| 61 | 61 | foreach ($tweets as $tweet) { |
| 62 | 62 | $stat = [ |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $tweets = \Thujohn\Twitter\Facades\Twitter::getFavorites(['format' => 'php']); |
|
| 72 | + $tweets = \Thujohn\Twitter\Facades\Twitter::getFavorites([ 'format' => 'php' ]); |
|
| 73 | 73 | if (!empty($tweets)) { |
| 74 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'favorites']); |
|
| 74 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'favorites' ]); |
|
| 75 | 75 | |
| 76 | 76 | foreach ($tweets as $tweet) { |
| 77 | 77 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | 'format' => 'php', ]); |
| 93 | 93 | |
| 94 | 94 | if (!empty($tweets)) { |
| 95 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'mentionstimeline']); |
|
| 95 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'mentionstimeline' ]); |
|
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | foreach ($tweets as $tweet) { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | ]); |
| 115 | 115 | |
| 116 | 116 | if (!empty($tweets)) { |
| 117 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'hometimeline']); |
|
| 117 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'hometimeline' ]); |
|
| 118 | 118 | |
| 119 | 119 | foreach ($tweets as $tweet) { |
| 120 | 120 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ]); |
| 137 | 137 | |
| 138 | 138 | if (!empty($tweets)) { |
| 139 | - $collection->deleteMany(['origin' => 'Twitter', 'type' => 'usertimeline']); |
|
| 139 | + $collection->deleteMany([ 'origin' => 'Twitter', 'type' => 'usertimeline' ]); |
|
| 140 | 140 | |
| 141 | 141 | foreach ($tweets as $tweet) { |
| 142 | 142 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | if (!empty($channel)) { |
| 52 | 52 | $manager = new \MongoDB\Driver\Manager("mongodb://localhost:27017"); |
| 53 | 53 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 54 | - $collection->deleteMany([]); |
|
| 54 | + $collection->deleteMany([ ]); |
|
| 55 | 55 | |
| 56 | 56 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 57 | 57 | $stat = [ |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | 'maxResults' => 30, |
| 71 | 71 | ]; |
| 72 | 72 | |
| 73 | - $videos = Yt::searchAdvanced($params, true)['results']; |
|
| 73 | + $videos = Yt::searchAdvanced($params, true)[ 'results' ]; |
|
| 74 | 74 | |
| 75 | 75 | if (!empty($videos)) { |
| 76 | 76 | $collection = new \MongoDB\Collection($manager, "laravel.videos"); |
| 77 | - $collection->deleteMany([]); |
|
| 77 | + $collection->deleteMany([ ]); |
|
| 78 | 78 | $now = new \DateTime(); |
| 79 | - $day= $now->getTimestamp(); |
|
| 79 | + $day = $now->getTimestamp(); |
|
| 80 | 80 | |
| 81 | 81 | foreach ($videos as $video) { |
| 82 | 82 | $collection = new \MongoDB\Collection($manager, "laravel.videos"); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function ajaxmovies(Request $request) |
| 38 | 38 | { |
| 39 | 39 | $validator = Validator::make( |
| 40 | - $request->all(), //request all : tous les elements de requetses |
|
| 40 | + $request->all(), //request all : tous les elements de requetses |
|
| 41 | 41 | [ |
| 42 | 42 | 'title' => 'required|min:10', |
| 43 | 43 | ], [ |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $executePayment = $payment->execute($paymentExecution, $this->_apiContext); |
| 79 | 79 | |
| 80 | 80 | // Clear the shopping cart, write to database, send notifications, etc. |
| 81 | - $request->session()->pull('likes', []); |
|
| 81 | + $request->session()->pull('likes', [ ]); |
|
| 82 | 82 | |
| 83 | 83 | return view('Main/index'); |
| 84 | 84 | } |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | $videos = collect($collection->find()->toArray())->shuffle(); |
| 100 | 100 | |
| 101 | 101 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 102 | - $youtubeinfo = collect($collection->find(["origin" => "Youtube"])->toArray())->first(); |
|
| 102 | + $youtubeinfo = collect($collection->find([ "origin" => "Youtube" ])->toArray())->first(); |
|
| 103 | 103 | |
| 104 | 104 | $collection = new \MongoDB\Collection($manager, "laravel.stats"); |
| 105 | - $tweeterinfo = collect($collection->find(['origin' => 'Twitter', 'type' => 'infos'])->toArray())->first(); |
|
| 105 | + $tweeterinfo = collect($collection->find([ 'origin' => 'Twitter', 'type' => 'infos' ])->toArray())->first(); |
|
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | $actor = new Actors(); // Je récpere mon modèle |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | 'avgnotepresse' => $avgnotepresse->avgpress, |
| 127 | 127 | 'avgacteurs' => $avgacteurs->age, |
| 128 | 128 | 'videos' => $videos, |
| 129 | - 'video' => $videos[0], |
|
| 129 | + 'video' => $videos[ 0 ], |
|
| 130 | 130 | 'youtubeinfo' => $youtubeinfo->data, |
| 131 | - 'tweeterinfo' => $tweeterinfo['data'][0], |
|
| 131 | + 'tweeterinfo' => $tweeterinfo[ 'data' ][ 0 ], |
|
| 132 | 132 | 'youtubeinfodateupdated' => $youtubeinfo->created, |
| 133 | - 'tweeterinfodateupdated' => $tweeterinfo['created_at'], |
|
| 133 | + 'tweeterinfodateupdated' => $tweeterinfo[ 'created_at' ], |
|
| 134 | 134 | 'avghour' => $avghour->avghour, |
| 135 | 135 | 'nbacteurs' => $nbacteurs, |
| 136 | 136 | 'nbcommentaires' => $nbcommentaires, |