function File::__construct
Same name in this branch
- 11.1.x vendor/phpunit/php-code-coverage/src/Node/File.php \SebastianBergmann\CodeCoverage\Node\File::__construct()
- 11.1.x vendor/phpunit/php-code-coverage/src/Report/Xml/File.php \SebastianBergmann\CodeCoverage\Report\Xml\File::__construct()
- 11.1.x vendor/phpunit/phpunit/src/TextUI/Configuration/Value/File.php \PHPUnit\TextUI\Configuration\File::__construct()
- 11.1.x vendor/symfony/mime/Part/File.php \Symfony\Component\Mime\Part\File::__construct()
- 11.1.x vendor/symfony/validator/Constraints/File.php \Symfony\Component\Validator\Constraints\File::__construct()
- 11.1.x vendor/symfony/http-foundation/File/File.php \Symfony\Component\HttpFoundation\File\File::__construct()
- 11.1.x core/modules/file/src/Plugin/views/field/File.php \Drupal\file\Plugin\views\field\File::__construct()
Constructs a file.
Parameters
string $path The absolute path to the file to process.:
\PHP_CodeSniffer\Ruleset $ruleset The ruleset used for the run.:
\PHP_CodeSniffer\Config $config The config data for the run.:
Return value
void
4 calls to File::__construct()
- DummyFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ DummyFile.php - Creates a DummyFile object and sets the content.
- DummyFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ DummyFile.php - Creates a DummyFile object and sets the content.
- LocalFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ LocalFile.php - Creates a LocalFile object and sets the content.
- LocalFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ LocalFile.php - Creates a LocalFile object and sets the content.
2 methods override File::__construct()
- DummyFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ DummyFile.php - Creates a DummyFile object and sets the content.
- LocalFile::__construct in vendor/
squizlabs/ php_codesniffer/ src/ Files/ LocalFile.php - Creates a LocalFile object and sets the content.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Files/ File.php, line 236
Class
Namespace
PHP_CodeSniffer\FilesCode
public function __construct($path, Ruleset $ruleset, Config $config) {
$this->path = $path;
$this->ruleset = $ruleset;
$this->config = $config;
$this->fixer = new Fixer();
$parts = explode('.', $path);
$extension = array_pop($parts);
if (isset($config->extensions[$extension]) === true) {
$this->tokenizerType = $config->extensions[$extension];
}
else {
// Revert to default.
$this->tokenizerType = 'PHP';
}
$this->configCache['cache'] = $this->config->cache;
$this->configCache['sniffs'] = array_map('strtolower', $this->config->sniffs);
$this->configCache['exclude'] = array_map('strtolower', $this->config->exclude);
$this->configCache['errorSeverity'] = $this->config->errorSeverity;
$this->configCache['warningSeverity'] = $this->config->warningSeverity;
$this->configCache['recordErrors'] = $this->config->recordErrors;
$this->configCache['trackTime'] = $this->config->trackTime;
$this->configCache['ignorePatterns'] = $this->ruleset->ignorePatterns;
$this->configCache['includePatterns'] = $this->ruleset->includePatterns;
}