1 | <?php |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
2 | |||
3 | /** |
||
0 ignored issues
–
show
|
|||
4 | * Google Adsense Ads for Laravel. |
||
5 | * |
||
6 | * Package for easily including Google Adsense Ad units |
||
7 | * in Laravel and Lumen. |
||
8 | * |
||
9 | * @developer Martin Butt <https://www.martinbutt.com/> |
||
0 ignored issues
–
show
|
|||
10 | * |
||
11 | * @copyright Copyright (c) 2021 Martin Butt |
||
0 ignored issues
–
show
|
|||
12 | * @license MIT |
||
0 ignored issues
–
show
|
|||
13 | * |
||
14 | * Copyright (c) 2016 Galen Han |
||
15 | * Copyright (c) 2019 Crypto Technology srl |
||
16 | * Copyright (c) 2021 Martin Butt |
||
17 | * |
||
18 | * |
||
19 | * Permission is hereby granted, free of charge, to any person obtaining a copy of |
||
0 ignored issues
–
show
|
|||
20 | * this software and associated documentation files (the "Software"), to deal in |
||
21 | * the Software without restriction, including without limitation the rights to |
||
22 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
||
0 ignored issues
–
show
|
|||
23 | * the Software, and to permit persons to whom the Software is furnished to do so, |
||
0 ignored issues
–
show
|
|||
24 | * subject to the following conditions: |
||
25 | * |
||
26 | * The above copyright notice and this permission notice shall be included in all |
||
0 ignored issues
–
show
|
|||
27 | * copies or substantial portions of the Software. |
||
28 | * |
||
29 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
30 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
||
0 ignored issues
–
show
|
|||
31 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
||
0 ignored issues
–
show
|
|||
32 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
||
0 ignored issues
–
show
|
|||
33 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||
34 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||
35 | */ |
||
0 ignored issues
–
show
|
|||
36 | |||
37 | declare(strict_types=1); |
||
38 | |||
39 | namespace MartinButt\Laravel\Adsense; |
||
40 | |||
41 | class AdsenseBuilder |
||
0 ignored issues
–
show
|
|||
42 | { |
||
0 ignored issues
–
show
|
|||
43 | public function ads($unit) |
||
0 ignored issues
–
show
|
|||
44 | { |
||
0 ignored issues
–
show
|
|||
45 | return view('adsense::ads')->with([ |
||
0 ignored issues
–
show
|
|||
46 | 'ad_client' => config('adsense.client_id'), |
||
0 ignored issues
–
show
|
|||
47 | 'ad_style' => config("adsense.ads.$unit.ad_style", 'display:block;'), |
||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $unit instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
![]() |
|||
48 | 'ad_slot' => config("adsense.ads.$unit.ad_slot"), |
||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $unit instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
![]() |
|||
49 | 'ad_format' => config("adsense.ads.$unit.ad_format"), |
||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $unit instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
![]() |
|||
50 | 'ad_full_width_responsive' => config("adsense.ads.$unit.ad_full_width_responsive"), |
||
0 ignored issues
–
show
As per coding-style, please use concatenation or
sprintf for the variable $unit instead of interpolation.
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings. // Instead of
$x = "foo $bar $baz";
// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
![]() |
|||
51 | ]); |
||
52 | } |
||
0 ignored issues
–
show
|
|||
53 | 2 | ||
54 | public function javascript() |
||
0 ignored issues
–
show
|
|||
55 | 2 | { |
|
0 ignored issues
–
show
|
|||
56 | return view('adsense::javascript', ['client_id' => config('adsense.client_id')]); |
||
0 ignored issues
–
show
|
|||
57 | } |
||
0 ignored issues
–
show
|
|||
58 | } |
||
0 ignored issues
–
show
|
|||
59 |