+
+ /**
+ * Adds the wildcard match score for the provided wildcard.
+ *
+ * @param ArgumentsWildcard $wildcard
+ * @param false|int $score
+ *
+ * @return $this
+ */
+ public function addScore(ArgumentsWildcard $wildcard, $score)
+ {
+ $this->scores[$wildcard] = $score;
+
+ return $this;
+ }
+
+ /**
+ * Returns wildcard match score for the provided wildcard. The score is
+ * calculated if not already done.
+ *
+ * @param ArgumentsWildcard $wildcard
+ *
+ * @return false|int False OR integer score (higher - better)
+ */
+ public function getScore(ArgumentsWildcard $wildcard)
+ {
+ if (isset($this->scores[$wildcard])) {
+ return $this->scores[$wildcard];
+ }
+
+ return $this->scores[$wildcard] = $wildcard->scoreArguments($this->getArguments());
+ }