1 | <?php |
||
13 | abstract class Carbon_Breadcrumb_Locator extends Carbon_Breadcrumb_Factory { |
||
14 | |||
15 | /** |
||
16 | * Breadcrumb item locator type. |
||
17 | * |
||
18 | * @access protected |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $type = ''; |
||
22 | |||
23 | /** |
||
24 | * Breadcrumb item locator subtype. |
||
25 | * |
||
26 | * @access protected |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $subtype = ''; |
||
30 | |||
31 | /** |
||
32 | * Build a new breadcrumb item locator of the selected type. |
||
33 | * |
||
34 | * @static |
||
35 | * @access public |
||
36 | * |
||
37 | * @param string $type Type of the breadcrumb item locator. |
||
38 | * @param string $subtype Subtype of the breadcrumb item locator. |
||
39 | * @return Carbon_Breadcrumb_Locator $locator The new breadcrumb item locator. |
||
40 | */ |
||
41 | public static function factory( $type, $subtype = '' ) { |
||
47 | |||
48 | /** |
||
49 | * Constructor. |
||
50 | * |
||
51 | * Creates and configures a new breadcrumb item locator with the provided settings. |
||
52 | * |
||
53 | * @access public |
||
54 | * |
||
55 | * @param string $type Type of the breadcrumb item locator. |
||
56 | * @param string $subtype Subtype of the breadcrumb item locator. |
||
57 | */ |
||
58 | public function __construct( $type, $subtype ) { |
||
62 | |||
63 | /** |
||
64 | * Generate a set of breadcrumb items that found by the current type and the provided subtypes. |
||
65 | * |
||
66 | * @access public |
||
67 | * |
||
68 | * @param array $subtypes The subtypes to generate items for. |
||
69 | * @return array $items The items, generated by this locator. |
||
70 | */ |
||
71 | public function generate_items_for_subtypes( $subtypes ) { |
||
84 | |||
85 | /** |
||
86 | * Retrieve the type of this locator. |
||
87 | * |
||
88 | * @access public |
||
89 | * |
||
90 | * @return string $type The type of this locator. |
||
91 | */ |
||
92 | public function get_type() { |
||
95 | |||
96 | /** |
||
97 | * Modify the type of this locator. |
||
98 | * |
||
99 | * @access public |
||
100 | * |
||
101 | * @param string $type The new locator type. |
||
102 | */ |
||
103 | public function set_type( $type ) { |
||
106 | |||
107 | /** |
||
108 | * Retrieve the subtype of this locator. |
||
109 | * |
||
110 | * @access public |
||
111 | * |
||
112 | * @return string $subtype The subtype of this locator. |
||
113 | */ |
||
114 | public function get_subtype() { |
||
117 | |||
118 | /** |
||
119 | * Modify the subtype of this locator. |
||
120 | * |
||
121 | * @access public |
||
122 | * |
||
123 | * @param string $subtype The new locator subtype. |
||
124 | */ |
||
125 | public function set_subtype( $subtype ) { |
||
128 | |||
129 | /** |
||
130 | * Whether this the items of this locator should be included in the trail. |
||
131 | * |
||
132 | * @abstract |
||
133 | * @access public |
||
134 | */ |
||
135 | abstract public function is_included(); |
||
136 | |||
137 | /** |
||
138 | * Get the breadcrumb items, found by this locator. |
||
139 | * |
||
140 | * @abstract |
||
141 | * @access public |
||
142 | * |
||
143 | * @param int $priority The priority of the located items. |
||
144 | * @param int $id The ID of the item to get items for. Optional. |
||
145 | */ |
||
146 | abstract public function get_items( $priority = 1000, $id = 0 ); |
||
147 | |||
148 | /** |
||
149 | * Generate a set of breadcrumb items that found by this locator type and any subtype. |
||
150 | * |
||
151 | * @abstract |
||
152 | * @access public |
||
153 | */ |
||
154 | abstract public function generate_items(); |
||
155 | |||
156 | } |
||
157 |
This check looks for accesses to local static members using the fully qualified name instead of
self::
.While this is perfectly valid, the fully qualified name of
Certificate::TRIPLEDES_CBC
could just as well be replaced byself::TRIPLEDES_CBC
. Referencing local members withself::
assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.