class JsonMessage

Class JsonMessage

Properties

int $code
string $msg
int|float $time
array|string $data

Methods

static 
make($data = null, $msg = 'success', $code = 0)

No description

__construct(null $data = null, string $msg = 'success', int $code = 0)

JsonMessage constructor.

bool
isSuccess()

No description

bool
isFailure()

No description

$this
code($code)

No description

$this
msg($msg)

No description

add(string $key, mixed $value)

No description

$this
data(array|string $data)

No description

array
all()

No description

array
toArray()

No description

string
__toString()

No description

bool
__isset(string $name)

No description

__set(string $name, $value)

No description

mixed
__get(string $name)

No description

Details

at line 48
static make($data = null, $msg = 'success', $code = 0)

Parameters

$data
$msg
$code

at line 59
__construct(null $data = null, string $msg = 'success', int $code = 0)

JsonMessage constructor.

Parameters

null $data
string $msg
int $code

at line 69
bool isSuccess()

Return Value

bool

at line 77
bool isFailure()

Return Value

bool

at line 86
$this code($code)

Parameters

$code

Return Value

$this

at line 97
$this msg($msg)

Parameters

$msg

Return Value

$this

at line 108
add(string $key, mixed $value)

Parameters

string $key
mixed $value

at line 121
$this data(array|string $data)

Parameters

array|string $data

Return Value

$this

at line 131
array all()

Return Value

array

at line 144
array toArray()

Return Value

array

at line 152
string __toString()

Return Value

string

at line 161
bool __isset(string $name)

Parameters

string $name

Return Value

bool

at line 170
__set(string $name, $value)

Parameters

string $name
$value

at line 180
mixed __get(string $name)

Parameters

string $name

Return Value

mixed

Exceptions

InvalidArgumentException