public static function getPatternFor(Pattern $parent, $word)
    {
        if (self::isWildcard($word)) {
            return self::getWildcardPattern($parent, $word);
        }

        return new Word($word);
    }
public static function getPatternFor(Pattern $parent, $word)
    {
        if (self::isWildcard($word)) {
            return self::getWildcardPattern($parent, $word);
        }

        return new Word($word);
    }
public static function getPatternFor ( Pattern $ parent , $ word ) { if ( self :: isWildcard ( $ word ) ) { return self :: getWildcardPattern ( $ parent , $ word ) ; } return new Word ( $ word ) ; }
Builds a pattern node based on a given word and its parent.

@param Pattern $parent The parent pattern object, in case a loop node will be built.
@param string $word A single word from a composite pattern.
@return Pattern A pattern object.
Builds a pattern node based on a given word and its parent .