Skip to content

Commit

Permalink
Add $id and $val to exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mundschenk-at committed Jun 13, 2024
1 parent 5deaa92 commit c48a2a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/text-parser/class-token.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function __get( $property ) {
* @throws \BadMethodCallException The Token class is immutable.
*/
public function __set( $id, $val ) {
throw new \BadMethodCallException( 'Object of class Text_Parser\Token is immutable.' );
throw new \BadMethodCallException( "Object of class Text_Parser\Token is immutable. Cannot set property '$id' to '$val'." );
}

/**
Expand All @@ -150,7 +150,7 @@ public function __set( $id, $val ) {
* @throws \BadMethodCallException The Token class is immutable.
*/
public function __unset( $id ) {
throw new \BadMethodCallException( 'Object of class Text_Parser\Token is immutable.' );
throw new \BadMethodCallException( "Object of class Text_Parser\Token is immutable. Cannot unset property '$id'." );
}

/**
Expand Down

0 comments on commit c48a2a7

Please sign in to comment.