<commit_before><?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\build\controllers;

use Yii;
use yii\console\Controller;
use yii\helpers\Console;
use yii\helpers\FileHelper;

/**
 * PhpDocController is there to help maintaining PHPDoc annotation in class files
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class PhpDocController extends Controller
{
	public $defaultAction = 'property';

	/**
	 * @var bool whether to update class docs directly. Setting this to false will just output docs
	 * for copy and paste.
	 */
	public $updateFiles = true;

	/**
	 * Generates @property annotations in class files from getters and setters
	 *
	 * Property description will be taken from getter or setter or from an @property annotation
	 * in the getters docblock if there is one defined.
	 *
	 * See https://github.com/yiisoft/yii2/wiki/Core-framework-code-style#documentation for details.
	 *
	 * @param null $root the directory to parse files from. Defaults to YII_PATH.
	 */
	public function actionProperty($root = null)
	{
		$except = [];
		if ($root === null) {
			$root = dirname(YII_PATH);
			$extensionPath = "$root/extensions";
			foreach (scandir($extensionPath) as $extension) {
				if (ctype_alpha($extension) && is_dir($extensionPath . '/' . $extension)) {
					Yii::setAlias("@yii/$extension", "$extensionPath/$extension");
				}
			}

			$except = [
				'/apps/',
				'/build/',
				'/docs/',
				'/extensions/composer/',
				'/tests/',
				'/vendor/',
			];
		}
		$root = FileHelper::normalizePath($root);
		$options = [
			'filter' => function ($path) {
				if (is_file($path)) {
					$file = basename($path);
					if ($file[0] < 'A' || $file[0] > 'Z') {
						return false;
					}
				}
				return null;
			},
			'only' => ['*.php'],
			'except' => array_merge($except, [
				'/BaseYii.php',
				'/Yii.php',
				'/views/',
				'/requirements/',
				'/gii/generators/',
			]),
		];
		$files = FileHelper::findFiles($root, $options);
		$nFilesTotal = 0;<commit_msg>fixed exclude paths in phpdoc command<commit_after><?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\build\controllers;

use Yii;
use yii\console\Controller;
use yii\helpers\Console;
use yii\helpers\FileHelper;

/**
 * PhpDocController is there to help maintaining PHPDoc annotation in class files
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class PhpDocController extends Controller
{
	public $defaultAction = 'property';

	/**
	 * @var bool whether to update class docs directly. Setting this to false will just output docs
	 * for copy and paste.
	 */
	public $updateFiles = true;

	/**
	 * Generates @property annotations in class files from getters and setters
	 *
	 * Property description will be taken from getter or setter or from an @property annotation
	 * in the getters docblock if there is one defined.
	 *
	 * See https://github.com/yiisoft/yii2/wiki/Core-framework-code-style#documentation for details.
	 *
	 * @param null $root the directory to parse files from. Defaults to YII_PATH.
	 */
	public function actionProperty($root = null)
	{
		$except = [];
		if ($root === null) {
			$root = dirname(YII_PATH);
			$extensionPath = "$root/extensions";
			foreach (scandir($extensionPath) as $extension) {
				if (ctype_alpha($extension) && is_dir($extensionPath . '/' . $extension)) {
					Yii::setAlias("@yii/$extension", "$extensionPath/$extension");
				}
			}

			$except = [
				'.git/',
				'/apps/',
				'/build/',
				'/docs/',
				'/extensions/apidoc/helpers/PrettyPrinter.php',
				'/extensions/codeception/TestCase.php',
				'/extensions/codeception/DbTestCase.php',
				'/extensions/composer/',
				'/extensions/gii/components/DiffRendererHtmlInline.php',
				'/extensions/twig/TwigSimpleFileLoader.php',
				'/framework/BaseYii.php',
				'/framework/Yii.php',
				'/tests/',
				'/vendor/',
			];
		}
		$root = FileHelper::normalizePath($root);
		$options = [
			'filter' => function ($path) {
				if (is_file($path)) {
					$file = basename($path);
					if ($file[0] < 'A' || $file[0] > 'Z') {
						return false;
					}
				}
				return null;
			},
			'only' => ['*.php'],
			'except' => array_merge($except, [
				'views/',
				'requirements/',
				'gii/generators/',
				'vendor/',
			]),
		];
		$files = FileHelper::findFiles($root, $options);
		$nFilesTotal = 0;
{'fraction_non_alphanumeric': 0.16188389923329682, 'fraction_numerical': 0.004381161007667032, 'mean_word_length': 3.2005519779208833, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '3384039', 'n_tokens_mistral': 1785, 'n_tokens_neox': 1480, 'n_words': 375}