當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PHP_CodeSniffer::isPharFile方法代碼示例

本文整理匯總了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;
 }
開發者ID:ghermans,項目名稱:PHP_CodeSniffer,代碼行數:93,代碼來源:CLI.php


注:本文中的PHP_CodeSniffer::isPharFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。