@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function map(Router $router) |
39 | 39 | { |
40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
40 | + $router->group([ 'namespace' => $this->namespace ], function($router) { |
|
41 | 41 | require app_path('Http/routes.php'); |
42 | 42 | }); |
43 | 43 | } |
@@ -8,7 +8,6 @@ |
||
8 | 8 | use App\Http\Models\User; |
9 | 9 | use Illuminate\Http\Request; |
10 | 10 | use Illuminate\Support\Facades\Validator; |
11 | -use Netshell\Paypal\Facades\Paypal; |
|
12 | 11 | |
13 | 12 | |
14 | 13 | /** |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function ajaxmovies(Request $request) |
37 | 37 | { |
38 | 38 | $validator = Validator::make( |
39 | - $request->all(), //request all : tous les elements de requetses |
|
39 | + $request->all(), //request all : tous les elements de requetses |
|
40 | 40 | [ |
41 | 41 | 'title' => 'required|min:10', |
42 | 42 | ], [ |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $executePayment = $payment->execute($paymentExecution, $this->_apiContext); |
78 | 78 | |
79 | 79 | // Clear the shopping cart, write to database, send notifications, etc. |
80 | - $request->session()->pull('likes', []); |
|
80 | + $request->session()->pull('likes', [ ]); |
|
81 | 81 | |
82 | 82 | return view('Main/index'); |
83 | 83 | } |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | $nbseances = Sessions::count(); |
95 | 95 | |
96 | 96 | $manager = new \MongoDB\Driver\Manager("mongodb://localhost:27017"); |
97 | - $collection = new \MongoDB\Collection($manager, "laravel","videos"); |
|
97 | + $collection = new \MongoDB\Collection($manager, "laravel", "videos"); |
|
98 | 98 | $videos = collect($collection->find()->toArray())->shuffle(); |
99 | 99 | |
100 | - $collection = new \MongoDB\Collection($manager, "laravel","stats"); |
|
101 | - $youtubeinfo = collect($collection->find(["origin" => "Youtube"])->toArray())->first(); |
|
100 | + $collection = new \MongoDB\Collection($manager, "laravel", "stats"); |
|
101 | + $youtubeinfo = collect($collection->find([ "origin" => "Youtube" ])->toArray())->first(); |
|
102 | 102 | |
103 | - $collection = new \MongoDB\Collection($manager, "laravel","stats"); |
|
104 | - $tweeterinfo = collect($collection->find(['origin' => 'Twitter', 'type' => 'infos'])->toArray())->first(); |
|
103 | + $collection = new \MongoDB\Collection($manager, "laravel", "stats"); |
|
104 | + $tweeterinfo = collect($collection->find([ 'origin' => 'Twitter', 'type' => 'infos' ])->toArray())->first(); |
|
105 | 105 | |
106 | 106 | $actor = new Actors(); // Je récpere mon modèle |
107 | 107 | $comment = new Comments(); // Je récpere mon modèle |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | 'avgnotepresse' => $avgnotepresse->avgpress, |
125 | 125 | 'avgacteurs' => $avgacteurs->age, |
126 | 126 | 'videos' => $videos, |
127 | - 'video' => $videos[0], |
|
127 | + 'video' => $videos[ 0 ], |
|
128 | 128 | 'youtubeinfo' => $youtubeinfo->data, |
129 | - 'tweeterinfo' => $tweeterinfo['data'][0], |
|
129 | + 'tweeterinfo' => $tweeterinfo[ 'data' ][ 0 ], |
|
130 | 130 | 'youtubeinfodateupdated' => $youtubeinfo->created, |
131 | - 'tweeterinfodateupdated' => $tweeterinfo['created_at'], |
|
131 | + 'tweeterinfodateupdated' => $tweeterinfo[ 'created_at' ], |
|
132 | 132 | 'avghour' => $avghour->avghour, |
133 | 133 | 'nbacteurs' => $nbacteurs, |
134 | 134 | 'nbcommentaires' => $nbcommentaires, |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | $email = $this->argument('email'); |
31 | 31 | $nom = $this->argument('nom'); |
32 | - Mail::send('Emails/welcome', [], function ($m) use ($email, $nom) { |
|
32 | + Mail::send('Emails/welcome', [ ], function($m) use ($email, $nom) { |
|
33 | 33 | $m->from('[email protected]', 'Julien Boyer') |
34 | 34 | ->to($email, $nom) |
35 | 35 | ->subject('Welcome to the site '); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function register() |
31 | 31 | { |
32 | - $this->app->singleton(Cart::class, function ($app) { |
|
32 | + $this->app->singleton(Cart::class, function($app) { |
|
33 | 33 | return new Cart(); |
34 | 34 | }); |
35 | 35 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $users = $movie->actors(); |
50 | 50 | foreach ($users as $user) { |
51 | 51 | //send an email |
52 | - Mail::send('Emails/newsletter', [], function ($m) { |
|
52 | + Mail::send('Emails/newsletter', [ ], function($m) { |
|
53 | 53 | |
54 | 54 | $m->from('[email protected]', 'Florent Boyer'); |
55 | 55 | $m->to('[email protected]', 'Boyer Julien') |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Constructor. |
29 | 29 | */ |
30 | - public function __construct(array $products = []) |
|
30 | + public function __construct(array $products = [ ]) |
|
31 | 31 | { |
32 | 32 | $this->products = $products; |
33 | - $this->promotions = []; |
|
33 | + $this->promotions = [ ]; |
|
34 | 34 | $this->total = 0; |
35 | 35 | } |
36 | 36 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function add(ItemInterface $item) |
41 | 41 | { |
42 | - $this->products[] = $item; |
|
42 | + $this->products[ ] = $item; |
|
43 | 43 | |
44 | 44 | return $this; |
45 | 45 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function addItems(Collection $collection) |
51 | 51 | { |
52 | 52 | foreach ($collection as $item) { |
53 | - $this->products[] = $item; |
|
53 | + $this->products[ ] = $item; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $this->products; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function remove(ItemInterface $item) |
63 | 63 | { |
64 | - $this->products[array_search($item, $this->products)] = $item; |
|
64 | + $this->products[ array_search($item, $this->products) ] = $item; |
|
65 | 65 | |
66 | 66 | return $this; |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function clear() |
73 | 73 | { |
74 | - $this->products = []; |
|
74 | + $this->products = [ ]; |
|
75 | 75 | |
76 | 76 | return $this->products; |
77 | 77 | } |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function categories() |
17 | 17 | { |
18 | - $tab = []; |
|
18 | + $tab = [ ]; |
|
19 | 19 | $categories = Categories::all(); |
20 | 20 | |
21 | 21 | foreach ($categories as $categorie) { |
22 | - $tab[] = |
|
22 | + $tab[ ] = |
|
23 | 23 | [ |
24 | 24 | $categorie->title, |
25 | 25 | count($categorie->movies), |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | |
40 | 40 | //exit(dump($resultat)); |
41 | 41 | |
42 | - $tab = []; |
|
42 | + $tab = [ ]; |
|
43 | 43 | foreach ($resultat as $actor) { |
44 | - $tab[] = [ |
|
44 | + $tab[ ] = [ |
|
45 | 45 | 'name' => $actor->city, |
46 | - 'data' => [(int) $actor->nb], |
|
46 | + 'data' => [ (int) $actor->nb ], |
|
47 | 47 | ]; |
48 | 48 | } |
49 | 49 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function read($id) |
38 | 38 | { |
39 | - return view('Comments/read', ['id' => $id]); |
|
39 | + return view('Comments/read', [ 'id' => $id ]); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $value = $request->value; |
51 | 51 | |
52 | 52 | $comment = Comments::find($id); |
53 | - $comment->update([$field => $value]); |
|
53 | + $comment->update([ $field => $value ]); |
|
54 | 54 | // Session::flash('success', "Le commentaire a bien été mis à jour"); |
55 | 55 | // return Redirect::route('comments.index'); |
56 | 56 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function delete($id) |
65 | 65 | { |
66 | - return redirect('/comments', ['id' => $id]); |
|
66 | + return redirect('/comments', [ 'id' => $id ]); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function search() |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | $id = $request->input('id'); |
77 | 77 | $action = $request->input('action'); |
78 | 78 | // Récupération en session de l'item "favoris" |
79 | - $liked = session('commentsFavoris', []); |
|
79 | + $liked = session('commentsFavoris', [ ]); |
|
80 | 80 | |
81 | 81 | if ($action == 'add') { |
82 | 82 | |
83 | 83 | // Enregistrement en variable de l'id souhaité |
84 | - $liked[] = $id; |
|
84 | + $liked[ ] = $id; |
|
85 | 85 | // Stockage de cette variable de la session |
86 | 86 | Session::put('commentsFavoris', $liked); |
87 | 87 | } else { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | // On cherche la position de l'id dans le tableau |
90 | 90 | $position = array_search($id, $liked); |
91 | 91 | // On supprime l'élément grâce à sa position |
92 | - unset($liked[$position]); |
|
92 | + unset($liked[ $position ]); |
|
93 | 93 | |
94 | 94 | // Stockage de cette variable de la session |
95 | 95 | Session::put('commentsFavoris', $liked); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function checkout() |
58 | 58 | { |
59 | - $ids = session('likes', []); |
|
59 | + $ids = session('likes', [ ]); |
|
60 | 60 | |
61 | 61 | $total = 0; |
62 | 62 | foreach ($ids as $id) { |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | $payment->setIntent('sale'); |
84 | 84 | $payment->setPayer($payer); |
85 | 85 | $payment->setRedirectUrls($redirectUrls); |
86 | - $payment->setTransactions([$transaction]); |
|
86 | + $payment->setTransactions([ $transaction ]); |
|
87 | 87 | |
88 | 88 | //response de Paypal |
89 | 89 | $response = $payment->create($this->_apiContext); |
90 | 90 | |
91 | - $redirectUrl = $response->links[1]->href; |
|
91 | + $redirectUrl = $response->links[ 1 ]->href; |
|
92 | 92 | |
93 | 93 | //redirect to Plateform Paypal |
94 | 94 | return Redirect::to($redirectUrl); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $executePayment = $payment->execute($paymentExecution, $this->_apiContext); |
122 | 122 | |
123 | 123 | // Clear the shopping cart, |
124 | - $request->session()->pull('likes', []); |
|
124 | + $request->session()->pull('likes', [ ]); |
|
125 | 125 | |
126 | 126 | //write log |
127 | 127 | Log::info('Un client vient de passer uen commande via Paypal'.$payer_id); |