Issues (994)

src/simplehtmldom/helper.php (2 issues)

1
<?php
2
3
namespace simplehtmldom;
4
5
if (!defined('DEFAULT_TARGET_CHARSET')) {
6
  define('DEFAULT_TARGET_CHARSET', 'UTF-8');
7
}
8
if (!defined('DEFAULT_BR_TEXT')) {
9
  define('DEFAULT_BR_TEXT', "\r\n");
10
}
11
if (!defined('DEFAULT_SPAN_TEXT')) {
12
  define('DEFAULT_SPAN_TEXT', ' ');
13
}
14
if (!defined('MAX_FILE_SIZE')) {
15
  define('MAX_FILE_SIZE', 2621440);
16
}
17
if (!defined('HDOM_SMARTY_AS_TEXT')) {
18
  define('HDOM_SMARTY_AS_TEXT', 1);
19
}
20
21
class helper
22
{
23
  /**
24
   * str_get_html
25
   *
26
   * @param [type] $str
0 ignored issues
show
Documentation Bug introduced by
The doc comment [type] at position 0 could not be parsed: Unknown type name '[' at position 0 in [type].
Loading history...
27
   * @param boolean $lowercase
28
   * @param boolean $forceTagsClosed
29
   * @param [type] $target_charset
30
   * @param boolean $stripRN
31
   * @param [type] $defaultBRText
32
   * @param [type] $defaultSpanText
33
   * @return HtmlDocument
34
   */
35
  public static function str_get_html(
36
    $str,
37
    $lowercase = true,
38
    $forceTagsClosed = true,
39
    $target_charset = DEFAULT_TARGET_CHARSET,
40
    $stripRN = true,
41
    $defaultBRText = DEFAULT_BR_TEXT,
42
    $defaultSpanText = DEFAULT_SPAN_TEXT
43
  ) {
44
    $domx = new simple_html_dom();
45
46
    return $domx->str_get_html(
0 ignored issues
show
Bug Best Practice introduced by
The expression return $domx->str_get_ht...Text, $defaultSpanText) could also return false which is incompatible with the documented return type simplehtmldom\HtmlDocument. Did you maybe forget to handle an error condition?

If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.

Loading history...
47
      $str,
48
      $lowercase,
49
      $forceTagsClosed,
50
      $target_charset,
51
      $stripRN,
52
      $defaultBRText,
53
      $defaultSpanText
54
    );
55
  }
56
}
57