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

Class: LocalFile

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

Class Overview

File
   |
   --LocalFile

A local file represents a chunk of text has 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 16]
A local file represents a chunk of text has a file system location.


[ Top ]


Method Detail

__construct (Constructor)   [line 29]

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

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

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

Parameters:

string   $path   —  The absolute path to the file.
\PHP_CodeSniffer\Ruleset   $ruleset   —  The ruleset used for the run.
\PHP_CodeSniffer\Config   $config   —  The config data for the run.

[ Top ]

process   [line 82]

void process( )

Processes the file.
  • Access: public

Overrides File::process() (Starts the stack traversal and tells listeners when tokens are found.)
[ Top ]

reloadContent   [line 70]

void reloadContent( )

Loads the latest version of the file's content from the file system.

Overrides File::reloadContent() (Reloads the content of the file.)
[ Top ]


Documentation generated on Mon, 16 Oct 2017 23:00:34 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.