Skip to content

Commit a58b25e

Browse files
committed
Fix deprecation warnings in PHP 8.4 caused by implicitly nullable parameters
1 parent 18c11cc commit a58b25e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

library/PhpLatex/Node.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ class PhpLatex_Node
1515
* @param mixed $type
1616
* @param array $props
1717
*/
18-
public function __construct($type, array $props = null)
18+
public function __construct($type, array $props = array())
1919
{
2020
$this->_type = $type;
2121

2222
// _props and _children properties are lazily-initialized
2323
// on first write
2424

25-
if (null !== $props) {
25+
if ($props) {
2626
$this->setProps($props);
2727
}
2828
}
@@ -98,7 +98,7 @@ public function setProps(array $props)
9898
*/
9999
public function getProps()
100100
{
101-
return (array) $this->_props;
101+
return $this->_props;
102102
}
103103

104104
/**

library/PhpLatex/PdfLatex.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ public function getBuildDir()
126126
return $this->_buildDir;
127127
}
128128

129-
public function compile($file, array $files = null)
129+
public function compile($file, array $files = array())
130130
{
131131
$this->_log = null;
132132

133133
$cwd = getcwd();
134134
$dir = dirname($file);
135135

136-
foreach ((array) $files as $path) {
136+
foreach ($files as $path) {
137137
// TODO handle Windows
138138
if (!is_file($dir . '/' . basename($path))) {
139139
if (!@symlink($path, $dir . '/' . basename($path))) {
@@ -183,7 +183,7 @@ public function compile($file, array $files = null)
183183
* @return string Path to compiled PDF document
184184
* @throws Exception
185185
*/
186-
public function compileString($script, array $files = null)
186+
public function compileString($script, array $files = array())
187187
{
188188
$buildDir = $this->getBuildDir() . 'pdflatex/' . md5($script);
189189
$output = $buildDir . '/output.pdf';

library/PhpLatex/Renderer/Html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ protected function _renderStyled(PhpLatex_Node $node)
622622
return (string) $render;
623623
}
624624

625-
protected function _wrapStyle($render, array $diff = null)
625+
protected function _wrapStyle($render, array $diff = array())
626626
{
627627
$tags = array();
628628
$style = array();

0 commit comments

Comments
 (0)