@@ -36,6 +36,6 @@ |
||
36 | 36 | |
37 | 37 | Twilio::message($number, $message); |
38 | 38 | |
39 | - return redirect()->back()->with('info','Your Message has been sent successfully'); |
|
39 | + return redirect()->back()->with('info', 'Your Message has been sent successfully'); |
|
40 | 40 | } |
41 | 41 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Scrape the Links |
36 | - * @param $siteToCrawl |
|
36 | + * @param string $siteToCrawl |
|
37 | 37 | * @return array |
38 | 38 | */ |
39 | 39 | public function getData($siteToCrawl) |
@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | - |
|
7 | -use App\Http\Requests; |
|
8 | 5 | use Goutte\Client; |
9 | 6 | use App\Http\Controllers\Controller; |
10 | 7 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $crawler = $this->client->request('GET', $siteToCrawl); |
42 | 42 | |
43 | 43 | $arr = $crawler->filter('.title a[href^="http"], a[href^="https"]')->each(function($element) { |
44 | - $links = []; |
|
44 | + $links = [ ]; |
|
45 | 45 | |
46 | 46 | array_push($links, $element->text()); |
47 | 47 |
@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | - |
|
7 | -use App\Http\Requests; |
|
8 | 5 | use Goutte\Client; |
9 | 6 | use App\Http\Controllers\Controller; |
10 | 7 |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | class YahooController extends Controller |
12 | 12 | { |
13 | - /** |
|
14 | - * Instance of Guzzle Client |
|
15 | - * @var object |
|
16 | - */ |
|
13 | + /** |
|
14 | + * Instance of Guzzle Client |
|
15 | + * @var object |
|
16 | + */ |
|
17 | 17 | protected $client; |
18 | 18 | |
19 | 19 | /** |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct() |
29 | 29 | { |
30 | - $this->baseUrl = 'https://query.yahooapis.com/v1/public/yql'; |
|
31 | - $this->client = new Client(['base_uri' => $this->baseUrl]); |
|
30 | + $this->baseUrl = 'https://query.yahooapis.com/v1/public/yql'; |
|
31 | + $this->client = new Client(['base_uri' => $this->baseUrl]); |
|
32 | 32 | |
33 | - $query = "SELECT * FROM weather.forecast WHERE (location = 10007)"; |
|
33 | + $query = "SELECT * FROM weather.forecast WHERE (location = 10007)"; |
|
34 | 34 | |
35 | - $relativeUrl = '?q=' . $query . '&format=json'; |
|
36 | - $this->setGetResponse($relativeUrl); |
|
35 | + $relativeUrl = '?q=' . $query . '&format=json'; |
|
36 | + $this->setGetResponse($relativeUrl); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | - /** |
|
68 | - * Return all data to the Yahoo API dashboard |
|
69 | - * @return mixed |
|
70 | - */ |
|
67 | + /** |
|
68 | + * Return all data to the Yahoo API dashboard |
|
69 | + * @return mixed |
|
70 | + */ |
|
71 | 71 | public function getPage() |
72 | 72 | { |
73 | 73 | $data = $this->getData(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function __construct() |
29 | 29 | { |
30 | 30 | $this->baseUrl = 'https://query.yahooapis.com/v1/public/yql'; |
31 | - $this->client = new Client(['base_uri' => $this->baseUrl]); |
|
31 | + $this->client = new Client([ 'base_uri' => $this->baseUrl ]); |
|
32 | 32 | |
33 | 33 | $query = "SELECT * FROM weather.forecast WHERE (location = 10007)"; |
34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | private function setGetResponse($relativeUrl) |
44 | 44 | { |
45 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
45 | + $this->response = $this->client->get($this->baseUrl . $relativeUrl, [ ]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | private function getData() |
62 | 62 | { |
63 | - return $this->getResponse()['query']['results']['channel']; |
|
63 | + return $this->getResponse()[ 'query' ][ 'results' ][ 'channel' ]; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 |
@@ -3,8 +3,6 @@ |
||
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | 5 | use Illuminate\Http\Request; |
6 | - |
|
7 | -use App\Http\Requests; |
|
8 | 6 | use App\Http\Controllers\Controller; |
9 | 7 | use Illuminate\Contracts\Auth\Guard; |
10 | 8 | use Laravel\Socialite\Contracts\Factory as Socialite; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | /** |
37 | 37 | * Send a Text Message |
38 | 38 | * @param Request $request |
39 | - * @return string |
|
39 | + * @return \Illuminate\Http\RedirectResponse |
|
40 | 40 | */ |
41 | 41 | public function sendTextMessage(Request $request) |
42 | 42 | { |
@@ -36,6 +36,6 @@ |
||
36 | 36 | |
37 | 37 | Twilio::message($number, $message); |
38 | 38 | |
39 | - return redirect()->back()->with('info','Your Message has been sent successfully'); |
|
39 | + return redirect()->back()->with('info', 'Your Message has been sent successfully'); |
|
40 | 40 | } |
41 | 41 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Get all delivery routes for this zip code |
36 | - * @param string $zipcdode |
|
36 | + * @param string $zipcode |
|
37 | 37 | * @return array |
38 | 38 | */ |
39 | 39 | private function getRoutes($zipcode) |
@@ -2,9 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | - |
|
7 | -use App\Http\Requests; |
|
8 | 5 | use Goutte\Client; |
9 | 6 | use App\Http\Controllers\Controller; |
10 | 7 |
@@ -38,9 +38,9 @@ |
||
38 | 38 | */ |
39 | 39 | private function getRoutes($zipcode) |
40 | 40 | { |
41 | - $results = $this->lob->routes()->all(['zip_codes' => $zipcode]); |
|
41 | + $results = $this->lob->routes()->all([ 'zip_codes' => $zipcode ]); |
|
42 | 42 | |
43 | - return $results[0]['routes']; |
|
43 | + return $results[ 0 ][ 'routes' ]; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $list = (array)SlackUser::lists(); |
32 | 32 | |
33 | 33 | if (is_null($count)) { |
34 | - return $list['members']; |
|
34 | + return $list['members']; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return array_slice($list['members'], 0, $count); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function sendMessageToTeam(Request $request) |
46 | 46 | { |
47 | - $this->validate($request, [ |
|
47 | + $this->validate($request, [ |
|
48 | 48 | 'message' => 'required' |
49 | 49 | ]); |
50 | 50 |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | */ |
29 | 29 | private function getAllUsersOnYourTeam($count = null) |
30 | 30 | { |
31 | - $list = (array)SlackUser::lists(); |
|
31 | + $list = (array) SlackUser::lists(); |
|
32 | 32 | |
33 | 33 | if (is_null($count)) { |
34 | - return $list['members']; |
|
34 | + return $list[ 'members' ]; |
|
35 | 35 | } |
36 | 36 | |
37 | - return array_slice($list['members'], 0, $count); |
|
37 | + return array_slice($list[ 'members' ], 0, $count); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -52,6 +52,6 @@ discard block |
||
52 | 52 | |
53 | 53 | SlackChat::message('#general', $message); |
54 | 54 | |
55 | - return redirect()->back()->with('info','Your Message has been sent successfully'); |
|
55 | + return redirect()->back()->with('info', 'Your Message has been sent successfully'); |
|
56 | 56 | } |
57 | 57 | } |
@@ -2,15 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | - |
|
7 | -use App\Http\Requests; |
|
8 | 5 | use App\Http\Controllers\Controller; |
9 | 6 | use Facebook; |
10 | -use App\User; |
|
11 | 7 | use Auth; |
12 | 8 | use Session; |
13 | -use Illuminate\Support\Collection; |
|
14 | 9 | |
15 | 10 | class FacebookController extends Controller |
16 | 11 | { |
@@ -41,8 +41,8 @@ |
||
41 | 41 | */ |
42 | 42 | private function getData() |
43 | 43 | { |
44 | - $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken()); |
|
44 | + $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken()); |
|
45 | 45 | |
46 | - return json_decode($data->getGraphUser(),true); |
|
46 | + return json_decode($data->getGraphUser(),true); |
|
47 | 47 | } |
48 | 48 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getPage() |
24 | 24 | { |
25 | - if( Session::get('provider') !== 'facebook') { |
|
25 | + if (Session::get('provider') !== 'facebook') { |
|
26 | 26 | Auth::logout(); |
27 | 27 | |
28 | 28 | Session::flush(); |
@@ -43,6 +43,6 @@ discard block |
||
43 | 43 | { |
44 | 44 | $data = Facebook::get('/me?fields=id,name,cover,email,gender,first_name,last_name,locale,timezone,link,picture', Auth::user()->getAccessToken()); |
45 | 45 | |
46 | - return json_decode($data->getGraphUser(),true); |
|
46 | + return json_decode($data->getGraphUser(), true); |
|
47 | 47 | } |
48 | 48 | } |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | |
14 | 14 | class LinkedInController extends Controller |
15 | 15 | { |
16 | - /** |
|
17 | - * LinkedIn API base Url |
|
18 | - * @var string |
|
19 | - */ |
|
16 | + /** |
|
17 | + * LinkedIn API base Url |
|
18 | + * @var string |
|
19 | + */ |
|
20 | 20 | protected $baseUrl; |
21 | 21 | |
22 | 22 | /** |
@@ -31,19 +31,19 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected $response; |
33 | 33 | |
34 | - /** |
|
35 | - * Initialize the Controller with necessary arguments |
|
36 | - */ |
|
34 | + /** |
|
35 | + * Initialize the Controller with necessary arguments |
|
36 | + */ |
|
37 | 37 | public function __construct() |
38 | 38 | { |
39 | 39 | $this->baseUrl = 'https://api.linkedin.com/v1'; |
40 | 40 | $this->client = new Client(['base_uri' => $this->baseUrl]); |
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
44 | - * Set options for making the Client request |
|
45 | - * @return void |
|
46 | - */ |
|
43 | + /** |
|
44 | + * Set options for making the Client request |
|
45 | + * @return void |
|
46 | + */ |
|
47 | 47 | private function setRequestOptions() |
48 | 48 | { |
49 | 49 | $authBearer = 'Bearer '. Auth::user()->getAccessToken(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct() |
38 | 38 | { |
39 | 39 | $this->baseUrl = 'https://api.linkedin.com/v1'; |
40 | - $this->client = new Client(['base_uri' => $this->baseUrl]); |
|
40 | + $this->client = new Client([ 'base_uri' => $this->baseUrl ]); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | */ |
47 | 47 | private function setRequestOptions() |
48 | 48 | { |
49 | - $authBearer = 'Bearer '. Auth::user()->getAccessToken(); |
|
50 | - $this->client = new Client(['base_uri' => $this->baseUrl, |
|
49 | + $authBearer = 'Bearer ' . Auth::user()->getAccessToken(); |
|
50 | + $this->client = new Client([ 'base_uri' => $this->baseUrl, |
|
51 | 51 | 'headers' => [ |
52 | 52 | 'Authorization' => $authBearer, |
53 | 53 | 'Content-Type' => 'application/json', |
54 | 54 | 'Accept' => 'application/json' |
55 | - ]]); |
|
55 | + ] ]); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | private function setGetResponse($relativeUrl) |
63 | 63 | { |
64 | - $this->response = $this->client->get($this->baseUrl . $relativeUrl, []); |
|
64 | + $this->response = $this->client->get($this->baseUrl . $relativeUrl, [ ]); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function getPage() |
33 | 33 | { |
34 | - if( Session::get('provider') !== 'twitter') { |
|
34 | + if (Session::get('provider') !== 'twitter') { |
|
35 | 35 | Auth::logout(); |
36 | 36 | |
37 | 37 | Session::flush(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $searchedTweets = json_decode($this->searchForTweets($this->searchItem), true); |
43 | 43 | |
44 | - return view('api.twitter')->withTweets($searchedTweets['statuses']); |
|
44 | + return view('api.twitter')->withTweets($searchedTweets[ 'statuses' ]); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function getLatestTweets() |
52 | 52 | { |
53 | - return Twitter::getHomeTimeline(['count' => 2, 'format' => 'json']); |
|
53 | + return Twitter::getHomeTimeline([ 'count' => 2, 'format' => 'json' ]); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | private function searchForTweets($item) |
62 | 62 | { |
63 | - return Twitter::getSearch(['q' => $item, 'count' => 4, 'format' => 'json']); |
|
63 | + return Twitter::getSearch([ 'q' => $item, 'count' => 4, 'format' => 'json' ]); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | |
77 | 77 | $tweet = $request->input('tweet') . ' #LaravelHackathonStarter'; |
78 | 78 | |
79 | - Twitter::reconfig(['token' => Auth::user()->getAccessToken(), 'secret' => Auth::user()->getAccessTokenSecret()]); |
|
79 | + Twitter::reconfig([ 'token' => Auth::user()->getAccessToken(), 'secret' => Auth::user()->getAccessTokenSecret() ]); |
|
80 | 80 | |
81 | - Twitter::postTweet(['status' => $tweet, 'format' => 'json']); |
|
81 | + Twitter::postTweet([ 'status' => $tweet, 'format' => 'json' ]); |
|
82 | 82 | |
83 | - return redirect()->back()->with('info','Your Tweet has been posted successfully'); |
|
83 | + return redirect()->back()->with('info', 'Your Tweet has been posted successfully'); |
|
84 | 84 | } |
85 | 85 | } |