Skip to content

Commit

Permalink
Arr 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed May 31, 2018
1 parent 1c5b997 commit d551e75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ public static function isAssoc(array $array) : bool
* @param array $array The source array
* @return string The JSON string
*/
public static function toJson(array $array) : string
public static function toJson(array $array, int $options = 0, int $depth = 512) : string
{
return json_encode($array);
return json_encode($array, $options, $depth);
}

/**
Expand All @@ -233,9 +233,9 @@ public static function toJson(array $array) : string
* @param string $json The JSON string
* @return array
*/
public static function createFromJson(string $json) : array
public static function createFromJson(string $json, bool $assoc = true, int $depth = 512 , int $options = 0) : array
{
return json_decode($json, true);
return json_decode($json, $assoc, $depth, $options);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.2.3, 2018-05-31
* method toJson() can take new parameters with predefined variables: int $options = 0, int $depth = 512
* method createFromJson() can take new parameters with predefined variables: bool $assoc = true, int $depth = 512 , int $options = 0

# v1.2.2, 2018-04-30
* New method reverse()
* New method size()
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Arr Component
![version](https://img.shields.io/badge/version-1.2.2-brightgreen.svg?style=flat-square "Version")
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flextype-components/arr/blob/master/LICENSE)
![version](https://img.shields.io/badge/version-1.2.3-brightgreen.svg?style=flat-square)
![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)

The Array Component contains methods that can be useful when working with arrays.

Expand Down

0 comments on commit d551e75

Please sign in to comment.