diff --git a/composer.json b/composer.json index 111b751..30e2c2d 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "laravelcollective/html", "description": "HTML and Form Builders for the Laravel Framework", "license": "MIT", - "homepage": "http://laravelcollective.com", + "homepage": "https://laravelcollective.com", "support": { "issues": "https://github.com/LaravelCollective/html/issues", "source": "https://github.com/LaravelCollective/html" diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 2b69ac0..195f195 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -865,7 +865,7 @@ class FormBuilder return false; } - if ($this->missingOldAndModel($name) && !$request) { + if ($this->missingOldAndModel($name) && is_null($request)) { return $checked; } diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index d2ba3cd..210c7e7 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -78,7 +78,7 @@ class HtmlBuilder { $attributes['src'] = $this->url->asset($url, $secure); - return $this->toHtmlString('' . PHP_EOL); + return $this->toHtmlString(''); } /** @@ -98,7 +98,7 @@ class HtmlBuilder $attributes['href'] = $this->url->asset($url, $secure); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -136,7 +136,7 @@ class HtmlBuilder $attributes['href'] = $this->url->asset($url, $secure); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -511,7 +511,7 @@ class HtmlBuilder $attributes = array_merge($defaults, $attributes); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -525,8 +525,8 @@ class HtmlBuilder */ public function tag($tag, $content, array $attributes = []) { - $content = is_array($content) ? implode(PHP_EOL, $content) : $content; - return $this->toHtmlString('<' . $tag . $this->attributes($attributes) . '>' . PHP_EOL . $this->toHtmlString($content) . PHP_EOL . '' . $tag . '>' . PHP_EOL); + $content = is_array($content) ? implode('', $content) : $content; + return $this->toHtmlString('<' . $tag . $this->attributes($attributes) . '>' . $this->toHtmlString($content) . '' . $tag . '>'); } /** diff --git a/tests/HtmlBuilderTest.php b/tests/HtmlBuilderTest.php index b5d7d99..a5bcb8b 100644 --- a/tests/HtmlBuilderTest.php +++ b/tests/HtmlBuilderTest.php @@ -65,7 +65,7 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase { $result = $this->htmlBuilder->meta('description', 'Lorem ipsum dolor sit amet.'); - $this->assertEquals('' . PHP_EOL, $result); + $this->assertEquals('', $result); } public function testTag() @@ -83,17 +83,17 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase $result4 = $this->htmlBuilder->tag('div', $content, ['class' => 'row']); - $this->assertEquals('
' . PHP_EOL . 'Lorem ipsum dolor sit amet.' . PHP_EOL . '
' . PHP_EOL, $result1); - $this->assertEquals('' . PHP_EOL . 'Lorem ipsum dolor sit amet.' . PHP_EOL . '
' . PHP_EOL, $result2); - $this->assertEquals('Lorem ipsum dolor sit amet.
' . PHP_EOL . 'Lorem ipsum dolor sit amet.
', $result1); + $this->assertEquals('Lorem ipsum dolor sit amet.
', $result2); + $this->assertEquals('Lorem ipsum dolor sit amet.