Skip to content

Commit ca659ac

Browse files
authored
Merge pull request #72 from DaSourcerer/70-parserexception-must-die
Replace ParserException by DomainException
2 parents c049d4f + f1abcfe commit ca659ac

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

JBBCode/Parser.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
require_once 'CodeDefinitionBuilder.php';
1111
require_once 'CodeDefinitionSet.php';
1212
require_once 'NodeVisitor.php';
13-
require_once 'ParserException.php';
1413
require_once 'Tokenizer.php';
1514
require_once 'visitors/NestLimitVisitor.php';
1615
require_once 'InputValidator.php';
@@ -487,7 +486,7 @@ protected function parseOptions($tagContent)
487486

488487
// peek ahead. If the next character is not a space or a closing brace, we have a bad tag and need to abort
489488
if(isset($tagContent[$idx+1]) && $tagContent[$idx+1]!=" " && $tagContent[$idx+1]!="]" ){
490-
throw new ParserException("Badly formed attribute: $tagContent");
489+
throw new \DomainException("Badly formed attribute: $tagContent");
491490
}
492491
break;
493492
default:
@@ -515,7 +514,7 @@ protected function parseOptions($tagContent)
515514
$options = array_combine($keys, $values);
516515
}
517516
}
518-
catch(ParserException $e){
517+
catch(\DomainException $e){
519518
// if we're in this state, then something evidently went wrong. We'll consider everything that came after the tagname to be the attribute for that keyname
520519
$options[$tagName]= substr($tagContent, strpos($tagContent, "=")+1);
521520
}

JBBCode/ParserException.php

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)