diff --git a/app/Http/Controllers/EndPageController.php b/app/Http/Controllers/EndPageController.php index 8021ed7..de8ed2f 100644 --- a/app/Http/Controllers/EndPageController.php +++ b/app/Http/Controllers/EndPageController.php @@ -6,6 +6,10 @@ use App\Models\Settings; class EndPageController extends Controller { + /** + * index + * @return \Illuminate\View\View|Illuminate\Http\RedirectResponse + */ public function index() { $settings = app(Settings::class) diff --git a/app/Http/Controllers/EnterCodeController.php b/app/Http/Controllers/EnterCodeController.php index a9a4f5e..4567845 100644 --- a/app/Http/Controllers/EnterCodeController.php +++ b/app/Http/Controllers/EnterCodeController.php @@ -102,7 +102,8 @@ class EnterCodeController extends Controller } catch (\ErrorException $e) { // Unbind instant gagnant. $participation->instantWin()->delete(); - // TODO: si erreur il faut envoyer un mail à equipe.web@ldc.fr + // phpcs:ignore + // TODO: si erreur il faut envoyer un mail à equipe.web@ldc.fr. } //end try } return $this->serveCouponWin($settings, $participation); diff --git a/app/Http/Controllers/FAQController.php b/app/Http/Controllers/FAQController.php index c67f497..8f26f78 100644 --- a/app/Http/Controllers/FAQController.php +++ b/app/Http/Controllers/FAQController.php @@ -7,6 +7,10 @@ use App\Models\FaqTheme; class FAQController extends Controller { + /** + * index + * @return \Illuminate\View\View + */ public function index() { $questions = FaqQuestion::all(); diff --git a/app/Http/Controllers/GainsController.php b/app/Http/Controllers/GainsController.php index 0cc89f5..fd192a4 100644 --- a/app/Http/Controllers/GainsController.php +++ b/app/Http/Controllers/GainsController.php @@ -4,6 +4,10 @@ namespace App\Http\Controllers; class GainsController extends Controller { + /** + * index + * @return \Illuminate\View\View + */ public function index() { if (view()->exists('front.basic.gains')) { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index fc20c85..989c9e2 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -4,6 +4,10 @@ namespace App\Http\Controllers; class HomeController extends Controller { + /** + * home + * @return \Illuminate\View\View + */ public function home() { return view('front.basic.home'); diff --git a/app/Http/Controllers/HowToPlayController.php b/app/Http/Controllers/HowToPlayController.php index 7073fd5..52b35d0 100644 --- a/app/Http/Controllers/HowToPlayController.php +++ b/app/Http/Controllers/HowToPlayController.php @@ -4,6 +4,10 @@ namespace App\Http\Controllers; class HowToPlayController extends Controller { + /** + * index + * @return \Illuminate\View\View|Illuminate\Http\RedirectResponse + */ public function index() { if (view()->exists('front.basic.how-to-play')) { diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index cab45b7..b10ee2b 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -22,6 +22,10 @@ class LoginController extends Controller $this->apiCrm = new \LDCCRM\ApiV1(config('crm.endpoint'), config('crm.token')); } + /** + * index + * @return \Illuminate\View\View + */ public function index() { return view('front.basic.login'); @@ -114,6 +118,7 @@ class LoginController extends Controller } //end if }//end if + // phpcs:ignore // TODO : Modifier avec separation guard. $tmpPwd = "MOTDEPASSE"; if ($userLocal->role <= 2) { @@ -130,13 +135,21 @@ class LoginController extends Controller } } + /** + * logout + * @return Illuminate\Http\RedirectResponse + */ public function logout() { Auth::logout(); return redirect()->route('home'); } - - public function confirmEmail($verifyToken) + /** + * confirm email + * @param string $verifyToken + * @return \Illuminate\View\View|Illuminate\Http\RedirectResponse + */ + public function confirmEmail(string $verifyToken) { $result = false; $user = User::where('email_verify_token', $verifyToken)->first(); diff --git a/app/Http/Controllers/ProduitsController.php b/app/Http/Controllers/ProduitsController.php index 13c9528..7ff48d2 100644 --- a/app/Http/Controllers/ProduitsController.php +++ b/app/Http/Controllers/ProduitsController.php @@ -6,6 +6,10 @@ use App\Models\Range; class ProduitsController extends Controller { + /** + * index + * @return \Illuminate\View\View|Illuminate\Http\RedirectResponse + */ public function index() { $ranges = Range::with('products')->orderBy('id')->get(); diff --git a/app/Http/Controllers/re7Controller.php b/app/Http/Controllers/re7Controller.php index 483295a..f176c46 100644 --- a/app/Http/Controllers/re7Controller.php +++ b/app/Http/Controllers/re7Controller.php @@ -7,11 +7,19 @@ use App\Models\Reduction; class re7Controller extends Controller { + /** + * index + * @return \Illuminate\View\View + */ public function index() { return view('re7'); } + /** + * teaser + * @return \Illuminate\View\View + */ public function teaser() { $settings = app(Settings::class) @@ -19,16 +27,28 @@ class re7Controller extends Controller return view('front.basic.teaser', compact('settings')); } + /** + * prizeMail + * @return \Illuminate\View\View + */ public function prizeMail() { return view('front.basic.prize-mail'); } + /** + * reductionMail + * @return \Illuminate\View\View + */ public function reductionMail() { return view('front.basic.reduction-mail'); } + /** + * br + * @return \Illuminate\View\View + */ public function br() { $settings = app(Settings::class); @@ -37,18 +57,29 @@ class re7Controller extends Controller return view('front.basic.reduction', compact('coupon', 'crmCoupon')); } + /** + * gain 1 + * @return \Illuminate\View\View + */ public function gain1() { return view('front.basic.gain1'); } + /** + * gain 2 + * @return \Illuminate\View\View + */ public function gain2() { return view('front.basic.gain2'); } - - - private function getRandomCoupon($settings) + /** + * getRandomCoupon + * @param App\Models\Settings $settings + * @return string + */ + private function getRandomCoupon(Settings $settings) { $webCoupons = json_decode($settings->web_coupons); if (count($webCoupons) > 1) { diff --git a/app/Models/CodeEan.php b/app/Models/CodeEan.php index 41f3a71..dc07b29 100644 --- a/app/Models/CodeEan.php +++ b/app/Models/CodeEan.php @@ -20,6 +20,10 @@ class CodeEan extends Model */ public $timestamps = false; + /** + * Participations relation + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function participations() { return $this->hasMany(Participation::class); diff --git a/app/Models/FaqQuestion.php b/app/Models/FaqQuestion.php index be32475..8e57fe2 100644 --- a/app/Models/FaqQuestion.php +++ b/app/Models/FaqQuestion.php @@ -16,16 +16,26 @@ class FaqQuestion extends Model 'negative_vote', 'theme_id' ]; + /** + * Theme relation + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function theme() { return $this->belongsTo(FaqTheme::class, 'theme_id'); } + /** + * get Utility + * @return float|integer + */ public function getUtilityAttribute() { $pourcent = 0; - if ($this->positive_vote !== null && $this->negative_vote !== null && $this->positive_vote >= $this->negative_vote && $this->positive_vote > 0 && $this->negative_vote > 0) { + if ( + $this->positive_vote !== null && $this->negative_vote !== null && $this->positive_vote >= $this->negative_vote && $this->positive_vote > 0 && $this->negative_vote > 0 + ) { $ratio = $this->negative_vote / $this->positive_vote; $pourcent = ceil((1 - $ratio) * 100); } diff --git a/app/Models/FaqTheme.php b/app/Models/FaqTheme.php index 20cd541..4f56a73 100644 --- a/app/Models/FaqTheme.php +++ b/app/Models/FaqTheme.php @@ -20,6 +20,10 @@ class FaqTheme extends Model */ protected $with = ['questions']; + /** + * Question relation + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function questions() { return $this->hasMany(FaqQuestion::class, 'theme_id'); diff --git a/app/Models/GainView.php b/app/Models/GainView.php index 9a87f34..3e8600d 100644 --- a/app/Models/GainView.php +++ b/app/Models/GainView.php @@ -13,6 +13,10 @@ class GainView extends Model */ protected $fillable = ['name', 'file_name']; + /** + * Prize relation + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function prizes() { return $this->hasMany(Prize::class, 'gain_view_id'); diff --git a/app/Models/Product.php b/app/Models/Product.php index 3a253a0..da5c19d 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -6,6 +6,10 @@ use Illuminate\Database\Eloquent\Model; class Product extends Model { + /** + * Range relation + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function range() { return $this->belongsTo(Range::class); diff --git a/app/Models/Range.php b/app/Models/Range.php index 22b8ee0..5b925b9 100644 --- a/app/Models/Range.php +++ b/app/Models/Range.php @@ -13,6 +13,10 @@ class Range extends Model */ protected $fillable = ['name']; + /** + * Product relation + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ public function products() { return $this->hasMany(Product::class); diff --git a/config/app.php b/config/app.php index 585a7a7..c574d0f 100644 --- a/config/app.php +++ b/config/app.php @@ -139,6 +139,7 @@ return [ /* * Laravel Framework Service Providers... */ + Illuminate\Auth\AuthServiceProvider::class, Illuminate\Bus\BusServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class, @@ -168,6 +169,7 @@ return [ /* * Application Service Providers... */ + App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, App\Providers\EventServiceProvider::class, diff --git a/config/cache.php b/config/cache.php index 1f46a6f..12cf3c9 100644 --- a/config/cache.php +++ b/config/cache.php @@ -61,6 +61,7 @@ return [ env('MEMCACHED_PASSWORD'), ], 'options' => [ + // phpcs:ignore // Memcached::OPT_CONNECT_TIMEOUT => 2000, ], 'servers' => [ diff --git a/config/mail.php b/config/mail.php index bee3d68..0b5b1e3 100644 --- a/config/mail.php +++ b/config/mail.php @@ -15,7 +15,7 @@ return [ 'default' => env('MAIL_MAILER', 'smtp'), - // Mail admin pour l'envoi de mail comme la fin de la génération des codes uniques + // Mail admin pour l'envoi de mail comme la fin de la génération des codes uniques. 'MAIL_ADMIN' => env('MAIL_ADMIN'), 'contactsList' => [ diff --git a/routes/web-bo.php b/routes/web-bo.php index 7e8398a..d77de7c 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -76,10 +76,4 @@ Route::prefix('bo') ->withoutMiddleware('is-super-admin'); Route::resource('ranges', RangeController::class) ->withoutMiddleware('is-super-admin'); - - // Route::get('/products', 'ProductsController@index')->name('products'); - // Route::get('/products/{id}', 'ProductsController@edit')->name('products.edit'); - // Route::post('/products/{id}', 'ProductsController@update')->name('products.update'); - // Route::post('/ajax/delete-prize', 'PrizesController@destroy'); - // Route::post('/ajax/save-prizes', 'PrizesController@saveDatas'); }); diff --git a/routes/web-re7.php b/routes/web-re7.php index 7f259fe..9e70d24 100644 --- a/routes/web-re7.php +++ b/routes/web-re7.php @@ -11,6 +11,7 @@ Route::prefix('re7') Route::get('/mail-gain', [re7Controller::class, 'prizeMail']); Route::get('/mail-reduction', [re7Controller::class, 'reductionMail']); Route::get('/br', [re7Controller::class, 'br']); + // phpcs:ignore // TODO : Rendre dynamique la partie gain par rapport au BO. Route::get('/gain1', [re7Controller::class, 'gain1']); Route::get('/gain2', [re7Controller::class, 'gain2']);