Upgrade to 3.2.0
This commit is contained in:
@@ -10,17 +10,18 @@ use Kirby\Toolkit\F;
|
||||
*
|
||||
* @package Kirby Data
|
||||
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||
* @link http://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license MIT
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier GmbH
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class PHP extends Handler
|
||||
{
|
||||
|
||||
/**
|
||||
* Converts an array to PHP file content
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param string $indent
|
||||
* @param string $indent For internal use only
|
||||
* @return string
|
||||
*/
|
||||
public static function encode($data, $indent = ''): string
|
||||
@@ -64,7 +65,7 @@ class PHP extends Handler
|
||||
*/
|
||||
public static function read(string $file): array
|
||||
{
|
||||
if (file_exists($file) !== true) {
|
||||
if (is_file($file) !== true) {
|
||||
throw new Exception('The file "' . $file . '" does not exist');
|
||||
}
|
||||
|
||||
@@ -74,7 +75,7 @@ class PHP extends Handler
|
||||
/**
|
||||
* Creates a PHP file with the given data
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return boolean
|
||||
*/
|
||||
public static function write(string $file = null, array $data = []): bool
|
||||
@@ -87,6 +88,6 @@ class PHP extends Handler
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false; // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user