Phpdomain

See also

The PHP Index pages

Two extra index pages are created for the PHP domain.

File php-modindex.html

This one is the "module index" and lists the namespaces.

File php-objectsindex.html

This index contains all known PHP objects.

When index files come into play, you can reference them by using the reference textrole and the apropriate target name:

reST source

rendering

:ref:`php-modindex`

PHP Namespace Index

:ref:`php-objectsindex`

PHP Objects Index

Quick Sample

This is source:

.. php:class:: DateTime

   Datetime class

   .. php:method:: setDate($year, $month, $day)

      Set the date.

      :param int $year: The year.
      :param int $month: The month.
      :param int $day: The day.
      :returns: Either false on failure, or the datetime object for method chaining.


   .. php:method:: setTime($hour, $minute[, $second])

      Set the time.

      :param int $hour: The hour
      :param int $minute: The minute
      :param int $second: The second
      :returns: Either false on failure, or the datetime object for method chaining.

   .. php:const:: ATOM

      Y-m-d\TH:i:sP
class DateTime

Datetime class

setDate($year, $month, $day)

Set the date.

Parameters
  • $year (int) -- The year.

  • $month (int) -- The month.

  • $day (int) -- The day.

Returns

Either false on failure, or the datetime object for method chaining.

setTime($hour, $minute[, $second])

Set the time.

Parameters
  • $hour (int) -- The hour

  • $minute (int) -- The minute

  • $second (int) -- The second

Returns

Either false on failure, or the datetime object for method chaining.

constant ATOM

Y-m-dTH:i:sP

Acceptance tests for PHPdomain

Credit: The source for this section was taken from the original GitHub repository markstory/sphinxcontrib-phpdomain.

Globals

$global_var

A global variable

constant DateTime::SOME_CONSTANT

A global constant

constant DateTime::VALUE

A global constant

in_array(needle, haystack)

Checks for needle in haystack.

Parameters
  • needle -- The element to search for.

  • haystack (array) -- The array to search.

Returns

Element exists in array.

Return type

boolean

Classes

class DateTime

Datetime class

setDate($year, $month, $day)

Set the date in the datetime object

Parameters
  • $year (int) -- The year.

  • $month (int) -- The month.

  • $day (int) -- The day.

setTime($hour, $minute[, $second])

Set the time

Parameters
  • $hour (int) -- The hour

  • $minute (int) -- The minute

  • $second (int) -- The second

public static getLastErrors()

Returns the warnings and errors

Returns

array Returns array containing info about warnings and errors.

constant ATOM

Y-m-dTH:i:sP

property testattr

Value of some attribute

class OtherClass

Another class

OtherClass::update($arg = '', $arg2 = [], $arg3 = [])

Update something.

property OtherClass::$nonIndentedAttribute

This attribute wasn't indented

constant OtherClass::NO_INDENT

This class constant wasn't indented

static OtherClass::staticMethod

A static method.

Exceptions

exception InvalidArgumentException

Throw when you get an argument that is bad.

Interfaces

interface DateTimeInterface

Datetime interface

setDate($year, $month, $day)

Set the date in the datetime object

Parameters
  • $year (int) -- The year.

  • $month (int) -- The month.

  • $day (int) -- The day.

setTime($hour, $minute[, $second])

Set the time

Parameters
  • $hour (int) -- The hour

  • $minute (int) -- The minute

  • $second (int) -- The second

constant ATOM

Y-m-dTH:i:sP

property testattr

Value of some attribute

interface OtherInterface

Another interface

Traits

trait LogTrait

A logging trait

log($level, $string)

A method description.

Namespaced elements

namespaced_function($one[, $two])

A function in a namespace

Parameters
  • $one (string) -- First parameter.

  • $two (string) -- Second parameter.

constant LibraryName\NS_CONST

A constant in a namespace

exception LibraryName\NamespaceException

This exception is in a namespace.

class LibraryName\LibraryClass

A class in a namespace

instanceMethod($foo)

An instance method

constant TEST_CONST

Test constant

property property

A property!

static LibraryName\LibraryClass::staticMethod

A static method in a namespace

class LibraryName\NamespaceClass

A class in the namespace, no indenting on children

LibraryName\NamespaceClass::firstMethod($one, $two)

A normal instance method.

property LibraryName\NamespaceClass::$property

A property

constant LibraryName\NamespaceClass::NAMESPACE_CONST

Const on class in namespace

static LibraryName\NamespaceClass::namespaceStatic($foo)

A static method here.

final class LibraryName\LibraryClassFinal

A final class

public LibraryName\LibraryClassFinal::firstMethod($one, $two)

A public instance method.

protected LibraryName\LibraryClassFinal::secondMethod($one, $two)

A protected instance method.

private LibraryName\LibraryClassFinal::thirdMethod($one, $two)

A private instance method.

static LibraryName\LibraryClassFinal::fourthMethod($one, $two)

A static method.

protected final LibraryName\LibraryClassFinal::fifthMethod($one, $two)

A protected final method.

abstract class LibraryName\LibraryClassAbstract

An abstract class

interface LibraryName\LibraryInterface

A interface in a namespace

instanceMethod($foo)

An instance method

trait LibraryName\TemplateTrait

A trait in a namespace

render($template)

Render a template.

Nested namespaces

exception LibraryName\SubPackage\NestedNamespaceException

In a package

class LibraryName\SubPackage\SubpackageClass

A class in a subpackage

interface LibraryName\SubPackage\SubpackageInterface

A class in a subpackage

Return Types

class OtherLibrary\ReturningClass

A class to do some returning.

returnClassFromSameNamespace()
Returns

An object instance of a class from the same namespace.

Return type

OtherLibrary\ReturnedClass

returnClassFromOtherNamespace()
Returns

An object instance of a class from another namespace.

Return type

LibraryName\SubPackage\SubpackageInterface

returnClassConstant()
Returns

The value of a specific class constant.

Return type

LibraryName\NamespaceClass::NAMESPACE_CONST

returnGlobalConstant()
Returns

The value of a specific global constant.

Return type

SOME_CONSTANT

returnExceptionInstance()
Returns

An instance of an exception.

Return type

InvalidArgumentException

returnScalarType()
Returns

A scalar string type.

Return type

string

returnUnionType()
Returns

Any of a whole bunch of things specified with a PHP 8 union type.

Return type

int|string|OtherLibrary\ReturnedClass|LibraryName\SubPackage\SubpackageInterface|null

class OtherLibrary\ReturnedClass

A class to return.

Top Level Namespace

Credit: The source for this section was taken from the original GitHub repository markstory/sphinxcontrib-phpdomain.

namespace Imagine\Draw

class Imagine\Draw\DrawerInterface

Instance of this interface is returned by ImagineImageImageInterface::draw.

Imagine\Draw\DrawerInterface::arc(PointInterface $center, BoxInterface $size, $start, $end, Color $color)

Draws an arc on a starting at a given x, y coordinates under a given start and end angles

Parameters
  • $center (ImagineImagePointInterface) -- Center of the arc.

  • $size (ImagineImageBoxInterface) -- Size of the bounding box.

  • $start (integer) -- Start angle.

  • $end (integer) -- End angle.

  • $color (ImagineImageColor) -- Line color.

Throws

ImagineExceptionRuntimeException

Returns

ImagineDrawDrawerInterface

Re-used namespace

No indexing errors or links should point to this namespace.

class LibraryName\ThirdClass

Another class in a currentmodule block

No indexing errors or links should point to this namespace.

class LibraryName\OtherClass

Another class in a reused namespace