本文整理汇总了PHP中PHP_CodeSniffer::isPharFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_CodeSniffer::isPharFile方法的具体用法?PHP PHP_CodeSniffer::isPharFile怎么用?PHP PHP_CodeSniffer::isPharFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHP_CodeSniffer
的用法示例。
在下文中一共展示了PHP_CodeSniffer::isPharFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaults
/**
* Get a list of default values for all possible command line arguments.
*
* @return array
*/
public function getDefaults()
{
if (defined('PHP_CODESNIFFER_IN_TESTS') === true) {
return array();
}
// The default values for config settings.
$defaults['files'] = array();
$defaults['standard'] = null;
$defaults['verbosity'] = 0;
$defaults['interactive'] = false;
$defaults['colors'] = false;
$defaults['explain'] = false;
$defaults['local'] = false;
$defaults['showSources'] = false;
$defaults['extensions'] = array();
$defaults['sniffs'] = array();
$defaults['ignored'] = array();
$defaults['reportFile'] = null;
$defaults['generator'] = '';
$defaults['reports'] = array();
$defaults['bootstrap'] = array();
$defaults['errorSeverity'] = null;
$defaults['warningSeverity'] = null;
$defaults['stdin'] = null;
$reportFormat = PHP_CodeSniffer::getConfigData('report_format');
if ($reportFormat !== null) {
$defaults['reports'][$reportFormat] = null;
}
$tabWidth = PHP_CodeSniffer::getConfigData('tab_width');
if ($tabWidth === null) {
$defaults['tabWidth'] = 0;
} else {
$defaults['tabWidth'] = (int) $tabWidth;
}
$encoding = PHP_CodeSniffer::getConfigData('encoding');
if ($encoding === null) {
$defaults['encoding'] = 'iso-8859-1';
} else {
$defaults['encoding'] = strtolower($encoding);
}
$severity = PHP_CodeSniffer::getConfigData('severity');
if ($severity !== null) {
$defaults['errorSeverity'] = (int) $severity;
$defaults['warningSeverity'] = (int) $severity;
}
$severity = PHP_CodeSniffer::getConfigData('error_severity');
if ($severity !== null) {
$defaults['errorSeverity'] = (int) $severity;
}
$severity = PHP_CodeSniffer::getConfigData('warning_severity');
if ($severity !== null) {
$defaults['warningSeverity'] = (int) $severity;
}
$showWarnings = PHP_CodeSniffer::getConfigData('show_warnings');
if ($showWarnings !== null) {
$showWarnings = (bool) $showWarnings;
if ($showWarnings === false) {
$defaults['warningSeverity'] = 0;
}
}
$reportWidth = PHP_CodeSniffer::getConfigData('report_width');
if ($reportWidth !== null) {
$defaults['reportWidth'] = $this->_validateReportWidth($reportWidth);
} else {
// Use function defaults.
$defaults['reportWidth'] = null;
}
$showProgress = PHP_CodeSniffer::getConfigData('show_progress');
if ($showProgress === null) {
$defaults['showProgress'] = false;
} else {
$defaults['showProgress'] = (bool) $showProgress;
}
$colors = PHP_CodeSniffer::getConfigData('colors');
if ($colors === null) {
$defaults['colors'] = false;
} else {
$defaults['colors'] = (bool) $colors;
}
if (PHP_CodeSniffer::isPharFile(dirname(dirname(__FILE__))) === true) {
// If this is a phar file, check for the standard in the config.
$standard = PHP_CodeSniffer::getConfigData('standard');
if ($standard !== null) {
$defaults['standard'] = $standard;
}
}
return $defaults;
}