Upgrade to 3.2.5

This commit is contained in:
Bastian Allgeier
2019-09-24 11:00:59 +02:00
parent ff9b5b1861
commit 447a9dd266
234 changed files with 1990 additions and 1224 deletions

View File

@@ -24,7 +24,6 @@ use Kirby\Toolkit\F;
*/
class Data
{
/**
* Handler Type Aliases
*
@@ -52,7 +51,7 @@ class Data
* Handler getter
*
* @param string $type
* @return Kirby\Data\Handler
* @return \Kirby\Data\Handler
*/
public static function handler(string $type)
{
@@ -65,7 +64,7 @@ class Data
null;
if (class_exists($handler)) {
return new $handler;
return new $handler();
}
throw new Exception('Missing handler for type: "' . $type . '"');

View File

@@ -18,7 +18,6 @@ use Kirby\Toolkit\F;
*/
abstract class Handler
{
/**
* Parses an encoded string and returns a multi-dimensional array
*
@@ -55,6 +54,7 @@ abstract class Handler
/**
* Writes data to a file
*
* @param string $file
* @param array $data
* @return boolean
*/

View File

@@ -15,7 +15,6 @@ use Exception;
*/
class Json extends Handler
{
/**
* Converts an array to an encoded JSON string
*
@@ -24,13 +23,13 @@ class Json extends Handler
*/
public static function encode($data): string
{
return json_encode($data);
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
/**
* Parses an encoded JSON string and returns a multi-dimensional array
*
* @param string $string
* @param string $json
* @return array
*/
public static function decode($json): array

View File

@@ -16,7 +16,6 @@ use Kirby\Toolkit\F;
*/
class PHP extends Handler
{
/**
* Converts an array to PHP file content
*
@@ -35,7 +34,7 @@ class PHP extends Handler
$array[] = "$indent " . ($indexed ? '' : static::encode($key) . ' => ') . static::encode($value, "$indent ");
}
return "[\n" . implode(",\n", $array) . "\n" . $indent . "]";
return "[\n" . implode(",\n", $array) . "\n" . $indent . ']';
case 'boolean':
return $data ? 'true' : 'false';
case 'int':
@@ -75,6 +74,7 @@ class PHP extends Handler
/**
* Creates a PHP file with the given data
*
* @param string $file
* @param array $data
* @return boolean
*/

View File

@@ -15,7 +15,6 @@ use Kirby\Toolkit\Str;
*/
class Txt extends Handler
{
/**
* Converts an array to an encoded Kirby txt string
*

View File

@@ -16,7 +16,6 @@ use Spyc;
*/
class Yaml extends Handler
{
/**
* Converts an array to an encoded YAML string
*
@@ -43,7 +42,7 @@ class Yaml extends Handler
/**
* Parses an encoded YAML string and returns a multi-dimensional array
*
* @param string $string
* @param string $yaml
* @return array
*/
public static function decode($yaml): array