<commit_before><?php
/* SVN FILE: $Id$ */
/**
 * The View Tasks handles creating and updating view files.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 * @link          http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.console.libs.tasks
 * @since         CakePHP(tm) v 1.2
 * @version       $Revision$
 * @modifiedby    $LastChangedBy$
 * @lastmodified  $Date$
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */
App::import('Core', 'Controller');
/**
 * Task class for creating and updating view files.
 *
 * @package       cake
 * @subpackage    cake.cake.console.libs.tasks
 */
class ViewTask extends Shell {
/**
 * Name of plugin
 *
 * @var string
 * @access public
 */
	var $plugin = null;
/**
 * Tasks to be loaded by this Task
 *
 * @var array
 * @access public
 */
	var $tasks = array('Project', 'Controller', 'DbConfig', 'Template');
/**
 * path to VIEWS directory
 *
 * @var array
 * @access public
 */
	var $path = VIEWS;
/**
 * Name of the controller being used
 *
 * @var string
 * @access public
 */
	var $controllerName = null;
/**
 * Path to controller to put views
 *
 * @var string
 * @access public
 */
	var $controllerPath = null;
/**
 * The template file to use
 *
 * @var string
 * @access public
 */
	var $template = null;
/**
 * Actions to use for scaffolding
 *
 * @var array
 * @access public
 */
	var $scaffoldActions = array('index', 'view', 'add', 'edit');
/**
 * Override initialize
 *
 * @access public
 */
	function initialize() {
	}

/**
 * Execution method always used for tasks
 *
 * @access public
 */
	function execute() {
		if (empty($this->args)) {
			$this->__interactive();
		}

		if (isset($this->args[0])) {
			if (!isset($this->connection)) {
				$this->connection = 'default';
			}
			$controller = $action = $alias = null;
			$this->controllerName = Inflector::camelize($this->args[0]);
			$this->controllerPath = Inflector::underscore($this->controllerName);

			if (isset($this->args[1])) {
				$this->template = $this->args[1];
			}

			if (isset($this->args[2])) {
				$action = $this->args[2];
			}

			if (!$action) {
				$action = $this->template;
			}

			if (strtolower($this->args[0]) == 'all') {
				return $this->all();
			}

			if (in_array($action, $this->scaffoldActions)) {
				$this->bake($action, true);
			} elseif ($action) {
				$this->bake($action, true);
			} else {
				$vars = $this->__loadController();
				$methods =  array_diff(
					array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
					array_map('strtolower', get_class_methods('appcontroller'))
				);
				if (empty($methods)) {
					$methods = $this->scaffoldActions;
				}
				$adminDelete = null;

				$adminRoute = Configure::read('Routing.admin');
				if (!empty($adminRoute)) {
					$adminDelete = $adminRoute . '_delete';
				}
				foreach ($methods as $method) {
					if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
						$content = $this->getContent($method, $vars);
						$this->bake($method, $content);
					}
				}
			}
		}
	}

/**
 * Bake All views for All controllers.
 *
 * @return void
 **/
	function all() {
		$actions = $this->scaffoldActions;
		$tables = $this->Controller->listAll($this->connection, false);
		$this->interactive = false;
		foreach ($tables as $table) {
			$model = $this->_modelName($table);
			$this->controllerName = $this->_controllerName($model);
			$this->controllerPath = Inflector::underscore($this->controllerName);
			if (App::import('Model', $model)) {
				$vars = $this->__loadController();
				if ($vars) {
					$this->bakeActions($actions, $vars);
				}
			}
		}
	}<commit_msg>Removing more if() blocks Silencing Controller task in all()<commit_after><?php
/* SVN FILE: $Id$ */
/**
 * The View Tasks handles creating and updating view files.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 * @link          http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
 * @package       cake
 * @subpackage    cake.cake.console.libs.tasks
 * @since         CakePHP(tm) v 1.2
 * @version       $Revision$
 * @modifiedby    $LastChangedBy$
 * @lastmodified  $Date$
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */
App::import('Core', 'Controller');
/**
 * Task class for creating and updating view files.
 *
 * @package       cake
 * @subpackage    cake.cake.console.libs.tasks
 */
class ViewTask extends Shell {
/**
 * Name of plugin
 *
 * @var string
 * @access public
 */
	var $plugin = null;
/**
 * Tasks to be loaded by this Task
 *
 * @var array
 * @access public
 */
	var $tasks = array('Project', 'Controller', 'DbConfig', 'Template');
/**
 * path to VIEWS directory
 *
 * @var array
 * @access public
 */
	var $path = VIEWS;
/**
 * Name of the controller being used
 *
 * @var string
 * @access public
 */
	var $controllerName = null;
/**
 * Path to controller to put views
 *
 * @var string
 * @access public
 */
	var $controllerPath = null;
/**
 * The template file to use
 *
 * @var string
 * @access public
 */
	var $template = null;
/**
 * Actions to use for scaffolding
 *
 * @var array
 * @access public
 */
	var $scaffoldActions = array('index', 'view', 'add', 'edit');
/**
 * Override initialize
 *
 * @access public
 */
	function initialize() {
	}

/**
 * Execution method always used for tasks
 *
 * @access public
 */
	function execute() {
		if (empty($this->args)) {
			$this->__interactive();
		}

		if (isset($this->args[0])) {
			if (!isset($this->connection)) {
				$this->connection = 'default';
			}
			$controller = $action = $alias = null;
			$this->controllerName = Inflector::camelize($this->args[0]);
			$this->controllerPath = Inflector::underscore($this->controllerName);

			if (isset($this->args[1])) {
				$this->template = $this->args[1];
			}

			if (isset($this->args[2])) {
				$action = $this->args[2];
			}

			if (!$action) {
				$action = $this->template;
			}

			if (strtolower($this->args[0]) == 'all') {
				return $this->all();
			}

			if (in_array($action, $this->scaffoldActions)) {
				$this->bake($action, true);
			} elseif ($action) {
				$this->bake($action, true);
			} else {
				$vars = $this->__loadController();
				$methods =  array_diff(
					array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
					array_map('strtolower', get_class_methods('appcontroller'))
				);
				if (empty($methods)) {
					$methods = $this->scaffoldActions;
				}
				$adminDelete = null;

				$adminRoute = Configure::read('Routing.admin');
				if (!empty($adminRoute)) {
					$adminDelete = $adminRoute . '_delete';
				}
				foreach ($methods as $method) {
					if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) {
						$content = $this->getContent($method, $vars);
						$this->bake($method, $content);
					}
				}
			}
		}
	}

/**
 * Bake All views for All controllers.
 *
 * @return void
 **/
	function all() {
		$actions = $this->scaffoldActions;
		$this->Controller->interactive = false;
		$tables = $this->Controller->listAll($this->connection, false);
		$this->interactive = false;
		foreach ($tables as $table) {
			$model = $this->_modelName($table);
			$this->controllerName = $this->_controllerName($model);
			$this->controllerPath = Inflector::underscore($this->controllerName);
			if (App::import('Model', $model)) {
				$vars = $this->__loadController();
				$this->bakeActions($actions, $vars);
			}
		}
	}
{'fraction_non_alphanumeric': 0.1723350558827064, 'fraction_numerical': 0.006729960341305132, 'mean_word_length': 3.283067421513124, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5302399', 'n_tokens_mistral': 3053, 'n_tokens_neox': 2667, 'n_words': 650}