Skip to content

Commit bec2ba6

Browse files
committed
docs: fix duplicate object description of increment
Check User Guide syntax: user_guide_src/source/libraries/caching.rst#L182 duplicate object description of increment, other instance in /github/workspace/user_guide_src/source/database/query_builder.rst
1 parent 9204889 commit bec2ba6

File tree

2 files changed

+106
-104
lines changed

2 files changed

+106
-104
lines changed

user_guide_src/source/database/query_builder.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ run the query:
10461046
Class Reference
10471047
***************
10481048

1049-
.. php:class:: CodeIgniter\\Database\\BaseBuilder
1049+
.. php:class:: BaseBuilder
10501050
10511051
.. php:method:: db()
10521052

user_guide_src/source/libraries/caching.rst

Lines changed: 105 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -99,168 +99,170 @@ Shows file cache information in the current system::
9999
Class Reference
100100
***************
101101

102-
.. php:method:: isSupported()
102+
.. php:class:: CacheInterface
103103
104-
:returns: ``true`` if supported, ``false`` if not
105-
:rtype: bool
104+
.. php:method:: isSupported()
106105
107-
.. php:method:: get($key): mixed
106+
:returns: ``true`` if supported, ``false`` if not
107+
:rtype: bool
108108

109-
:param string $key: Cache item name
110-
:returns: Item value or ``null`` if not found
111-
:rtype: mixed
109+
.. php:method:: get($key): mixed
112110
113-
This method will attempt to fetch an item from the cache store. If the
114-
item does not exist, the method will return null.
111+
:param string $key: Cache item name
112+
:returns: Item value or ``null`` if not found
113+
:rtype: mixed
115114

116-
Example:
115+
This method will attempt to fetch an item from the cache store. If the
116+
item does not exist, the method will return null.
117117

118-
.. literalinclude:: caching/003.php
118+
Example:
119119

120-
.. php:method:: remember(string $key, int $ttl, Closure $callback)
120+
.. literalinclude:: caching/003.php
121121

122-
:param string $key: Cache item name
123-
:param int $ttl: Time to live in seconds
124-
:param Closure $callback: Callback to invoke when the cache item returns null
125-
:returns: The value of the cache item
126-
:rtype: mixed
122+
.. php:method:: remember(string $key, int $ttl, Closure $callback)
127123
128-
Gets an item from the cache. If ``null`` was returned, this will invoke the callback
129-
and save the result. Either way, this will return the value.
124+
:param string $key: Cache item name
125+
:param int $ttl: Time to live in seconds
126+
:param Closure $callback: Callback to invoke when the cache item returns null
127+
:returns: The value of the cache item
128+
:rtype: mixed
130129

131-
.. php:method:: save(string $key, $data[, int $ttl = 60[, $raw = false]])
130+
Gets an item from the cache. If ``null`` was returned, this will invoke the callback
131+
and save the result. Either way, this will return the value.
132132

133-
:param string $key: Cache item name
134-
:param mixed $data: the data to save
135-
:param int $ttl: Time To Live, in seconds (default 60)
136-
:param bool $raw: Whether to store the raw value
137-
:returns: ``true`` on success, ``false`` on failure
138-
:rtype: bool
133+
.. php:method:: save(string $key, $data[, int $ttl = 60[, $raw = false]])
139134
140-
This method will save an item to the cache store. If saving fails, the
141-
method will return ``false``.
135+
:param string $key: Cache item name
136+
:param mixed $data: the data to save
137+
:param int $ttl: Time To Live, in seconds (default 60)
138+
:param bool $raw: Whether to store the raw value
139+
:returns: ``true`` on success, ``false`` on failure
140+
:rtype: bool
142141

143-
Example:
142+
This method will save an item to the cache store. If saving fails, the
143+
method will return ``false``.
144144

145-
.. literalinclude:: caching/004.php
145+
Example:
146146

147-
.. note:: The ``$raw`` parameter is only utilized by Memcache,
148-
in order to allow usage of ``increment()`` and ``decrement()``.
147+
.. literalinclude:: caching/004.php
149148

150-
.. php:method:: delete($key): bool
149+
.. note:: The ``$raw`` parameter is only utilized by Memcache,
150+
in order to allow usage of ``increment()`` and ``decrement()``.
151151

152-
:param string $key: name of cached item
153-
:returns: ``true`` on success, ``false`` on failure
154-
:rtype: bool
152+
.. php:method:: delete($key): bool
155153
156-
This method will delete a specific item from the cache store. If item
157-
deletion fails, the method will return false.
154+
:param string $key: name of cached item
155+
:returns: ``true`` on success, ``false`` on failure
156+
:rtype: bool
158157

159-
Example:
158+
This method will delete a specific item from the cache store. If item
159+
deletion fails, the method will return false.
160160

161-
.. literalinclude:: caching/005.php
161+
Example:
162162

163-
.. php:method:: deleteMatching($pattern): integer
163+
.. literalinclude:: caching/005.php
164164

165-
:param string $pattern: glob-style pattern to match cached items keys
166-
:returns: number of deleted items
167-
:rtype: integer
165+
.. php:method:: deleteMatching($pattern): integer
168166
169-
This method will delete multiple items from the cache store at once by
170-
matching their keys against a glob-style pattern. It will return the total number of deleted items.
167+
:param string $pattern: glob-style pattern to match cached items keys
168+
:returns: number of deleted items
169+
:rtype: integer
171170

172-
.. important:: This method is only implemented for File, Redis and Predis handlers.
173-
Due to limitations, it couldn't be implemented for Memcached and Wincache handlers.
171+
This method will delete multiple items from the cache store at once by
172+
matching their keys against a glob-style pattern. It will return the total number of deleted items.
174173

175-
Example:
174+
.. important:: This method is only implemented for File, Redis and Predis handlers.
175+
Due to limitations, it couldn't be implemented for Memcached and Wincache handlers.
176176

177-
.. literalinclude:: caching/006.php
177+
Example:
178178

179-
For more information on glob-style syntax, please see
180-
`Glob (programming) <https://en.wikipedia.org/wiki/Glob_(programming)#Syntax>`_.
179+
.. literalinclude:: caching/006.php
181180

182-
.. php:method:: increment($key[, $offset = 1]): mixed
181+
For more information on glob-style syntax, please see
182+
`Glob (programming) <https://en.wikipedia.org/wiki/Glob_(programming)#Syntax>`_.
183183

184-
:param string $key: Cache ID
185-
:param int $offset: Step/value to add
186-
:returns: New value on success, ``false`` on failure
187-
:rtype: mixed
184+
.. php:method:: increment($key[, $offset = 1]): mixed
188185
189-
Performs atomic incrementation of a raw stored value.
186+
:param string $key: Cache ID
187+
:param int $offset: Step/value to add
188+
:returns: New value on success, ``false`` on failure
189+
:rtype: mixed
190190

191-
Example:
191+
Performs atomic incrementation of a raw stored value.
192192

193-
.. literalinclude:: caching/007.php
193+
Example:
194194

195-
.. php:method:: decrement($key[, $offset = 1]): mixed
195+
.. literalinclude:: caching/007.php
196196

197-
:param string $key: Cache ID
198-
:param int $offset: Step/value to reduce by
199-
:returns: New value on success, ``false`` on failure
200-
:rtype: mixed
197+
.. php:method:: decrement($key[, $offset = 1]): mixed
201198
202-
Performs atomic decrementation of a raw stored value.
199+
:param string $key: Cache ID
200+
:param int $offset: Step/value to reduce by
201+
:returns: New value on success, ``false`` on failure
202+
:rtype: mixed
203203

204-
Example:
204+
Performs atomic decrementation of a raw stored value.
205205

206-
.. literalinclude:: caching/008.php
206+
Example:
207207

208-
.. php:method:: clean()
208+
.. literalinclude:: caching/008.php
209209

210-
:returns: ``true`` on success, ``false`` on failure
211-
:rtype: bool
210+
.. php:method:: clean()
212211
213-
This method will 'clean' the entire cache. If the deletion of the
214-
cache files fails, the method will return false.
212+
:returns: ``true`` on success, ``false`` on failure
213+
:rtype: bool
215214

216-
Example:
215+
This method will 'clean' the entire cache. If the deletion of the
216+
cache files fails, the method will return false.
217217

218-
.. literalinclude:: caching/009.php
218+
Example:
219219

220-
.. php:method:: getCacheInfo()
220+
.. literalinclude:: caching/009.php
221221

222-
:returns: Information on the entire cache database
223-
:rtype: mixed
222+
.. php:method:: getCacheInfo()
224223
225-
This method will return information on the entire cache.
224+
:returns: Information on the entire cache database
225+
:rtype: mixed
226226

227-
Example:
227+
This method will return information on the entire cache.
228228

229-
.. literalinclude:: caching/010.php
229+
Example:
230230

231-
.. note:: The information returned and the structure of the data is dependent
232-
on which adapter is being used.
231+
.. literalinclude:: caching/010.php
233232

234-
.. php:method:: getMetadata(string $key)
233+
.. note:: The information returned and the structure of the data is dependent
234+
on which adapter is being used.
235235

236-
:param string $key: Cache item name
237-
:returns: Metadata for the cached item. ``null`` for missing items, or an array with at least the "expire" key for absolute epoch expiry (``null`` for never expires).
238-
:rtype: array|null
236+
.. php:method:: getMetadata(string $key)
239237
240-
This method will return detailed information on a specific item in the
241-
cache.
238+
:param string $key: Cache item name
239+
:returns: Metadata for the cached item. ``null`` for missing items, or an array with at least the "expire" key for absolute epoch expiry (``null`` for never expires).
240+
:rtype: array|null
242241

243-
Example:
242+
This method will return detailed information on a specific item in the
243+
cache.
244244

245-
.. literalinclude:: caching/011.php
245+
Example:
246246

247-
.. note:: The information returned and the structure of the data is dependent
248-
on which adapter is being used. Some adapters (File, Memcached, Wincache)
249-
still return ``false`` for missing items.
247+
.. literalinclude:: caching/011.php
250248

251-
.. php:staticmethod:: validateKey(string $key, string $prefix)
249+
.. note:: The information returned and the structure of the data is dependent
250+
on which adapter is being used. Some adapters (File, Memcached, Wincache)
251+
still return ``false`` for missing items.
252252

253-
:param string $key: Potential cache key
254-
:param string $prefix: Optional prefix
255-
:returns: The verified and prefixed key. If the key exceeds the driver's max key length it will be hashed.
256-
:rtype: string
253+
.. php:staticmethod:: validateKey(string $key, string $prefix)
257254
258-
This method is used by handler methods to check that keys are valid. It will throw
259-
an ``InvalidArgumentException`` for non-strings, invalid characters, and empty lengths.
255+
:param string $key: Potential cache key
256+
:param string $prefix: Optional prefix
257+
:returns: The verified and prefixed key. If the key exceeds the driver's max key length it will be hashed.
258+
:rtype: string
260259

261-
Example:
260+
This method is used by handler methods to check that keys are valid. It will throw
261+
an ``InvalidArgumentException`` for non-strings, invalid characters, and empty lengths.
262262

263-
.. literalinclude:: caching/012.php
263+
Example:
264+
265+
.. literalinclude:: caching/012.php
264266

265267
*******
266268
Drivers

0 commit comments

Comments
 (0)