Source

trekel / src / php / Trekel / Node / Attribute / StartsWith.php

Full commit
<?php

class Trekel_Node_Attribute_StartsWith extends Trekel_Node_Attribute {
  public function reduce ($node, $idx, $total) {
    $this->initMatches();
    $data = $this->getData($node);
    $value = $this->getValue();

    if (strpos($data, $value) === 0) {
      $this->matchNode($node);
    }

    return $this->getMatches();
  }
}// end Trekel_Node_Attribute_StartsWith