Skip to content

docs: fix Sphinx errors #6369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion user_guide_src/source/database/query_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,9 @@ run the query:
Class Reference
***************

.. php:class:: CodeIgniter\\Database\\BaseBuilder
.. php:namespace:: CodeIgniter\Database

.. php:class:: BaseBuilder

.. php:method:: db()

Expand Down
4 changes: 3 additions & 1 deletion user_guide_src/source/incoming/incomingrequest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ The methods provided by the parent classes that are available are:
* :meth:`CodeIgniter\\HTTP\\Message::getProtocolVersion`
* :meth:`CodeIgniter\\HTTP\\Message::setProtocolVersion`

.. php:class:: CodeIgniter\\HTTP\\IncomingRequest
.. php:namespace:: CodeIgniter\HTTP

.. php:class:: IncomingRequest

.. php:method:: isCLI()

Expand Down
210 changes: 107 additions & 103 deletions user_guide_src/source/libraries/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,168 +99,172 @@ Shows file cache information in the current system::
Class Reference
***************

.. php:method:: isSupported()
.. php:namespace:: CodeIgniter\Cache

:returns: ``true`` if supported, ``false`` if not
:rtype: bool
.. php:class:: CacheInterface

.. php:method:: get($key): mixed
.. php:method:: isSupported()

:param string $key: Cache item name
:returns: Item value or ``null`` if not found
:rtype: mixed
:returns: ``true`` if supported, ``false`` if not
:rtype: bool

This method will attempt to fetch an item from the cache store. If the
item does not exist, the method will return null.
.. php:method:: get($key): mixed

Example:
:param string $key: Cache item name
:returns: Item value or ``null`` if not found
:rtype: mixed

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

.. php:method:: remember(string $key, int $ttl, Closure $callback)
Example:

:param string $key: Cache item name
:param int $ttl: Time to live in seconds
:param Closure $callback: Callback to invoke when the cache item returns null
:returns: The value of the cache item
:rtype: mixed
.. literalinclude:: caching/003.php

Gets an item from the cache. If ``null`` was returned, this will invoke the callback
and save the result. Either way, this will return the value.
.. php:method:: remember(string $key, int $ttl, Closure $callback)

.. php:method:: save(string $key, $data[, int $ttl = 60[, $raw = false]])
:param string $key: Cache item name
:param int $ttl: Time to live in seconds
:param Closure $callback: Callback to invoke when the cache item returns null
:returns: The value of the cache item
:rtype: mixed

:param string $key: Cache item name
:param mixed $data: the data to save
:param int $ttl: Time To Live, in seconds (default 60)
:param bool $raw: Whether to store the raw value
:returns: ``true`` on success, ``false`` on failure
:rtype: bool
Gets an item from the cache. If ``null`` was returned, this will invoke the callback
and save the result. Either way, this will return the value.

This method will save an item to the cache store. If saving fails, the
method will return ``false``.
.. php:method:: save(string $key, $data[, int $ttl = 60[, $raw = false]])

Example:
:param string $key: Cache item name
:param mixed $data: the data to save
:param int $ttl: Time To Live, in seconds (default 60)
:param bool $raw: Whether to store the raw value
:returns: ``true`` on success, ``false`` on failure
:rtype: bool

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

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

.. php:method:: delete($key): bool
.. literalinclude:: caching/004.php

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

This method will delete a specific item from the cache store. If item
deletion fails, the method will return false.
.. php:method:: delete($key): bool

Example:
:param string $key: name of cached item
:returns: ``true`` on success, ``false`` on failure
:rtype: bool

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

.. php:method:: deleteMatching($pattern): integer
Example:

:param string $pattern: glob-style pattern to match cached items keys
:returns: number of deleted items
:rtype: integer
.. literalinclude:: caching/005.php

This method will delete multiple items from the cache store at once by
matching their keys against a glob-style pattern. It will return the total number of deleted items.
.. php:method:: deleteMatching($pattern): integer

.. important:: This method is only implemented for File, Redis and Predis handlers.
Due to limitations, it couldn't be implemented for Memcached and Wincache handlers.
:param string $pattern: glob-style pattern to match cached items keys
:returns: number of deleted items
:rtype: integer

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

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

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

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

:param string $key: Cache ID
:param int $offset: Step/value to add
:returns: New value on success, ``false`` on failure
:rtype: mixed
For more information on glob-style syntax, please see
`Glob (programming) <https://en.wikipedia.org/wiki/Glob_(programming)#Syntax>`_.

Performs atomic incrementation of a raw stored value.
.. php:method:: increment($key[, $offset = 1]): mixed

Example:
:param string $key: Cache ID
:param int $offset: Step/value to add
:returns: New value on success, ``false`` on failure
:rtype: mixed

.. literalinclude:: caching/007.php
Performs atomic incrementation of a raw stored value.

.. php:method:: decrement($key[, $offset = 1]): mixed
Example:

:param string $key: Cache ID
:param int $offset: Step/value to reduce by
:returns: New value on success, ``false`` on failure
:rtype: mixed
.. literalinclude:: caching/007.php

Performs atomic decrementation of a raw stored value.
.. php:method:: decrement($key[, $offset = 1]): mixed

Example:
:param string $key: Cache ID
:param int $offset: Step/value to reduce by
:returns: New value on success, ``false`` on failure
:rtype: mixed

.. literalinclude:: caching/008.php
Performs atomic decrementation of a raw stored value.

.. php:method:: clean()
Example:

:returns: ``true`` on success, ``false`` on failure
:rtype: bool
.. literalinclude:: caching/008.php

This method will 'clean' the entire cache. If the deletion of the
cache files fails, the method will return false.
.. php:method:: clean()

Example:
:returns: ``true`` on success, ``false`` on failure
:rtype: bool

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

.. php:method:: getCacheInfo()
Example:

:returns: Information on the entire cache database
:rtype: mixed
.. literalinclude:: caching/009.php

This method will return information on the entire cache.
.. php:method:: getCacheInfo()

Example:
:returns: Information on the entire cache database
:rtype: mixed

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

.. note:: The information returned and the structure of the data is dependent
on which adapter is being used.
Example:

.. php:method:: getMetadata(string $key)
.. literalinclude:: caching/010.php

:param string $key: Cache item name
: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).
:rtype: array|null
.. note:: The information returned and the structure of the data is dependent
on which adapter is being used.

This method will return detailed information on a specific item in the
cache.
.. php:method:: getMetadata(string $key)

Example:
:param string $key: Cache item name
: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).
:rtype: array|null

.. literalinclude:: caching/011.php
This method will return detailed information on a specific item in the
cache.

.. note:: The information returned and the structure of the data is dependent
on which adapter is being used. Some adapters (File, Memcached, Wincache)
still return ``false`` for missing items.
Example:

.. php:staticmethod:: validateKey(string $key, string $prefix)
.. literalinclude:: caching/011.php

:param string $key: Potential cache key
:param string $prefix: Optional prefix
:returns: The verified and prefixed key. If the key exceeds the driver's max key length it will be hashed.
:rtype: string
.. note:: The information returned and the structure of the data is dependent
on which adapter is being used. Some adapters (File, Memcached, Wincache)
still return ``false`` for missing items.

This method is used by handler methods to check that keys are valid. It will throw
an ``InvalidArgumentException`` for non-strings, invalid characters, and empty lengths.
.. php:staticmethod:: validateKey(string $key, string $prefix)

Example:
:param string $key: Potential cache key
:param string $prefix: Optional prefix
:returns: The verified and prefixed key. If the key exceeds the driver's max key length it will be hashed.
:rtype: string

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

Example:

.. literalinclude:: caching/012.php

*******
Drivers
Expand Down
4 changes: 3 additions & 1 deletion user_guide_src/source/libraries/cookies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ In runtime, you can manually supply a new default using the ``Cookie::setDefault
Class Reference
***************

.. php:class:: CodeIgniter\\HTTP\\Cookie\\Cookie
.. php:namespace:: CodeIgniter\HTTP\Cookie

.. php:class:: Cookie

.. php:staticmethod:: setDefaults([$config = []])

Expand Down
4 changes: 3 additions & 1 deletion user_guide_src/source/libraries/email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ Place the item you do not want word-wrapped between: {unwrap} {/unwrap}
Class Reference
***************

.. php:class:: CodeIgniter\\Email\\Email
.. php:namespace:: CodeIgniter\Email

.. php:class:: Email

.. php:method:: setFrom($from[, $name = ''[, $returnPath = null]])

Expand Down