Skip to content

Commit 6d3a24b

Browse files
authored
Merge pull request #6369 from kenjis/fix-docs-sphinx-errors
docs: fix Sphinx errors
2 parents 9204889 + 7c12af8 commit 6d3a24b

File tree

5 files changed

+119
-107
lines changed

5 files changed

+119
-107
lines changed

user_guide_src/source/database/query_builder.rst

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

1049-
.. php:class:: CodeIgniter\\Database\\BaseBuilder
1049+
.. php:namespace:: CodeIgniter\Database
1050+
1051+
.. php:class:: BaseBuilder
10501052
10511053
.. php:method:: db()
10521054

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ The methods provided by the parent classes that are available are:
250250
* :meth:`CodeIgniter\\HTTP\\Message::getProtocolVersion`
251251
* :meth:`CodeIgniter\\HTTP\\Message::setProtocolVersion`
252252

253-
.. php:class:: CodeIgniter\\HTTP\\IncomingRequest
253+
.. php:namespace:: CodeIgniter\HTTP
254+
255+
.. php:class:: IncomingRequest
254256
255257
.. php:method:: isCLI()
256258

user_guide_src/source/libraries/caching.rst

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

102-
.. php:method:: isSupported()
102+
.. php:namespace:: CodeIgniter\Cache
103103
104-
:returns: ``true`` if supported, ``false`` if not
105-
:rtype: bool
104+
.. php:class:: CacheInterface
106105
107-
.. php:method:: get($key): mixed
106+
.. php:method:: isSupported()
108107
109-
:param string $key: Cache item name
110-
:returns: Item value or ``null`` if not found
111-
:rtype: mixed
108+
:returns: ``true`` if supported, ``false`` if not
109+
:rtype: bool
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+
.. php:method:: get($key): mixed
115112
116-
Example:
113+
:param string $key: Cache item name
114+
:returns: Item value or ``null`` if not found
115+
:rtype: mixed
117116

118-
.. literalinclude:: caching/003.php
117+
This method will attempt to fetch an item from the cache store. If the
118+
item does not exist, the method will return null.
119119

120-
.. php:method:: remember(string $key, int $ttl, Closure $callback)
120+
Example:
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+
.. literalinclude:: caching/003.php
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+
.. php:method:: remember(string $key, int $ttl, Closure $callback)
130125
131-
.. php:method:: save(string $key, $data[, int $ttl = 60[, $raw = false]])
126+
:param string $key: Cache item name
127+
:param int $ttl: Time to live in seconds
128+
:param Closure $callback: Callback to invoke when the cache item returns null
129+
:returns: The value of the cache item
130+
:rtype: mixed
132131

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
132+
Gets an item from the cache. If ``null`` was returned, this will invoke the callback
133+
and save the result. Either way, this will return the value.
139134

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

145-
.. literalinclude:: caching/004.php
144+
This method will save an item to the cache store. If saving fails, the
145+
method will return ``false``.
146146

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

150-
.. php:method:: delete($key): bool
149+
.. literalinclude:: caching/004.php
151150

152-
:param string $key: name of cached item
153-
:returns: ``true`` on success, ``false`` on failure
154-
:rtype: bool
151+
.. note:: The ``$raw`` parameter is only utilized by Memcache,
152+
in order to allow usage of ``increment()`` and ``decrement()``.
155153

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

161-
.. literalinclude:: caching/005.php
160+
This method will delete a specific item from the cache store. If item
161+
deletion fails, the method will return false.
162162

163-
.. php:method:: deleteMatching($pattern): integer
163+
Example:
164164

165-
:param string $pattern: glob-style pattern to match cached items keys
166-
:returns: number of deleted items
167-
:rtype: integer
165+
.. literalinclude:: caching/005.php
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+
.. php:method:: deleteMatching($pattern): integer
171168
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.
169+
:param string $pattern: glob-style pattern to match cached items keys
170+
:returns: number of deleted items
171+
:rtype: integer
174172

175-
Example:
173+
This method will delete multiple items from the cache store at once by
174+
matching their keys against a glob-style pattern. It will return the total number of deleted items.
176175

177-
.. literalinclude:: caching/006.php
176+
.. important:: This method is only implemented for File, Redis and Predis handlers.
177+
Due to limitations, it couldn't be implemented for Memcached and Wincache handlers.
178178

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

182-
.. php:method:: increment($key[, $offset = 1]): mixed
181+
.. literalinclude:: caching/006.php
183182

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
183+
For more information on glob-style syntax, please see
184+
`Glob (programming) <https://en.wikipedia.org/wiki/Glob_(programming)#Syntax>`_.
188185

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

193-
.. literalinclude:: caching/007.php
193+
Performs atomic incrementation of a raw stored value.
194194

195-
.. php:method:: decrement($key[, $offset = 1]): mixed
195+
Example:
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+
.. literalinclude:: caching/007.php
201198

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

206-
.. literalinclude:: caching/008.php
206+
Performs atomic decrementation of a raw stored value.
207207

208-
.. php:method:: clean()
208+
Example:
209209

210-
:returns: ``true`` on success, ``false`` on failure
211-
:rtype: bool
210+
.. literalinclude:: caching/008.php
212211

213-
This method will 'clean' the entire cache. If the deletion of the
214-
cache files fails, the method will return false.
212+
.. php:method:: clean()
215213
216-
Example:
214+
:returns: ``true`` on success, ``false`` on failure
215+
:rtype: bool
217216

218-
.. literalinclude:: caching/009.php
217+
This method will 'clean' the entire cache. If the deletion of the
218+
cache files fails, the method will return false.
219219

220-
.. php:method:: getCacheInfo()
220+
Example:
221221

222-
:returns: Information on the entire cache database
223-
:rtype: mixed
222+
.. literalinclude:: caching/009.php
224223

225-
This method will return information on the entire cache.
224+
.. php:method:: getCacheInfo()
226225
227-
Example:
226+
:returns: Information on the entire cache database
227+
:rtype: mixed
228228

229-
.. literalinclude:: caching/010.php
229+
This method will return information on the entire cache.
230230

231-
.. note:: The information returned and the structure of the data is dependent
232-
on which adapter is being used.
231+
Example:
233232

234-
.. php:method:: getMetadata(string $key)
233+
.. literalinclude:: caching/010.php
235234

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
235+
.. note:: The information returned and the structure of the data is dependent
236+
on which adapter is being used.
239237

240-
This method will return detailed information on a specific item in the
241-
cache.
238+
.. php:method:: getMetadata(string $key)
242239
243-
Example:
240+
:param string $key: Cache item name
241+
: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).
242+
:rtype: array|null
244243

245-
.. literalinclude:: caching/011.php
244+
This method will return detailed information on a specific item in the
245+
cache.
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+
Example:
250248

251-
.. php:staticmethod:: validateKey(string $key, string $prefix)
249+
.. literalinclude:: caching/011.php
252250

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
251+
.. note:: The information returned and the structure of the data is dependent
252+
on which adapter is being used. Some adapters (File, Memcached, Wincache)
253+
still return ``false`` for missing items.
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+
.. php:staticmethod:: validateKey(string $key, string $prefix)
260256
261-
Example:
257+
:param string $key: Potential cache key
258+
:param string $prefix: Optional prefix
259+
:returns: The verified and prefixed key. If the key exceeds the driver's max key length it will be hashed.
260+
:rtype: string
262261

263-
.. literalinclude:: caching/012.php
262+
This method is used by handler methods to check that keys are valid. It will throw
263+
an ``InvalidArgumentException`` for non-strings, invalid characters, and empty lengths.
264+
265+
Example:
266+
267+
.. literalinclude:: caching/012.php
264268

265269
*******
266270
Drivers

user_guide_src/source/libraries/cookies.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ In runtime, you can manually supply a new default using the ``Cookie::setDefault
223223
Class Reference
224224
***************
225225

226-
.. php:class:: CodeIgniter\\HTTP\\Cookie\\Cookie
226+
.. php:namespace:: CodeIgniter\HTTP\Cookie
227+
228+
.. php:class:: Cookie
227229
228230
.. php:staticmethod:: setDefaults([$config = []])
229231

user_guide_src/source/libraries/email.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ Place the item you do not want word-wrapped between: {unwrap} {/unwrap}
158158
Class Reference
159159
***************
160160

161-
.. php:class:: CodeIgniter\\Email\\Email
161+
.. php:namespace:: CodeIgniter\Email
162+
163+
.. php:class:: Email
162164
163165
.. php:method:: setFrom($from[, $name = ''[, $returnPath = null]])
164166

0 commit comments

Comments
 (0)