Documentation

ToJson
in package
implements MagicallyInvokedMethod

Interfaces, Classes, Traits and Enums

MagicallyInvokedMethod
MagicallyInvokedMethod is an interface for methods invoked with a little bit of magic

Table of Contents

invoke()  : mixed
Invokes a method from an instance with the given parameters
verifySignature()  : bool
Checks if the called method has the matching signature
resolv()  : mixed
Verify and parse object properties to json format

Methods

invoke()

Invokes a method from an instance with the given parameters

public invoke(object $instance, string $name[, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$instance : object

Object on which the method will be invoked

$name : string

Method name

$arguments : array<string|int, mixed> = []

Method arguments

Tags
access

public

Return values
mixed —

The return varies according to the invoked method

verifySignature()

Checks if the called method has the matching signature

public verifySignature(string $name[, array<string|int, mixed> $arguments = [] ]) : bool
Parameters
$name : string

Method name

$arguments : array<string|int, mixed> = []

Method arguments

Tags
access

public

Return values
bool —

The called method has the matching signature or not

resolv()

Verify and parse object properties to json format

private resolv(mixed $prop) : mixed
Parameters
$prop : mixed

Object property

Tags
access

private

throws
TypeError

When property is not serializable this error is throwable

Return values
mixed —

The value for use in json format

Search results