<commit_before><?php

namespace Cft;

/**
 * Simple Singleton Plugin class for bare-bones dependency injection
 */
final class Plugin {
  private static $instance;

  private $viewDirs = [
    CFT_PLUGIN_DIR
  ];

  public function getInstance() {
    if( ! self::$instance ) {
      self::$instance = new static();
    }

    return self::$instance;
  }

  // singleton constructor!
  private function __construct() { }

  public function get( $key ) {
    if( isset($this->{$key}) ) {
      return is_callable( $this->{$key} )
        ? call_user_func( $this->{$key} )
        : $this->{$key};
    }
  }

  public function set( $key, $value ) {
    $this->{$key} = $value;<commit_msg>Put DI settings in a private attribute<commit_after><?php

namespace Cft;

/**
 * Simple Singleton Plugin class for bare-bones dependency injection
 */
final class Plugin {
  private static $instance;

  private $attributes = [];

  private $viewDirs = [
    CFT_PLUGIN_DIR
  ];

  public function getInstance() {
    if( ! self::$instance ) {
      self::$instance = new Plugin();
    }

    return self::$instance;
  }

  // singleton constructor!
  private function __construct() { }

  public function get( $key ) {
    if( isset($this->attributes[$key]) ) {
      return is_callable( $this->attributes[$key] )
        ? call_user_func( $this->attributes[$key] )
        : $this->attributes[$key];
    }
  }

  public function set( $key, $value ) {
    $this->attributes[$key] = $value;
{'fraction_non_alphanumeric': 0.1497289972899729, 'fraction_numerical': 0.0, 'mean_word_length': 2.9704301075268815, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6028864', 'n_tokens_mistral': 473, 'n_tokens_neox': 459, 'n_words': 115}