Skip to content

Commit 7970012

Browse files
committed
Fix
Fix lots of undefined properties
1 parent 226fdbe commit 7970012

File tree

3 files changed

+49
-23
lines changed

3 files changed

+49
-23
lines changed

src/Form/Handler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Handler
99

1010
public $subittedData;
1111
public $files;
12+
public $formcount;
1213

1314
public function __construct()
1415
{

src/HTTPHelper.php

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,65 @@
1111
use HTTPFriend\Tags\Css as Css;
1212

1313

14-
class HTTPHelper {
15-
14+
class HTTPHelper
15+
{
16+
1617
public $charset = "UTF-8";
1718
public $html;
19+
public $tag;
20+
public $CSS;
1821

1922
private $config = [];
20-
21-
public function __construct( $config = [] )
23+
24+
public function __construct($config = [])
2225
{
23-
$this->setConfig( $config );
24-
$this->tag = $this->tag ?: new Tag;
25-
$this->CSS = $this->CSS ?: new Css;
26+
$this->setConfig($config);
27+
$this->tag = $this->tag ? : new Tag;
28+
$this->CSS = $this->CSS ? : new Css;
2629
}
2730

28-
public function setConfig( $config = [] ){
31+
public function setConfig($config = [])
32+
{
2933
$this->config = $config;
3034
}
3135

32-
public function setConfigParameter( $configPart, $configSetting ){
33-
$this->config[ $configPart ] = $configSetting;
36+
public function setConfigParameter($configPart, $configSetting)
37+
{
38+
$this->config[$configPart] = $configSetting;
3439
}
3540

36-
public function getConfig(){
41+
public function getConfig()
42+
{
3743
return $this->config;
3844
}
3945

40-
public function getConfigSetting( $configPart ){
41-
return $this->config[ $configPart ];
46+
public function getConfigSetting($configPart)
47+
{
48+
return $this->config[$configPart];
4249
}
43-
44-
public function setHTML( $html = null )
50+
51+
public function setHTML($html = null)
4552
{
4653
$this->html = $html;
4754
}
4855

49-
public function getHTML() {
56+
public function getHTML()
57+
{
5058
return $this->html;
5159
}
5260

53-
public function parseHTML(){
54-
if( isset( $this->html ) ){
61+
public function parseHTML()
62+
{
63+
if (isset($this->html)) {
5564

56-
if( $this->getConfigSetting( "baseURL" ) ){
65+
if ($this->getConfigSetting("baseURL")) {
5766

58-
$baseURL = $this->getConfigSetting( "baseURL" );
67+
$baseURL = $this->getConfigSetting("baseURL");
5968

60-
$this->setHTML( $this->tag->cleanURLs( $this->getHTML(), $baseURL ) );
69+
$this->setHTML($this->tag->cleanURLs($this->getHTML(), $baseURL));
6170

62-
}
63-
}
71+
}
72+
}
6473

6574

6675
}

src/Tags/Tag.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,22 @@ public function createElement($tag, $attr = [], $selfClosing = false, $close = f
5757

5858
public function output($options = [])
5959
{
60+
if (!isset($options["tag"])) {
61+
throw new Exception("No Tag defined");
62+
}
63+
64+
if (!isset($options["attr"])) {
65+
$options["attr"] = [];
66+
}
67+
68+
if (!isset($options["selfClosing"])) {
69+
$options["selfClosing"] = false;
70+
}
71+
72+
if (!isset($options["close"])) {
73+
$options["close"] = false;
74+
}
75+
6076
ob_start();
6177
echo $this->createElement($options["tag"], $options["attr"], $options['selfClosing'], $options["close"]);
6278
echo ob_get_clean();

0 commit comments

Comments
 (0)