apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: DummyFile

Source Location: /PHP_CodeSniffer-3.1.1/src/Files/DummyFile.php

Class Overview

File
   |
   --DummyFile

A dummy file represents a chunk of text that does not have a file system location.


Author(s):

Copyright:

  • 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600)

Methods


Inherited Variables

Inherited Methods

Class: File

File::__construct()
Constructs a file.
File::addError()
Records an error against a specific token in the file.
File::addErrorOnLine()
Records an error against a specific line in the file.
File::addFixableError()
Records a fixable error against a specific token in the file.
File::addFixableWarning()
Records a fixable warning against a specific token in the file.
File::addMessage()
Adds an error to the error stack.
File::addWarning()
Records a warning against a specific token in the file.
File::addWarningOnLine()
Records a warning against a specific token in the file.
File::cleanUp()
Remove vars stored in this file that are no longer required.
File::disableCaching()
Disables caching of this file.
File::findEndOfStatement()
Returns the position of the last non-whitespace token in a statement.
File::findExtendedClassName()
Returns the name of the class that the specified class extends.
File::findFirstOnLine()
Returns the position of the first token on a line, matching given type.
File::findImplementedInterfaceNames()
Returns the names of the interfaces that the specified class implements.
File::findNext()
Returns the position of the next specified token(s).
File::findPrevious()
Returns the position of the previous specified token(s).
File::findStartOfStatement()
Returns the position of the first non-whitespace token in a statement.
File::getClassProperties()
Returns the visibility and implementation properties of a class.
File::getCondition()
Return the position of the condition for the passed token.
File::getDeclarationName()
Returns the declaration names for classes, interfaces, traits, and functions.
File::getErrorCount()
Returns the number of errors raised.
File::getErrors()
Returns the errors raised from processing this file.
File::getFilename()
Returns the absolute filename of this file.
File::getFixableCount()
Returns the number of fixable errors/warnings raised.
File::getFixedCount()
Returns the number of fixed errors/warnings.
File::getIgnoredLines()
Returns the list of ignored lines.
File::getMemberProperties()
Returns the visibility and implementation properties of the class member variable found at the specified position in the stack.
File::getMethodParameters()
Returns the method parameters for the specified function token.
File::getMethodProperties()
Returns the visibility and implementation properties of a method.
File::getMetrics()
Returns the metrics found while processing this file.
File::getSuccessCount()
Returns the number of successes recorded.
File::getTokens()
Returns the token stack for this file.
File::getTokensAsString()
Returns the content of the tokens from the specified start position in the token stack for the specified length.
File::getWarningCount()
Returns the number of warnings raised.
File::getWarnings()
Returns the warnings raised from processing this file.
File::hasCondition()
Determine if the passed token has a condition of one of the passed types.
File::isReference()
Determine if the passed token is a reference operator.
File::parse()
Tokenizes the file and prepares it for the test run.
File::process()
Starts the stack traversal and tells listeners when tokens are found.
File::recordMetric()
Adds an warning to the warning stack.
File::reloadContent()
Reloads the content of the file.
File::setContent()
Set the content of the file.

Class Details

[line 20]
A dummy file represents a chunk of text that does not have a file system location.

Dummy files can also represent a changed (but not saved) version of a file and so can have a file path either set manually, or set by putting phpcs_input_file: /path/to/file as the first line of the file contents.



[ Top ]


Method Detail

__construct (Constructor)   [line 33]

void __construct( string $content, Ruleset $ruleset, Config $config)

Creates a DummyFile object and sets the content.
  • Access: public

Overrides File::__construct() (Constructs a file.)

Parameters:

string   $content   —  The content of the file.
\PHP_CodeSniffer\Ruleset   $ruleset   —  The ruleset used for the run.
\PHP_CodeSniffer\Config   $config   —  The config data for the run.

[ Top ]

setErrorCounts   [line 72]

void setErrorCounts( int $errorCount, int $warningCount, int $fixableCount, int $fixedCount)

Set the error, warning, and fixable counts for the file.
  • Access: public

Parameters:

int   $errorCount   —  The number of errors found.
int   $warningCount   —  The number of warnings found.
int   $fixableCount   —  The number of fixable errors found.
int   $fixedCount   —  The number of errors that were fixed.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:27:24 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.