| @@ -4,14 +4,14 @@ discard block | ||
| 4 | 4 | use Illuminate\Support\Carbon; | 
| 5 | 5 | use MongoDB\BSON\UTCDateTime; | 
| 6 | 6 | |
| 7 | -if (! function_exists('analytics')) { | |
| 7 | +if (!function_exists('analytics')) { | |
| 8 | 8 | function analytics(): APAnalytics | 
| 9 | 9 |      { | 
| 10 | 10 | return app(APAnalytics::class); | 
| 11 | 11 | } | 
| 12 | 12 | } | 
| 13 | 13 | |
| 14 | -if (! function_exists('trackEvent')) { | |
| 14 | +if (!function_exists('trackEvent')) { | |
| 15 | 15 | /** | 
| 16 | 16 | * Access event dispatch of event tracker direct. | 
| 17 | 17 | * @param mixed $event | 
| @@ -26,7 +26,7 @@ discard block | ||
| 26 | 26 | } | 
| 27 | 27 | } | 
| 28 | 28 | |
| 29 | -if (! function_exists('showEvents')) { | |
| 29 | +if (!function_exists('showEvents')) { | |
| 30 | 30 | /** | 
| 31 | 31 | * Access event dispatch of event tracker direct. | 
| 32 | 32 | * @param mixed $event | 
| @@ -43,14 +43,14 @@ discard block | ||
| 43 | 43 | } | 
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | -if (! function_exists('is_countable')) { | |
| 46 | +if (!function_exists('is_countable')) { | |
| 47 | 47 | function is_countable($c) | 
| 48 | 48 |      { | 
| 49 | 49 | return is_array($c) || $c instanceof Countable; | 
| 50 | 50 | } | 
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | -if (! function_exists('mongoTime')) { | |
| 53 | +if (!function_exists('mongoTime')) { | |
| 54 | 54 | /** | 
| 55 | 55 | * Returns time in MongoDb Time. | 
| 56 | 56 | * @param null|mixed $time | 
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | |
| 24 | 24 | //$this->app->register(APAnalyticsEventServiceProvider::class); | 
| 25 | 25 | |
| 26 | -        $this->app->singleton('apanalytics', function () { | |
| 26 | +        $this->app->singleton('apanalytics', function() { | |
| 27 | 27 | return new APAnalytics(); | 
| 28 | 28 | }); | 
| 29 | 29 | } | 
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | |
| 62 | 62 | $model = $this->namespace.studly_case(str_singular($collection)).'Analytic'; | 
| 63 | 63 | |
| 64 | -        if (! class_exists($model)) { | |
| 64 | +        if (!class_exists($model)) { | |
| 65 | 65 |              throw new InvalidArgumentException("Model {$model} does not exist."); | 
| 66 | 66 | } | 
| 67 | 67 | |
| @@ -104,7 +104,7 @@ discard block | ||
| 104 | 104 | $intervalFormat = '%Y-%m'; | 
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | - $aggregate[] = [ | |
| 107 | + $aggregate[] = [ | |
| 108 | 108 | '$group' => [ | 
| 109 | 109 | '_id' => [ | 
| 110 | 110 | '$dateToString' => ['date' => '$created_at', 'format' => $intervalFormat], | 
| @@ -129,7 +129,7 @@ discard block | ||
| 129 | 129 | ]; | 
| 130 | 130 | } | 
| 131 | 131 | |
| 132 | -        $data = $model::raw(function ($collection) use ($matchArray, $interval, $aggregate) { | |
| 132 | +        $data = $model::raw(function($collection) use ($matchArray, $interval, $aggregate) { | |
| 133 | 133 |              if ($interval == 'count') { | 
| 134 | 134 | return $collection->count($matchArray); | 
| 135 | 135 | } | 
| @@ -151,11 +151,11 @@ discard block | ||
| 151 | 151 | */ | 
| 152 | 152 | private function toModels($data, $model = null) | 
| 153 | 153 |      { | 
| 154 | -        if (! $model) { | |
| 154 | +        if (!$model) { | |
| 155 | 155 | $model = '\Jenssegers\Mongodb\Eloquent\Model'; | 
| 156 | 156 | } | 
| 157 | 157 | |
| 158 | -        if (! class_exists($model)) { | |
| 158 | +        if (!class_exists($model)) { | |
| 159 | 159 |              throw new InvalidArgumentException("Model {$model} does not exist."); | 
| 160 | 160 | } | 
| 161 | 161 | |