Overview

Namespaces

  • None
  • Peridot
    • Leo
      • Formatter
      • Interfaces
        • Assert
      • Matcher
        • Template
      • ObjectPath
      • Responder
  • PHP

Classes

  • Assertion
  • Leo

Traits

  • DynamicObjectTrait
  • Overview
  • Namespace
  • Class
  • Tree

Trait DynamicObjectTrait

DynamicObjectTrait adds methods for dynamically defining methods, flags, and properties.

Direct Known Users

Peridot\Leo\Assertion
Namespace: Peridot\Leo
Package: Peridot\Leo
Located at DynamicObjectTrait.php
Methods summary
public mixed
# addMethod( string $name, callable $method )

Add a method identified by the given name.

Add a method identified by the given name.

Parameters

$name
$method
the body of the method

Returns

mixed
$this
public mixed
# addProperty( string $name, callable $factory, boolean $memoize = false )

Adds a lazy property identified by the given name. The property is lazy because it is not evaluated until asked for via __get().

Adds a lazy property identified by the given name. The property is lazy because it is not evaluated until asked for via __get().

Parameters

$name
$factory
$memoize

Returns

mixed
$this
public mixed
# flag( )

A simple mechanism for storing arbitrary flags. Flags are useful for tweaking behavior based on their presence.

A simple mechanism for storing arbitrary flags. Flags are useful for tweaking behavior based on their presence.

Returns

mixed
$this|mixed
public mixed
# clearFlags( )

Reset flags. Flags are generally cleared after an Assertion is made.

Reset flags. Flags are generally cleared after an Assertion is made.

Returns

mixed
$this
Properties summary
protected array $methods
# []
protected array $properties
# []
protected array $flags
# []
Leo API documentation generated by ApiGen