<commit_before><?php

namespace eland\task;

use Doctrine\DBAL\Connection as db;
use Monolog\Logger;
use eland\xdb;

class cleanup_news
{
	protected $db;
	protected $xdb;
	protected $monolog;

	public function __construct(db $db, xdb $xdb, Logger $monolog)
	{
		$this->db = $db;
		$this->xdb = $xdb;
		$this->monolog = $monolog;
	}

	function run($schema)
	{
		$now = gmdate('Y-m-d H:i:s');

		$news = $this->db->fetchAll('select id, content from ' . $schema . '.news where itemdate < ? and sticky = \'f\'', [$now]);

		foreach ($news as $n)
		{
			$this->xdb->del('news_access', $n['id'], $schema);
			$this->db->delete($schema . '.news', ['id' => $n['id']]);
			$this->monolog->info('removed news item ' . $n['content'], ['schema' => $schema]);
		}
	}
}
<commit_msg>news headline<commit_after><?php

namespace eland\task;

use Doctrine\DBAL\Connection as db;
use Monolog\Logger;
use eland\xdb;

class cleanup_news
{
	protected $db;
	protected $xdb;
	protected $monolog;

	public function __construct(db $db, xdb $xdb, Logger $monolog)
	{
		$this->db = $db;
		$this->xdb = $xdb;
		$this->monolog = $monolog;
	}

	function run($schema)
	{
		$now = gmdate('Y-m-d H:i:s');

		$news = $this->db->fetchAll('select id, headline from ' . $schema . '.news where itemdate < ? and sticky = \'f\'', [$now]);

		foreach ($news as $n)
		{
			$this->xdb->del('news_access', $n['id'], $schema);
			$this->db->delete($schema . '.news', ['id' => $n['id']]);
			$this->monolog->info('removed news item ' . $n['headline'], ['schema' => $schema]);
		}
	}
}

{'fraction_non_alphanumeric': 0.21846553966189858, 'fraction_numerical': 0.0, 'mean_word_length': 3.809375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, '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': '2243899', 'n_tokens_mistral': 645, 'n_tokens_neox': 604, 'n_words': 137}