# Json

class Json implements IteratorAggregate, Countable

## Methods

static
getInstance()

No description

static Json
parse(string $jsonString, bool $error = false)

Register json string

static Json
stringify(mix $data)

Register data to prepare json_encode process

ArrayIterator
getIterator()

Implement IteratorAggregate interface

int
count()

Counting attributes data

array
toArray()

Convert attributes to array

void
setOption($option)

Set up json option

Json
withHeader()

JSON Output with header

mixed
getAttributes()

Get attributes

static string
getError()

Get JSON error

mixed
__get($key)

Get value from attributes based on magic property

void
__call($method, $params)

Call Json scope for optional json process as magic method

value
__toString()

Main output for encoding process

## Details

###
at line 79
`static getInstance()`

No description

###
at line 92
`static Json parse(string $jsonString, bool $error = false)`

Register json string

#### Parameters

string | $jsonString |
bool | $error |

#### Return Value

Json | | Array via ArrayIterator

###
at line 105
`static Json stringify(mix $data)`

Register data to prepare json_encode process

#### Parameters

mix | $data |

#### Return Value

Json |

###
at line 119
`ArrayIterator getIterator()`

Implement IteratorAggregate interface

Use for iterate attributes at foreach()

#### Return Value

ArrayIterator |

###
at line 130
`int count()`

Counting attributes data

#### Return Value

int |

###
at line 160
`array toArray()`

Convert attributes to array

#### Return Value

array |

###
at line 180
`void setOption($option)`

Set up json option

#### Parameters

| $option |

#### Return Value

void |

###
at line 190
`Json withHeader()`

JSON Output with header

#### Return Value

Json |

###
at line 201
`mixed getAttributes()`

Get attributes

#### Return Value

mixed |

###
at line 211
`static string getError()`

Get JSON error

#### Return Value

string |

###
at line 222
`mixed __get($key)`

Get value from attributes based on magic property

#### Parameters

| $key |

#### Return Value

mixed |

###
at line 235
`void __call($method, $params)`

Call Json scope for optional json process as magic method

#### Parameters

| $method |
| $params |

#### Return Value

void |

###
at line 247
`value __toString()`

Main output for encoding process

#### Return Value

value |