Skip to content

Commit 491a646

Browse files
committed
Add config docblocks
1 parent bc95e7e commit 491a646

File tree

2 files changed

+66
-22
lines changed

2 files changed

+66
-22
lines changed

examples/Visits.php

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace Config;
1+
<?php
2+
3+
namespace Config;
24

35
/***
46
*
@@ -13,21 +15,42 @@
1315
*
1416
***/
1517

16-
use CodeIgniter\Config\BaseConfig;
18+
use Tatter\Visits\Config\Visits as BaseConfig;
1719

18-
class Visits extends \Tatter\Visits\Config\Visits
20+
class Visits extends BaseConfig
1921
{
20-
// metric for tracking a unique visitor, one of: ip_address, session_id, user_id
21-
// NOTE: using user_id will count empty $userSource values as unique visits
22-
public $trackingMethod = "ip_address";
23-
24-
// the session variable to check for a logged-in user ID
25-
public $userSource = 'logged_in';
26-
27-
// how many minutes before a visit counts as new instead of incrementing a previous view count
28-
// set to zero to record each visit as its own page view (not recommended)
29-
public $resetMinutes = 60;
30-
31-
// Whether to ignore AJAX requests when recording
32-
public $ignoreAjax = true;
22+
/**
23+
* Metric for tracking a unique visitor
24+
*
25+
* @var 'ip_address'|'session_id'|'user_id'
26+
*/
27+
public $trackingMethod = 'ip_address';
28+
29+
/**
30+
* Session variable to check for a logged-in user ID
31+
*
32+
* @deprecated Next version will rely on codeigniter4/authentication-implementation
33+
*
34+
* @var string
35+
*/
36+
public $userSource = 'logged_in';
37+
38+
/**
39+
* Number of minutes before a visit counts as new
40+
* instead of incrementing a previous view count.
41+
* Set to zero to record each page view as unique (not recommended).
42+
*
43+
* @var int
44+
*/
45+
public $resetMinutes = 60;
46+
47+
/**
48+
* Whether to ignore AJAX requests when recording.
49+
* See framework User Guide for caveats.
50+
*
51+
* @see https://www.codeigniter.com/user_guide/general/ajax.html
52+
*
53+
* @var bool
54+
*/
55+
public $ignoreAjax = true;
3356
}

src/Config/Visits.php

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,38 @@
66

77
class Visits extends BaseConfig
88
{
9-
// metric for tracking a unique visitor
10-
// one of: ip_address, session_id, user_id
9+
/**
10+
* Metric for tracking a unique visitor
11+
*
12+
* @var 'ip_address'|'session_id'|'user_id'
13+
*/
1114
public $trackingMethod = 'ip_address';
1215

13-
// the session variable to check for a logged-in user ID
16+
/**
17+
* Session variable to check for a logged-in user ID
18+
*
19+
* @deprecated Next version will rely on codeigniter4/authentication-implementation
20+
*
21+
* @var string
22+
*/
1423
public $userSource = 'logged_in';
1524

16-
// how many minutes before a visit counts as new instead of incrementing a previous view count
17-
// set to zero to record each page view as unique (not recommended)
25+
/**
26+
* Number of minutes before a visit counts as new
27+
* instead of incrementing a previous view count.
28+
* Set to zero to record each page view as unique (not recommended).
29+
*
30+
* @var int
31+
*/
1832
public $resetMinutes = 60;
1933

20-
// Whether to ignore AJAX requests when recording
34+
/**
35+
* Whether to ignore AJAX requests when recording.
36+
* See framework User Guide for caveats.
37+
*
38+
* @see https://www.codeigniter.com/user_guide/general/ajax.html
39+
*
40+
* @var bool
41+
*/
2142
public $ignoreAjax = true;
2243
}

0 commit comments

Comments
 (0)