Skip to content

Commit a4612b8

Browse files
committed
More precise type hints
1 parent 85afde7 commit a4612b8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Domhtml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Domhtml implements Iterator
4444
/**
4545
* Iterator status.
4646
*
47-
* @var array
47+
* @var iterable|DOMDocument|null
4848
*/
4949
protected $_iterator = null;
5050

src/Util.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ public static function getPost($var, $default = null)
170170
* @param boolean $secure If deleting the file, should we securely delete
171171
* the file by overwriting it with random data?
172172
*
173-
* @return string Returns the full path-name to the temporary file.
173+
* @return string|false Returns the full path-name to the temporary file.
174174
* Returns false if a temp file could not be created.
175175
*/
176176
public static function getTempFile(
177177
$prefix = '',
178178
$delete = true,
179179
$dir = '',
180180
$secure = false
181-
)
181+
): string|false
182182
{
183183
$tempDir = (empty($dir) || !is_dir($dir))
184184
? sys_get_temp_dir()
@@ -211,16 +211,16 @@ public static function getTempFile(
211211
* @param boolean $secure If deleting file, should we securely delete
212212
* the file by overwriting it with random data?
213213
*
214-
* @return string Returns the full path-name to the temporary file.
215-
* Returns false if a temporary file could not be created.
214+
* @return string|false Returns the full path-name to the temporary file.
215+
* Returns false if a temporary file could not be created.
216216
*/
217217
public static function getTempFileWithExtension(
218218
$extension = '.tmp',
219219
$prefix = '',
220220
$delete = true,
221221
$dir = '',
222222
$secure = false
223-
)
223+
): string|false
224224
{
225225
$tempDir = (empty($dir) || !is_dir($dir))
226226
? sys_get_temp_dir()
@@ -275,10 +275,10 @@ public static function getTempFileWithExtension(
275275
* @param string $temp_dir Use this temporary directory as the directory
276276
* where the temporary directory will be created.
277277
*
278-
* @return string The pathname to the new temporary directory.
278+
* @return string|false The pathname to the new temporary directory.
279279
* Returns false if directory not created.
280280
*/
281-
public static function createTempDir($delete = true, $temp_dir = null)
281+
public static function createTempDir($delete = true, $temp_dir = null): string|false
282282
{
283283
if (is_null($temp_dir)) {
284284
$temp_dir = sys_get_temp_dir();

src/Variables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function getDefaultVariables($sanitize = false): Variables
7575
/**
7676
* Constructor.
7777
*
78-
* @param array $vars The list of form variables (if null, defaults
78+
* @param array|null $vars The list of form variables (if null, defaults
7979
* to PHP's $_REQUEST value). If '_formvars'
8080
* exists, it must be a JSON encoded array that
8181
* contains the list of allowed form variables.

0 commit comments

Comments
 (0)