Skip to content

Commit

Permalink
Add method to clear memoization caches, refs #131
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 15, 2022
1 parent af3620d commit e2000a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/CompilingMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ class CompilingMatcher
Constraint::OP_NE => Constraint::STR_OP_NE,
);

/**
* Clears the memoization cache once you are done
*
* @return void
*/
public static function clear()
{
self::$resultCache = array();
self::$compiledCheckerCache = array();
}

/**
* Evaluates the expression: $constraint match $operator $version
*
Expand Down

0 comments on commit e2000a2

Please sign in to comment.