/** * Creates instance of matcher with given subject * * @param string $subject * @return JsonMatcher */ public function create($subject) { $matcher = new JsonMatcher($this->jsonHelper, $this->excludedKeys); return $matcher->setSubject($subject); }
/** * Named constructor for simplify usage * * @param string $subject * @param array $excludedKeys * @return JsonMatcher */ public static function create($subject, array $excludedKeys = ['id']) { $matcher = new JsonMatcher(new JsonHelper(), $excludedKeys); $matcher->setSubject($subject); return $matcher; }