@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | public function handle() |
| 42 | 42 | { |
| 43 | 43 | |
| 44 | - $infos = \Thujohn\Twitter\Facades\Twitter::getUsersLookup(['screen_name' => 'Symfomany','format' => 'php']); |
|
| 44 | + $infos = \Thujohn\Twitter\Facades\Twitter::getUsersLookup([ 'screen_name' => 'Symfomany', 'format' => 'php' ]); |
|
| 45 | 45 | |
| 46 | - if(!empty($infos)){ |
|
| 46 | + if (!empty($infos)) { |
|
| 47 | 47 | DB::connection('mongodb')->collection('stats') |
| 48 | - ->where(['origin' => 'Twitter', 'type' => 'infos'])->delete(); |
|
| 48 | + ->where([ 'origin' => 'Twitter', 'type' => 'infos' ])->delete(); |
|
| 49 | 49 | |
| 50 | 50 | $stat = new Stats(); |
| 51 | 51 | $stat->origin = "Twitter"; |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| 58 | - $tweets = \Thujohn\Twitter\Facades\Twitter::getDmsOut(['format' => 'php']); |
|
| 59 | - if(!empty($tweets)){ |
|
| 58 | + $tweets = \Thujohn\Twitter\Facades\Twitter::getDmsOut([ 'format' => 'php' ]); |
|
| 59 | + if (!empty($tweets)) { |
|
| 60 | 60 | |
| 61 | 61 | DB::connection('mongodb')->collection('tweets') |
| 62 | - ->where(['origin' => 'Twitter', 'type' => 'dmsout']) |
|
| 62 | + ->where([ 'origin' => 'Twitter', 'type' => 'dmsout' ]) |
|
| 63 | 63 | ->delete(); |
| 64 | - foreach($tweets as $tweet){ |
|
| 64 | + foreach ($tweets as $tweet) { |
|
| 65 | 65 | $vi = new Tweets(); |
| 66 | 66 | $vi->origin = "Twitter"; |
| 67 | 67 | $vi->type = "dmsout"; |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $tweets = \Thujohn\Twitter\Facades\Twitter::getFavorites(['format' => 'php']); |
|
| 74 | - if(!empty($tweets)){ |
|
| 73 | + $tweets = \Thujohn\Twitter\Facades\Twitter::getFavorites([ 'format' => 'php' ]); |
|
| 74 | + if (!empty($tweets)) { |
|
| 75 | 75 | |
| 76 | 76 | DB::connection('mongodb')->collection('tweets') |
| 77 | - ->where(['origin' => 'Twitter', 'type' => 'favorites']) |
|
| 77 | + ->where([ 'origin' => 'Twitter', 'type' => 'favorites' ]) |
|
| 78 | 78 | ->delete(); |
| 79 | - foreach($tweets as $tweet){ |
|
| 79 | + foreach ($tweets as $tweet) { |
|
| 80 | 80 | $vi = new Tweets(); |
| 81 | 81 | $vi->origin = "Twitter"; |
| 82 | 82 | $vi->type = "favorites"; |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | $tweets = \Thujohn\Twitter\Facades\Twitter::getMentionsTimeline( |
| 89 | 89 | [ |
| 90 | 90 | 'count' => 15, |
| 91 | - 'format' => 'php']); |
|
| 91 | + 'format' => 'php' ]); |
|
| 92 | 92 | |
| 93 | - if(!empty($tweets)){ |
|
| 93 | + if (!empty($tweets)) { |
|
| 94 | 94 | |
| 95 | 95 | DB::connection('mongodb')->collection('tweets') |
| 96 | - ->where(['origin' => 'Twitter', 'type' => 'mentionstimeline']) |
|
| 96 | + ->where([ 'origin' => 'Twitter', 'type' => 'mentionstimeline' ]) |
|
| 97 | 97 | ->delete(); |
| 98 | - foreach($tweets as $tweet){ |
|
| 98 | + foreach ($tweets as $tweet) { |
|
| 99 | 99 | $vi = new Tweets(); |
| 100 | 100 | $vi->origin = "Twitter"; |
| 101 | 101 | $vi->type = "mentionstimeline"; |
@@ -107,14 +107,14 @@ discard block |
||
| 107 | 107 | $tweets = \Thujohn\Twitter\Facades\Twitter::getHomeTimeline( |
| 108 | 108 | [ |
| 109 | 109 | 'count' => 15, |
| 110 | - 'format' => 'php']); |
|
| 110 | + 'format' => 'php' ]); |
|
| 111 | 111 | |
| 112 | - if(!empty($tweets)){ |
|
| 112 | + if (!empty($tweets)) { |
|
| 113 | 113 | |
| 114 | 114 | DB::connection('mongodb')->collection('tweets') |
| 115 | - ->where(['origin' => 'Twitter', 'type' => 'hometimeline']) |
|
| 115 | + ->where([ 'origin' => 'Twitter', 'type' => 'hometimeline' ]) |
|
| 116 | 116 | ->delete(); |
| 117 | - foreach($tweets as $tweet){ |
|
| 117 | + foreach ($tweets as $tweet) { |
|
| 118 | 118 | $vi = new Tweets(); |
| 119 | 119 | $vi->data = $tweet; |
| 120 | 120 | $vi->origin = "Twitter"; |
@@ -127,14 +127,14 @@ discard block |
||
| 127 | 127 | [ |
| 128 | 128 | 'screen_name' => 'allocine', |
| 129 | 129 | 'count' => 15, |
| 130 | - 'format' => 'php']); |
|
| 130 | + 'format' => 'php' ]); |
|
| 131 | 131 | |
| 132 | - if(!empty($tweets)){ |
|
| 132 | + if (!empty($tweets)) { |
|
| 133 | 133 | |
| 134 | 134 | DB::connection('mongodb')->collection('tweets') |
| 135 | - ->where(['origin' => 'Twitter', 'type' => 'usertimeline']) |
|
| 135 | + ->where([ 'origin' => 'Twitter', 'type' => 'usertimeline' ]) |
|
| 136 | 136 | ->delete(); |
| 137 | - foreach($tweets as $tweet){ |
|
| 137 | + foreach ($tweets as $tweet) { |
|
| 138 | 138 | $vi = new Tweets(); |
| 139 | 139 | $vi->data = $tweet; |
| 140 | 140 | $vi->origin = "Twitter"; |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $channel = Yt::getChannelByName('allocine'); |
| 50 | 50 | |
| 51 | - if(!empty($channel)) { |
|
| 51 | + if (!empty($channel)) { |
|
| 52 | 52 | DB::connection('mongodb')->collection('stats') |
| 53 | - ->where(['origin' => 'Youtube', 'type' => 'infos'])->delete(); |
|
| 53 | + ->where([ 'origin' => 'Youtube', 'type' => 'infos' ])->delete(); |
|
| 54 | 54 | |
| 55 | 55 | $stat = new Stats(); |
| 56 | 56 | $stat->origin = "Youtube"; |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | 'maxResults' => 30 |
| 67 | 67 | ); |
| 68 | 68 | |
| 69 | - $videos = Yt::searchAdvanced($params, true)['results']; |
|
| 69 | + $videos = Yt::searchAdvanced($params, true)[ 'results' ]; |
|
| 70 | 70 | |
| 71 | - if(!empty($videos)){ |
|
| 71 | + if (!empty($videos)) { |
|
| 72 | 72 | |
| 73 | 73 | DB::connection('mongodb')->collection('videos')->delete(); |
| 74 | - foreach($videos as $video){ |
|
| 74 | + foreach ($videos as $video) { |
|
| 75 | 75 | $vi = new Videos(); |
| 76 | 76 | $vi->data = $video; |
| 77 | 77 | $vi->save(); |
@@ -10,12 +10,12 @@ discard block |
||
| 10 | 10 | * Sufficé par le mot clef Controller |
| 11 | 11 | * et doit hérité de la super classe Controller |
| 12 | 12 | */ |
| 13 | -class DirectorsController extends Controller{ |
|
| 13 | +class DirectorsController extends Controller { |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Page Acceuil |
| 17 | 17 | */ |
| 18 | - public function index(){ |
|
| 18 | + public function index() { |
|
| 19 | 19 | |
| 20 | 20 | // vue |
| 21 | 21 | return view('Directors/index'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * Page Acceuil |
| 28 | 28 | */ |
| 29 | - public function create(){ |
|
| 29 | + public function create() { |
|
| 30 | 30 | |
| 31 | 31 | // vue |
| 32 | 32 | return view('Directors/create'); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * Page Acceuil |
| 37 | 37 | */ |
| 38 | - public function edit($id){ |
|
| 38 | + public function edit($id) { |
|
| 39 | 39 | |
| 40 | 40 | // vue |
| 41 | 41 | return view('Directors/edit'); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * Page Acceuil |
| 46 | 46 | */ |
| 47 | - public function read($id){ |
|
| 47 | + public function read($id) { |
|
| 48 | 48 | |
| 49 | 49 | // vue |
| 50 | 50 | return view('Directors/read'); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Page Acceuil |
| 55 | 55 | */ |
| 56 | - public function delete($id){ |
|
| 56 | + public function delete($id) { |
|
| 57 | 57 | |
| 58 | 58 | } |
| 59 | 59 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * Classe Request permet de réceptionner les données |
| 65 | 65 | * en POST de manières scurisés |
| 66 | 66 | */ |
| 67 | - public function store(Request $request){ |
|
| 67 | + public function store(Request $request) { |
|
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | } |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | * Sufficé par le mot clef Controller |
| 11 | 11 | * et doit hérité de la super classe Controller |
| 12 | 12 | */ |
| 13 | -class ActorsController extends Controller{ |
|
| 13 | +class ActorsController extends Controller { |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Page Acceuil |
| 18 | 18 | */ |
| 19 | - public function index(){ |
|
| 19 | + public function index() { |
|
| 20 | 20 | |
| 21 | 21 | $actors = Actors::all(); |
| 22 | 22 | // vue |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Page Acceuil |
| 31 | 31 | */ |
| 32 | - public function read($id){ |
|
| 32 | + public function read($id) { |
|
| 33 | 33 | |
| 34 | 34 | // vue |
| 35 | 35 | return view('Actors/read'); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Page Acceuil |
| 40 | 40 | */ |
| 41 | - public function create(){ |
|
| 41 | + public function create() { |
|
| 42 | 42 | |
| 43 | 43 | // vue |
| 44 | 44 | return view('Actors/create'); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * Page Acceuil |
| 49 | 49 | */ |
| 50 | - public function edit($id){ |
|
| 50 | + public function edit($id) { |
|
| 51 | 51 | |
| 52 | 52 | // vue |
| 53 | 53 | return view('Actors/edit'); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * Page Acceuil |
| 58 | 58 | */ |
| 59 | - public function delete($id){ |
|
| 59 | + public function delete($id) { |
|
| 60 | 60 | |
| 61 | 61 | } |
| 62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * Classe Request permet de réceptionner les données |
| 68 | 68 | * en POST de manières scurisés |
| 69 | 69 | */ |
| 70 | - public function store(Request $request){ |
|
| 70 | + public function store(Request $request) { |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * Class CartController |
| 14 | 14 | * To handle checkout |
| 15 | 15 | */ |
| 16 | -class CartController extends Controller{ |
|
| 16 | +class CartController extends Controller { |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | /** |
| 57 | 57 | * Payments |
| 58 | 58 | */ |
| 59 | - public function checkout(){ |
|
| 59 | + public function checkout() { |
|
| 60 | 60 | |
| 61 | - $ids = session('likes', []); |
|
| 61 | + $ids = session('likes', [ ]); |
|
| 62 | 62 | |
| 63 | 63 | $total = 0; |
| 64 | - foreach($ids as $id){ |
|
| 64 | + foreach ($ids as $id) { |
|
| 65 | 65 | $movie = Movies::find($id); |
| 66 | 66 | $total = $total + $movie->price; |
| 67 | 67 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $transaction = PayPal::Transaction(); |
| 77 | 77 | $transaction->setAmount($amount); |
| 78 | - $transaction->setDescription("Récapitulatif total des ".count($ids). " films commandés"); |
|
| 78 | + $transaction->setDescription("Récapitulatif total des ".count($ids)." films commandés"); |
|
| 79 | 79 | |
| 80 | 80 | $redirectUrls = PayPal::RedirectUrls(); |
| 81 | 81 | $redirectUrls->setReturnUrl(route('cart_done')); |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | //response de Paypal |
| 91 | 91 | $response = $payment->create($this->_apiContext); |
| 92 | 92 | |
| 93 | - $redirectUrl = $response->links[1]->href; |
|
| 93 | + $redirectUrl = $response->links[ 1 ]->href; |
|
| 94 | 94 | |
| 95 | 95 | //redirect to Plateform Paypal |
| 96 | - return Redirect::to( $redirectUrl); |
|
| 96 | + return Redirect::to($redirectUrl); |
|
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | /** |
| 105 | 105 | * Payments Récapitilatif |
| 106 | 106 | */ |
| 107 | - public function recapitulatif(){ |
|
| 107 | + public function recapitulatif() { |
|
| 108 | 108 | |
| 109 | 109 | return view("Cart/recapitulatif"); |
| 110 | 110 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | /** |
| 113 | 113 | * Done |
| 114 | 114 | */ |
| 115 | - public function done(Request $request){ |
|
| 115 | + public function done(Request $request) { |
|
| 116 | 116 | |
| 117 | 117 | //je recupere les informations de retour de Paypal |
| 118 | 118 | $id = $request->get('paymentId'); |
@@ -127,10 +127,10 @@ discard block |
||
| 127 | 127 | $executePayment = $payment->execute($paymentExecution, $this->_apiContext); |
| 128 | 128 | |
| 129 | 129 | // Clear the shopping cart, |
| 130 | - $request->session()->pull('likes', []); |
|
| 130 | + $request->session()->pull('likes', [ ]); |
|
| 131 | 131 | |
| 132 | 132 | //write log |
| 133 | - Log::info("Un client vient de passer uen commande via Paypal" . $payer_id); |
|
| 133 | + Log::info("Un client vient de passer uen commande via Paypal".$payer_id); |
|
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | // Write database |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | /** |
| 148 | 148 | * Cancel |
| 149 | 149 | */ |
| 150 | - public function cancel(){ |
|
| 150 | + public function cancel() { |
|
| 151 | 151 | |
| 152 | 152 | } |
| 153 | 153 | |
@@ -11,12 +11,12 @@ discard block |
||
| 11 | 11 | * Sufficé par le mot clef Controller |
| 12 | 12 | * et doit hérité de la super classe Controller |
| 13 | 13 | */ |
| 14 | -class CategoriesController extends Controller{ |
|
| 14 | +class CategoriesController extends Controller { |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Page de liste des catégories |
| 18 | 18 | */ |
| 19 | - public function index(){ |
|
| 19 | + public function index() { |
|
| 20 | 20 | |
| 21 | 21 | // récupérer toutes mes catégories |
| 22 | 22 | $categories = Categories::all(); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Page Acceuil |
| 32 | 32 | */ |
| 33 | - public function create(){ |
|
| 33 | + public function create() { |
|
| 34 | 34 | |
| 35 | 35 | // vue |
| 36 | 36 | return view('Categories/create'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * Page Acceuil |
| 42 | 42 | */ |
| 43 | - public function edit(){ |
|
| 43 | + public function edit() { |
|
| 44 | 44 | |
| 45 | 45 | // vue |
| 46 | 46 | return view('Categories/edit'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * Page Acceuil |
| 51 | 51 | */ |
| 52 | - public function read($id){ |
|
| 52 | + public function read($id) { |
|
| 53 | 53 | |
| 54 | 54 | // vue |
| 55 | 55 | return view('Categories/read'); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | /** |
| 59 | 59 | * Page Acceuil |
| 60 | 60 | */ |
| 61 | - public function delete(){ |
|
| 61 | + public function delete() { |
|
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * Classe Request permet de réceptionner les données |
| 70 | 70 | * en POST de manières scurisés |
| 71 | 71 | */ |
| 72 | - public function store(Request $request){ |
|
| 72 | + public function store(Request $request) { |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * de ma table movies |
| 13 | 13 | * Hérite de ma super classe Model |
| 14 | 14 | */ |
| 15 | -class Movies extends Model implements ItemInterface{ |
|
| 15 | +class Movies extends Model implements ItemInterface { |
|
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Retourne tous les films |
| 32 | 32 | */ |
| 33 | - public function getAllMovies(){ |
|
| 33 | + public function getAllMovies() { |
|
| 34 | 34 | |
| 35 | 35 | // retourne le resultat de ma requete SELECT * FROM movies |
| 36 | 36 | return DB::table('movies')->get(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * Return moyenne des notes de presse |
| 43 | 43 | */ |
| 44 | - public function getAvgNotePresse(){ |
|
| 44 | + public function getAvgNotePresse() { |
|
| 45 | 45 | $result = DB::table('movies') |
| 46 | 46 | ->select(DB::raw("ROUND(AVG(note_presse)) as avgpress")) |
| 47 | 47 | ->first(); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function user() |
| 70 | 70 | { |
| 71 | - return $this->belongsToMany('App\Http\Models\User', 'user_favoris', 'movies_id', 'user_id'); |
|
| 71 | + return $this->belongsToMany('App\Http\Models\User', 'user_favoris', 'movies_id', 'user_id'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | * Interface ItemInterface |
| 9 | 9 | * @package App\Http\Cart |
| 10 | 10 | */ |
| 11 | -class MoviesItem implements ItemInterface{ |
|
| 11 | +class MoviesItem implements ItemInterface { |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * @var $id |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * Constructor |
| 20 | 20 | * @param $id |
| 21 | 21 | */ |
| 22 | - public function __construct($id){ |
|
| 22 | + public function __construct($id) { |
|
| 23 | 23 | |
| 24 | 24 | $this->id = $id; |
| 25 | 25 | } |
@@ -27,22 +27,22 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * @return mixed |
| 29 | 29 | */ |
| 30 | - public function add(ItemInterface $item){} |
|
| 30 | + public function add(ItemInterface $item) {} |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @return mixed |
| 34 | 34 | */ |
| 35 | - public function remove(ItemInterface $item){} |
|
| 35 | + public function remove(ItemInterface $item) {} |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | - public function clear(){} |
|
| 40 | + public function clear() {} |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * @return mixed |
| 44 | 44 | */ |
| 45 | - public function all(){} |
|
| 45 | + public function all() {} |
|
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | * @return mixed |
| 51 | 51 | * @throws ItemException |
| 52 | 52 | */ |
| 53 | - public function getMovie(){ |
|
| 53 | + public function getMovie() { |
|
| 54 | 54 | $movie = Movies::find($this->id); |
| 55 | 55 | |
| 56 | - if($movie->price !== 0){ |
|
| 56 | + if ($movie->price !== 0) { |
|
| 57 | 57 | throw new ItemException('Le produit a un prix à 0'); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * @return mixed |
| 66 | 66 | * @throws ItemException |
| 67 | 67 | */ |
| 68 | - public function __toString(){ |
|
| 68 | + public function __toString() { |
|
| 69 | 69 | return $this->getMovie()->id; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -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 | } |