<commit_before><?php namespace Larapress\Commands;

use Cartalyst\Sentry\Groups\GroupExistsException;
use Cartalyst\Sentry\Groups\GroupInterface;
use Cartalyst\Sentry\Groups\NameRequiredException;
use Illuminate\Console\Command;
use Cartalyst\Sentry\Sentry;
use Larapress\Services\Mockably;
use UnexpectedValueException;

class InstallCommand extends Command {

	protected $email = '<EMAIL>';
	protected $password = 'password';
	protected $url;

	protected $groups = array(
		'administrator' => array
		(
			'name'        => 'Administrator',
			'permissions' => array(
				'access.backend'       => 1,
				'administrator.edit'   => 1,
				'owner.add'            => 1,
				'owner.remove'         => 1,
				'owner.edit'           => 1,
				'moderator.add'        => 1,
				'moderator.remove'     => 1,
				'moderator.edit'       => 1,
				'self.remove'          => 0,
				'content.administrate' => 1,
				'content.manage'       => 1,
				'configuration.edit'   => 1,
				'partial.add'          => 1,
				'partial.edit'         => 1,
			),
		),
		'owner' => array
		(
			'name'        => 'Owner',
			'permissions' => array(
				'access.backend'       => 1,
				'administrator.edit'   => 0,
				'owner.add'            => 0,
				'owner.remove'         => 0,
				'owner.edit'           => 1,
				'moderator.add'        => 1,
				'moderator.remove'     => 1,
				'moderator.edit'       => 1,
				'self.remove'          => 0,
				'content.administrate' => 0,
				'content.manage'       => 1,
				'configuration.edit'   => 1,
				'partial.add'          => 0,
				'partial.edit'         => 1,
			),
		),
		'moderator' => array
		(
			'name'        => 'Moderator',
			'permissions' => array(
				'access.backend'       => 1,
				'administrator.edit'   => 0,
				'owner.add'            => 0,
				'owner.remove'         => 0,
				'owner.edit'           => 0,
				'moderator.add'        => 0,
				'moderator.remove'     => 0,
				'moderator.edit'       => 0,
				'self.remove'          => 1,
				'content.administrate' => 0,
				'content.manage'       => 1,
				'configuration.edit'   => 0,
				'partial.add'          => 0,
				'partial.edit'         => 0,
			),
		)
	);

	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'larapress:install';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Install larapress.';

	/**
	 * @var \Cartalyst\Sentry\Sentry
	 */
	private $sentry;

	/**
	 * @var \Larapress\Services\Mockably
	 */
	private $mockably;

	/**
	 * Create a new command instance.
	 *
	 * @param \Cartalyst\Sentry\Sentry $sentry
	 * @param \Larapress\Services\Mockably $mockably
	 * @return InstallCommand
	 */
	public function __construct(Sentry $sentry, Mockably $mockably)
	{
		parent::__construct();

		$this->sentry = $sentry;
		$this->mockably = $mockably;
		$this->url = $mockably->route('larapress.home.login.get');
	}

	/**
	 * Abort command execution with a given error message
	 *
	 * @param string $message
	 */
	protected function abort_command($message)
	{
		$this->call('migrate:reset');
		$this->error($message);
		$this->mockably->mockable_die();
	}

	/**
	 * Create User Groups / Roles
	 *
	 * @return null|GroupInterface Returns the Administrator group
	 */
	public function create_user_groups()
	{
		$admin_group = null;

		try
		{
			$admin_group = $this->sentry->createGroup($this->groups['administrator']);
			$this->sentry->createGroup($this->groups['owner']);
			$this->sentry->createGroup($this->groups['moderator']);<commit_msg>Apply some PHPDoc fixes to the install command<commit_after><?php namespace Larapress\Commands;

use Cartalyst\Sentry\Groups\GroupExistsException;
use Cartalyst\Sentry\Groups\GroupInterface;
use Cartalyst\Sentry\Groups\NameRequiredException;
use Illuminate\Console\Command;
use Cartalyst\Sentry\Sentry;
use Larapress\Services\Mockably;
use UnexpectedValueException;

class InstallCommand extends Command {

	protected $email = '<EMAIL>';
	protected $password = 'password';
	protected $url;

	protected $groups = array(
		'administrator' => array
		(
			'name'        => 'Administrator',
			'permissions' => array(
				'access.backend'       => 1,
				'administrator.edit'   => 1,
				'owner.add'            => 1,
				'owner.remove'         => 1,
				'owner.edit'           => 1,
				'moderator.add'        => 1,
				'moderator.remove'     => 1,
				'moderator.edit'       => 1,
				'self.remove'          => 0,
				'content.administrate' => 1,
				'content.manage'       => 1,
				'configuration.edit'   => 1,
				'partial.add'          => 1,
				'partial.edit'         => 1,
			),
		),
		'owner' => array
		(
			'name'        => 'Owner',
			'permissions' => array(
				'access.backend'       => 1,
				'administrator.edit'   => 0,
				'owner.add'            => 0,
				'owner.remove'         => 0,
				'owner.edit'           => 1,
				'moderator.add'        => 1,
				'moderator.remove'     => 1,
				'moderator.edit'       => 1,
				'self.remove'          => 0,
				'content.administrate' => 0,
				'content.manage'       => 1,
				'configuration.edit'   => 1,
				'partial.add'          => 0,
				'partial.edit'         => 1,
			),
		),
		'moderator' => array
		(
			'name'        => 'Moderator',
			'permissions' => array(
				'access.backend'       => 1,
				'administrator.edit'   => 0,
				'owner.add'            => 0,
				'owner.remove'         => 0,
				'owner.edit'           => 0,
				'moderator.add'        => 0,
				'moderator.remove'     => 0,
				'moderator.edit'       => 0,
				'self.remove'          => 1,
				'content.administrate' => 0,
				'content.manage'       => 1,
				'configuration.edit'   => 0,
				'partial.add'          => 0,
				'partial.edit'         => 0,
			),
		)
	);

	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'larapress:install';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Install larapress.';

	/**
	 * @var \Cartalyst\Sentry\Sentry
	 */
	private $sentry;

	/**
	 * @var \Larapress\Services\Mockably
	 */
	private $mockably;

	/**
	 * Create a new command instance.
	 *
	 * @param \Cartalyst\Sentry\Sentry $sentry
	 * @param \Larapress\Services\Mockably $mockably
	 * @return InstallCommand
	 */
	public function __construct(Sentry $sentry, Mockably $mockably)
	{
		parent::__construct();

		$this->sentry = $sentry;
		$this->mockably = $mockably;
		$this->url = $mockably->route('larapress.home.login.get');
	}

	/**
	 * Abort command execution with a given error message
	 *
	 * @param string $message
	 */
	protected function abort_command($message)
	{
		$this->call('migrate:reset');
		$this->error($message);
		$this->mockably->mockable_die();
	}

	/**
	 * Create User Groups / Roles
	 *
	 * @return GroupInterface Returns the Administrator group
	 */
	public function create_user_groups()
	{
		$admin_group = null;

		try
		{
			$admin_group = $this->sentry->createGroup($this->groups['administrator']);
			$this->sentry->createGroup($this->groups['owner']);
			$this->sentry->createGroup($this->groups['moderator']);
{'fraction_non_alphanumeric': 0.16506364922206507, 'fraction_numerical': 0.011881188118811881, 'mean_word_length': 2.3228383458646618, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 141, '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': '239021', 'n_tokens_mistral': 2871, 'n_tokens_neox': 2345, 'n_words': 454}