/** * Determine if $this can be considered a short form of the argument. * If so, then determine the number of matches. * * @param WCNames $names * @return integer|boolean */ public function shortFormMatches( WCData $names ) { $matches = 0; foreach( $this->names as $nameKey => $thisName ) { $otherName = $names->getName( $nameKey ); $subMatches = $thisName->shortFormMatches( $otherName ); if ( $subMatches === False ) { return False; } else { $matches += $subMatches; } } return $matches; }
/** * Determine if $this can be considered a short form of the argument. * If so, then determine the number of matches. * * @param WCText $text * @return integer|boolean */ public function shortFormMatches( WCData $text ) { if ( strnatcasecmp( $this->text === $text->getText() ) === 0 ) return 1; else return False; }
/** * Determine if $this can be considered a short form of the argument. * If so, then determine the number of matches. * * @param WCTitle $title * @return integer|boolean */ public function shortFormMatches( WCData $title ) { return strnatcasecmp( $this->title, $title->getTitle() ) === 0 ? 1 : False; }
/** * Determine if $this can be considered a short form of argument. * If so, then determine the number of matches. * * @param WCName $name * @return integer|boolean */ public function shortFormMatches( WCData $name ) { $matches = 0; foreach( $this->parts as $partKey => $part ) { $otherPart = $name->getPart( $partKey ); if ( isset( $otherPart ) && strnatcasecmp( $part, $otherPart ) === 0 ) { ++$matches; } else { return False; } } return $matches; }