<commit_before><?php namespace DavBfr\CF;

/**
 * Copyright (C) 2013-2015 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 **/

use FilesystemIterator;
use Phar;

class Cli {
	const ansiraz = "\e[0m";
	const ansierr = "\e[0;31m";
	const ansiinfo = "\e[1;32m";
	const ansidebug = "\e[1;34m";
	const ansilog = "\e[0;36m";
	const ansiwarn = "\e[1;35m";
	const ansilerr = "\e[1;31m";
	const ansicrit = "\e[0;35m";

	protected $args;
	protected $commands;
	protected $options;
	protected $switches;
	protected $inputs;
	protected $has_colors;
	private static $instance = null;


	/**
	 * Cli constructor.
	 * @param array $argv
	 */
	public function __construct($argv) {
		self::$instance = $this;

		while (ob_get_level())
			ob_end_clean();

		$this->has_colors = posix_isatty(STDOUT);
		$this->args = $this->parseArguments($argv);
		$logger = Logger::getInstance();
		if (array_key_exists("v", $this->args))
			$logger->setLevel(Logger::DEBUG);

		$this->commands = array();
		$this->options = array();
		$this->switches = array();
		$this->inputs = array();
		$this->addCommand("help", array($this, "printHelp"), "Help messages");
	}


	/**
	 * @return string
	 */
	public function getCommand() {
		if (isset($this->args['input']) && isset($this->args['input'][1]))
			return $this->args['input'][1];
		return "help";
	}

<commit_msg>Fix issue with php 7.2<commit_after><?php namespace DavBfr\CF;

/**
 * Copyright (C) 2013-2015 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 **/

use FilesystemIterator;
use Phar;

class Cli {
	const ansiraz = "\e[0m";
	const ansierr = "\e[0;31m";
	const ansiinfo = "\e[1;32m";
	const ansidebug = "\e[1;34m";
	const ansilog = "\e[0;36m";
	const ansiwarn = "\e[1;35m";
	const ansilerr = "\e[1;31m";
	const ansicrit = "\e[0;35m";

	protected $args;
	protected $commands;
	protected $options;
	protected $switches;
	protected $inputs;
	protected $has_colors;
	private static $instance = null;


	/**
	 * Cli constructor.
	 * @param array $argv
	 */
	public function __construct($argv) {
		self::$instance = $this;

		while (ob_get_level())
			ob_end_clean();

		$this->has_colors = defined('STDOUT') ? posix_isatty(STDOUT) : false;
		$this->args = $this->parseArguments($argv);
		$logger = Logger::getInstance();
		if (array_key_exists("v", $this->args))
			$logger->setLevel(Logger::DEBUG);

		$this->commands = array();
		$this->options = array();
		$this->switches = array();
		$this->inputs = array();
		$this->addCommand("help", array($this, "printHelp"), "Help messages");
	}


	/**
	 * @return string
	 */
	public function getCommand() {
		if (isset($this->args['input']) && isset($this->args['input'][1]))
			return $this->args['input'][1];
		return "help";
	}


{'fraction_non_alphanumeric': 0.1447336414497689, 'fraction_numerical': 0.022378983215762586, 'mean_word_length': 4.101736972704715, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, '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': '783164', 'n_tokens_mistral': 1417, 'n_tokens_neox': 1306, 'n_words': 440}