Stackdriver Debugger Client - Class SourceLocation (1.7.0)

Reference documentation and code samples for the Stackdriver Debugger Client class SourceLocation.

Represents a location in the source code.

Example:

use Google\Cloud\Debugger\SourceLocation;

$location = new SourceLocation('/path/to/file.php', 10);

Namespace

Google \ Cloud \ Debugger

Methods

__construct

Instantiate a new SourceLocation

Parameters
NameDescription
path string

Path to the source file within the source context of the target binary.

line int

Line inside the file. The first line in the file has the value 1.

path

Returns the path to the source file.

Example:

echo $location->path();
Returns
TypeDescription
string

line

Returns the line inside the file.

Example:

echo $location->line();
Returns
TypeDescription
int

info

Return a serializable version of this object

Returns
TypeDescription
array

static::fromJson

Load a SourceLocation from JSON form

Example:

$location = SourceLocation::fromJSON([
    'path' => '/path/to/file.php',
    'line' => 10
]);
Parameters
NameDescription
data array

SourceLocation data

↳ path string

Path to the source file within the source context of the target binary.

↳ line int

Line inside the file. The first line in the file has the value 1.