Upgrade to 3.3.0
This commit is contained in:
@@ -50,7 +50,7 @@ class Data
|
||||
/**
|
||||
* Handler getter
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $type
|
||||
* @return \Kirby\Data\Handler
|
||||
*/
|
||||
public static function handler(string $type)
|
||||
@@ -73,8 +73,8 @@ class Data
|
||||
/**
|
||||
* Decodes data with the specified handler
|
||||
*
|
||||
* @param string $data
|
||||
* @param string $type
|
||||
* @param string $data
|
||||
* @param string $type
|
||||
* @return array
|
||||
*/
|
||||
public static function decode(string $data = null, string $type): array
|
||||
@@ -85,8 +85,8 @@ class Data
|
||||
/**
|
||||
* Encodes data with the specified handler
|
||||
*
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @return string
|
||||
*/
|
||||
public static function encode(array $data = null, string $type): string
|
||||
@@ -99,8 +99,8 @@ class Data
|
||||
* the data handler is automatically chosen by
|
||||
* the extension if not specified
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $type
|
||||
* @param string $file
|
||||
* @param string $type
|
||||
* @return array
|
||||
*/
|
||||
public static function read(string $file, string $type = null): array
|
||||
@@ -113,10 +113,10 @@ class Data
|
||||
* the data handler is automatically chosen by
|
||||
* the extension if not specified
|
||||
*
|
||||
* @param string $file
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @return boolean
|
||||
* @param string $file
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @return bool
|
||||
*/
|
||||
public static function write(string $file = null, array $data = [], string $type = null): bool
|
||||
{
|
||||
|
@@ -23,7 +23,7 @@ abstract class Handler
|
||||
*
|
||||
* Needs to throw an Exception if the file can't be parsed.
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $string
|
||||
* @return array
|
||||
*/
|
||||
abstract public static function decode($string): array;
|
||||
@@ -31,7 +31,7 @@ abstract class Handler
|
||||
/**
|
||||
* Converts an array to an encoded string
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param mixed $data
|
||||
* @return string
|
||||
*/
|
||||
abstract public static function encode($data): string;
|
||||
@@ -39,7 +39,7 @@ abstract class Handler
|
||||
/**
|
||||
* Reads data from a file
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $file
|
||||
* @return array
|
||||
*/
|
||||
public static function read(string $file): array
|
||||
@@ -54,9 +54,9 @@ abstract class Handler
|
||||
/**
|
||||
* Writes data to a file
|
||||
*
|
||||
* @param string $file
|
||||
* @param array $data
|
||||
* @return boolean
|
||||
* @param string $file
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
public static function write(string $file = null, array $data = []): bool
|
||||
{
|
||||
|
@@ -18,7 +18,7 @@ class Json extends Handler
|
||||
/**
|
||||
* Converts an array to an encoded JSON string
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param mixed $data
|
||||
* @return string
|
||||
*/
|
||||
public static function encode($data): string
|
||||
|
@@ -19,8 +19,8 @@ class PHP extends Handler
|
||||
/**
|
||||
* Converts an array to PHP file content
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param string $indent For internal use only
|
||||
* @param mixed $data
|
||||
* @param string $indent For internal use only
|
||||
* @return string
|
||||
*/
|
||||
public static function encode($data, $indent = ''): string
|
||||
@@ -48,7 +48,7 @@ class PHP extends Handler
|
||||
/**
|
||||
* PHP arrays don't have to be decoded
|
||||
*
|
||||
* @param array $array
|
||||
* @param array $array
|
||||
* @return array
|
||||
*/
|
||||
public static function decode($array): array
|
||||
@@ -59,7 +59,7 @@ class PHP extends Handler
|
||||
/**
|
||||
* Reads data from a file
|
||||
*
|
||||
* @param string $file
|
||||
* @param string $file
|
||||
* @return array
|
||||
*/
|
||||
public static function read(string $file): array
|
||||
@@ -74,9 +74,9 @@ class PHP extends Handler
|
||||
/**
|
||||
* Creates a PHP file with the given data
|
||||
*
|
||||
* @param string $file
|
||||
* @param array $data
|
||||
* @return boolean
|
||||
* @param string $file
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
public static function write(string $file = null, array $data = []): bool
|
||||
{
|
||||
|
@@ -18,7 +18,7 @@ class Txt extends Handler
|
||||
/**
|
||||
* Converts an array to an encoded Kirby txt string
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param mixed $data
|
||||
* @return string
|
||||
*/
|
||||
public static function encode($data): string
|
||||
@@ -41,7 +41,7 @@ class Txt extends Handler
|
||||
/**
|
||||
* Helper for converting the value
|
||||
*
|
||||
* @param array|string $value
|
||||
* @param array|string $value
|
||||
* @return string
|
||||
*/
|
||||
protected static function encodeValue($value): string
|
||||
@@ -63,8 +63,8 @@ class Txt extends Handler
|
||||
/**
|
||||
* Helper for converting the key and value to the result string
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
* @param string $key
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
protected static function encodeResult(string $key, string $value): string
|
||||
@@ -86,7 +86,7 @@ class Txt extends Handler
|
||||
/**
|
||||
* Parses a Kirby txt string and returns a multi-dimensional array
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $string
|
||||
* @return array
|
||||
*/
|
||||
public static function decode($string): array
|
||||
|
@@ -19,7 +19,7 @@ class Yaml extends Handler
|
||||
/**
|
||||
* Converts an array to an encoded YAML string
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param mixed $data
|
||||
* @return string
|
||||
*/
|
||||
public static function encode($data): string
|
||||
@@ -42,7 +42,7 @@ class Yaml extends Handler
|
||||
/**
|
||||
* Parses an encoded YAML string and returns a multi-dimensional array
|
||||
*
|
||||
* @param string $yaml
|
||||
* @param string $yaml
|
||||
* @return array
|
||||
*/
|
||||
public static function decode($yaml): array
|
||||
|
Reference in New Issue
Block a user