<commit_before><?php

use Respect\Data\Collections\Filtered;
use Routelandia\Entities\Detector;
use Routelandia\Entities\OrderedStation;

class Detectors
{

    /**
     * Return a single detector
     *
     * Returns the detector with the provided detectorid
     *
     * @acces public
     * @param int $id detector's database ID.
     * @return [Detector]
     */
    function get($id) {
      return Detector::fetch($id);
    }

    /**
     * Return all detectors for a given station
     *
     * Will return all the detectors associated with that station
     *
     * @access private
     * @param int $id The stationid to get detectors for
     * @return [Detector]
     */
    function getForStation($id) {
      Detector::fetchForStation($id);
    }


    /**
     * Return all available detectors
     *
     * Makes no effort to filter detectors in any way. This is the big list.
     *
     * @access public
     * @return [Detector] A list of all detectors.
     */
    function index() {
      return Detector::fetchAll();
    }

    /**
     * Indicate whether the detector is still active or not
     *
     * Indicate whether or not the detector is still active or not.
     * Aka does the detector have an end date in the database.
     *
     * @param int $id id of the detector
     * @return bool
     * @url GET {id}/stillactive
     */
    public function stillActive($id){
      $thisDetector = Detector::fetch($id);
      return $thisDetector->stillActive();
    }

    /**
     * Get the associated station for the given detector id
     *
     * Returns the associated station JSON object when given a detector ID
     *
     * @param int $detectorid The detectors ID
     * @return [Station] The associated station
     * @url GET {detectorid}/relatedstation
     */
    public function RelatedStation($detectorid){
        $thisDetector = Detector::fetch($detectorid);
        $s = OrderedStation::Fetch($thisDetector->stationid);
        $s->decodeSegmentsJson();
        return $s;
    }
}<commit_msg>Coding standards<commit_after><?php

use Respect\Data\Collections\Filtered;
use Routelandia\Entities\Detector;
use Routelandia\Entities\OrderedStation;

class Detectors
{

  /**
   * Return a single detector
   *
   * Returns the detector with the provided detectorid
   *
   * @acces public
   * @param int $id detector's database ID.
   * @return [Detector]
   */
  function get($id) {
    return Detector::fetch($id);
  }



  /**
   * Return all detectors for a given station
   *
   * Will return all the detectors associated with that station
   *
   * @access private
   * @param int $id The stationid to get detectors for
   * @return [Detector]
   */
  function getForStation($id) {
    Detector::fetchForStation($id);
  }



  /**
   * Return all available detectors
   *
   * Makes no effort to filter detectors in any way. This is the big list.
   *
   * @access public
   * @return [Detector] A list of all detectors.
   */
  function index() {
    return Detector::fetchAll();
  }



  /**
   * Indicate whether the detector is still active or not
   *
   * Indicate whether or not the detector is still active or not.
   * Aka does the detector have an end date in the database.
   *
   * @param int $id id of the detector
   * @return bool
   * @url GET {id}/stillactive
   */
  public function stillActive($id){
    $thisDetector = Detector::fetch($id);
    return $thisDetector->stillActive();
  }



  /**
   * Get the associated station for the given detector id
   *
   * Returns the associated station JSON object when given a detector ID
   *
   * @param int $detectorid The detectors ID
   * @return [Station] The associated station
   * @url GET {detectorid}/relatedstation
   */
  public function RelatedStation($detectorid){
    $thisDetector = Detector::fetch($detectorid);
    $s = OrderedStation::Fetch($thisDetector->stationid);
    $s->decodeSegmentsJson();
    return $s;
  }
}
{'fraction_non_alphanumeric': 0.09984794728839332, 'fraction_numerical': 0.0, 'mean_word_length': 2.63778801843318, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4585259', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1129, 'n_words': 383}