| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function __construct($subject, $tag) |
||
| 24 | { |
||
| 25 | $this->modelName = strtolower(str_plural(class_basename(is_string($subject) ? $subject : get_class($subject)))); |
||
| 26 | $this->prefix = config('visits.redis_keys_prefix'); |
||
| 27 | $this->testing = app()->environment('testing') ? 'testing:' : ''; |
||
| 28 | $this->primary = (new $subject)->getKeyName(); |
||
| 29 | $this->tag = $tag; |
||
| 30 | $this->visits = $this->visits($subject); |
||
| 31 | |||
| 32 | if ($subject instanceof Model) { |
||
| 33 | $this->instanceOfModel = true; |
||
| 34 | $this->modelName = strtolower(str_singular(class_basename(get_class($subject)))); |
||
| 35 | $this->id = $subject->{$subject->getKeyName()}; |
||
| 36 | } |
||
| 85 |