<commit_before><?php namespace Zeropingheroes\Lanager\Shouts;

use Zeropingheroes\Lanager\FlatResourceService;
use Auth, Authority;

class ShoutService extends FlatResourceService {

	protected $resource = 'shout';

	public function __construct( $listener )
	{
		parent::__construct($listener, new Shout);
	}

	public function filterInput($input)
	{
		if( Authority::cannot('manage', 'shouts') )
		{
			$input['user_id'] = Auth::user()->id;
			unset($input['pinned']);
		}
		
		return $input;
	}

	public function store($input)
	{
		$input = $this->filterInput($input);
		return parent::store($input);
	}

	public function update($id, $input)
	{
		$input = $this->filterInput($input);
		return parent::update($id, $input);
	}

}<commit_msg>Fixing missing user id on shout submission<commit_after><?php namespace Zeropingheroes\Lanager\Shouts;

use Zeropingheroes\Lanager\FlatResourceService;
use Auth, Authority;

class ShoutService extends FlatResourceService {

	protected $resource = 'shout';

	public function __construct( $listener )
	{
		parent::__construct($listener, new Shout);
	}

	public function filterInput($input)
	{
		if( Authority::cannot('manage', 'shouts') )
		{
			$input['user_id'] = Auth::user()->id;
			unset($input['pinned']);
		}
		
		return $input;
	}

	public function store($input)
	{
		if( ! array_key_exists('user_id', $input) ) $input['user_id'] = Auth::user()->id;
		
		$input = $this->filterInput($input);
		return parent::store($input);
	}

	public function update($id, $input)
	{
		$input = $this->filterInput($input);
		return parent::update($id, $input);
	}

}
{'fraction_non_alphanumeric': 0.16040100250626566, 'fraction_numerical': 0.0, 'mean_word_length': 5.072243346007604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '6640679', 'n_tokens_mistral': 585, 'n_tokens_neox': 533, 'n_words': 109}