Skip to content

Commit

Permalink
Add DateTime type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Mar 14, 2015
1 parent 3fdad93 commit dd9cc61
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/LaravelAnalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getVisitorsAndPageViews($numberOfDays = 365, $groupBy = 'date')
*
* @return Collection
*/
public function getVisitorsAndPageViewsForPeriod($startDate, $endDate, $groupBy = 'date')
public function getVisitorsAndPageViewsForPeriod(DateTime $startDate, DateTime $endDate, $groupBy = 'date')
{
$visitorData = [];
$answer = $this->performQuery($startDate, $endDate, 'ga:visits,ga:pageviews', ['dimensions' => 'ga:'.$groupBy]);
Expand Down Expand Up @@ -85,7 +85,7 @@ public function getTopKeywords($numberOfDays = 365, $maxResults = 30)
*
* @return Collection
*/
public function getTopKeyWordsForPeriod($startDate, $endDate, $maxResults = 30)
public function getTopKeyWordsForPeriod(DateTime $startDate, DateTime $endDate, $maxResults = 30)
{
$keywordData = [];

Expand Down Expand Up @@ -126,7 +126,7 @@ public function getTopReferrers($numberOfDays = 365, $maxResults = 20)
*
* @return Collection
*/
public function getTopReferrersForPeriod($startDate, $endDate, $maxResults)
public function getTopReferrersForPeriod(DateTime $startDate, DateTime $endDate, $maxResults)
{
$referrerData = [];

Expand Down Expand Up @@ -167,7 +167,7 @@ public function getTopBrowsers($numberOfDays = 365, $maxResults = 6)
*
* @return Collection
*/
public function getTopBrowsersForPeriod($startDate, $endDate, $maxResults)
public function getTopBrowsersForPeriod(DateTime $startDate, DateTime $endDate, $maxResults)
{
$browserData = [];
$answer = $this->performQuery($startDate, $endDate, 'ga:sessions', ['dimensions' => 'ga:browser', 'sort' => '-ga:sessions']);
Expand Down Expand Up @@ -216,7 +216,7 @@ public function getMostVisitedPages($numberOfDays = 365, $maxResults = 20)
*
* @return Collection
*/
public function getMostVisitedPagesForPeriod($startDate, $endDate, $maxResults = 20)
public function getMostVisitedPagesForPeriod(DateTime $startDate, DateTime $endDate, $maxResults = 20)
{
$pagesData = [];

Expand Down Expand Up @@ -257,7 +257,7 @@ public function getSiteIdByUrl($url)
*
* @return mixed
*/
public function performQuery($startDate, $endDate, $metrics, $others = array())
public function performQuery(DateTime $startDate, DateTime $endDate, $metrics, $others = array())
{
return $this->client->performQuery($this->siteId, $startDate->format('Y-m-d'), $endDate->format('Y-m-d'), $metrics, $others);
}
Expand Down

0 comments on commit dd9cc61

Please sign in to comment.