\DephpugFilePrinter

Class that receive a filename and line to show part of file in debugger with limits and format

Summary

Methods
Properties
Constants
setFilename()
setFile()
setOffset()
getRangePagination()
listLines()
numberOfLines()
showFile()
colorCode()
$file
$filename
$line
$lineToRange
$offset
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$reservedWords
$consts
N/A

Properties

$file

$file : 

Array with lines in a file

Type

$filename

$filename : 

Filename of $file (optional)

Type

$line

$line : 

Current line of a file to indicate the arrow

Type

$lineToRange

$lineToRange : 

Line to show in print

Type

$offset

$offset : 

Number of lines to show above and bellow $lineToRange

Type

$reservedWords

$reservedWords : 

Reserved words in php to color

Type

$consts

$consts : 

Consts reserved to color print

Type

Methods

setFilename()

setFilename(string  $filename) : void

Set filename and instantiate the attribute $file with lines as array

Parameters

string $filename
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

setFile()

setFile(array  $file) : void

Set direct file as array of lines

Parameters

array $file
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

setOffset()

setOffset(integer  $offset) 

Set attribute offset

Parameters

integer $offset
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

getRangePagination()

getRangePagination(integer  $line = 1) : array

Get the pagination range considering $offset to get lines above and bellow

Parameters

integer $line
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

array —

with indexes of pages, not lines

listLines()

listLines(integer  $line = 1) : string

List lines around a setted line in file

Parameters

integer $line
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string —

Indicates lines of a file

numberOfLines()

numberOfLines() : integer

Number of lines in the file

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

integer —

Indicates the number of the lines in the file setted

showFile()

showFile() : string

Show file with full informations

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string

colorCode()

colorCode(string  $content) : string

Color code received to appear like an IDE changing reserved words in PHP to different colors

Parameters

string $content

Indicates a php code

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///src/phpDocumentor.phar/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1293

Returns

string