<commit_before><?php

namespace PigeonWebkit;

use Symfony\Component\CssSelector\CssSelector,
  Behat\Mink\Session;

class FunctionalPigeon extends CapybaraWebkitDriver {

  protected $browser;

  public function __construct() {
    $this->browser = new PigeonBrowser();
    parent::__construct($this->browser);
    $this->setSession(new Session($this));
    $this->start();
  }

  public function setXPathMode($bool) {
    $mode = $bool ? "xpath" : "css";
    $this->browser->setMode($mode);
  }

  public function saveScreenShot($path) {
    file_put_contents($path, $this->getScreenShot());
  }

  public function body() {
    return $this->getContent();
  }

  public function ignoreSslErrors() {
    $this->browser->ignoreSslErrors();
  }
}

class PigeonBrowser extends Browser {

  protected $mode = "css";

  public function find($query) {
    $query = $this->mode == "xpath" ? $query : CssSelector::toXPath($query);
    return parent::find($query);
  }

  public function setMode($mode) {
    $this->mode = $mode;
  }
}<commit_msg>Update use of deprecated CssSelector class<commit_after><?php

namespace PigeonWebkit;

use Behat\Mink\Session;

class FunctionalPigeon extends CapybaraWebkitDriver {

  protected $browser;

  public function __construct() {
    $this->browser = new PigeonBrowser();
    parent::__construct($this->browser);
    $this->setSession(new Session($this));
    $this->start();
  }

  public function setXPathMode($bool) {
    $mode = $bool ? "xpath" : "css";
    $this->browser->setMode($mode);
  }

  public function saveScreenShot($path) {
    file_put_contents($path, $this->getScreenShot());
  }

  public function body() {
    return $this->getContent();
  }

  public function ignoreSslErrors() {
    $this->browser->ignoreSslErrors();
  }
}

class PigeonBrowser extends Browser {

  protected $mode = "css";

  public function find($query) {
    $css_selector = new \Symfony\Component\CssSelector\CssSelectorConverter();
    $query = $this->mode == "xpath" ? $query : $css_selector->toXPath($query);
    return parent::find($query);
  }

  public function setMode($mode) {
    $this->mode = $mode;
  }
}
{'fraction_non_alphanumeric': 0.1511899206719552, 'fraction_numerical': 0.0, 'mean_word_length': 4.06855791962175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2849450', 'n_tokens_mistral': 710, 'n_tokens_neox': 687, 'n_words': 139}