Skip to content

Commit

Permalink
use InvalidArgumentException instead for exception in setCharset
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Aug 30, 2017
1 parent 01ddf68 commit ed6cc45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Helper/HeadMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function set($value)
* Not valid in a non-HTML5 doctype
*
* @param string $charset
* @param Exception\RuntimeException
* @param Exception\InvalidArgumentException
* @return HeadMeta Provides a fluent interface
*/
public function setCharset($charset)
Expand All @@ -475,7 +475,7 @@ public function setCharset($charset)
$item->modifiers = [];

if (! $this->isValid($item)) {
throw new Exception\RuntimeException('XHTML* doctype has no attribute charset; please use appendHttpEquiv()');
throw new Exception\InvalidArgumentException('XHTML* doctype has no attribute charset; please use appendHttpEquiv()');
}

$this->set($item);
Expand Down
2 changes: 1 addition & 1 deletion test/Helper/HeadMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public function testCharsetPosition()

public function testCarsetWithXhtmlDoctypeGotException()
{
$this->expectException(Exception\RuntimeException::class);
$this->expectException(Exception\InvalidArgumentException::class);
$this->expectExceptionMessage('XHTML* doctype has no attribute charset; please use appendHttpEquiv()');

$view = new View();
Expand Down

0 comments on commit ed6cc45

Please sign in to comment.