Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Fix deprecating array [] format
Browse files Browse the repository at this point in the history
  • Loading branch information
emulienfou committed Mar 16, 2017
1 parent 4d9151c commit cefc716
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions lib/Dwoo/Template/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* @author David Sanchez <[email protected]>
* @copyright 2008-2013 Jordi Boggiano
* @copyright 2013-2017 David Sanchez
* @license http://dwoo.org/LICENSE Modified BSD License
* @license http://dwoo.org/LICENSE LGPLv3
* @version 1.4.0
* @date 2017-03-09
* @date 2017-03-16
* @link http://dwoo.org/
*/

Expand Down Expand Up @@ -42,7 +42,7 @@ class File extends Str
*
* @var array
*/
protected $includePath = [];
protected $includePath = array();

/**
* Resolved path cache when looking for a file in multiple include paths.
Expand All @@ -66,7 +66,7 @@ class File extends Str
* template from others, if null it defaults to the filename+bits of the path
* @param mixed $includePath a string for a single path to look into for the given file, or an array of paths
*/
public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = [])
public function __construct($file, $cacheTime = null, $cacheId = null, $compileId = null, $includePath = array())
{
parent::__construct($file, $cacheTime, $cacheId, $compileId);
$this->template = null;
Expand All @@ -84,7 +84,7 @@ public function __construct($file, $cacheTime = null, $cacheId = null, $compileI
public function setIncludePath($paths)
{
if (is_array($paths) === false) {
$paths = [$paths];
$paths = array($paths);
}

$this->includePath = $paths;
Expand Down Expand Up @@ -144,7 +144,7 @@ public function getResourceIdentifier()
{
if ($this->resolvedPath !== null) {
return $this->resolvedPath;
} elseif (array_filter($this->getIncludePath()) == []) {
} elseif (array_filter($this->getIncludePath()) == array()) {
return $this->file;
} else {
foreach ($this->getIncludePath() as $path) {
Expand Down Expand Up @@ -202,13 +202,13 @@ public static function templateFactory(Core $core, $resourceId, $cacheTime = nul
$compileId = null, ITemplate $parentTemplate = null)
{
if (DIRECTORY_SEPARATOR === '\\') {
$resourceId = str_replace(["\t", "\n", "\r", "\f", "\v"], [
$resourceId = str_replace(array("\t", "\n", "\r", "\f", "\v"), array(
'\\t',
'\\n',
'\\r',
'\\f',
'\\v'
], $resourceId);
), $resourceId);
}
$resourceId = strtr($resourceId, '\\', '/');

Expand Down
14 changes: 7 additions & 7 deletions lib/Dwoo/Template/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* @author David Sanchez <[email protected]>
* @copyright 2008-2013 Jordi Boggiano
* @copyright 2013-2017 David Sanchez
* @license http://dwoo.org/LICENSE Modified BSD License
* @license http://dwoo.org/LICENSE LGPLv3
* @version 1.4.0
* @date 2017-03-09
* @date 2017-03-16
* @link http://dwoo.org/
*/

Expand Down Expand Up @@ -77,10 +77,10 @@ class Str implements ITemplate
*
* @var array
*/
protected static $cache = [
'cached' => [],
'compiled' => []
];
protected static $cache = array(
'cached' => array(),
'compiled' => array()
);

/**
* Holds the compiler that built this template.
Expand Down Expand Up @@ -370,7 +370,7 @@ public function getCompiledTemplate(Core $core, ICompiler $compiler = null)
if ($compiler === null) {
$compiler = $core->getDefaultCompilerFactory($this->getResourceName());

if ($compiler === null || $compiler === ['Dwoo\Compiler', 'compilerFactory']) {
if ($compiler === null || $compiler === array('Dwoo\Compiler', 'compilerFactory')) {
$compiler = Compiler::compilerFactory();
} else {
$compiler = call_user_func($compiler);
Expand Down

0 comments on commit cefc716

Please sign in to comment.