final class Javascript implements Type, JavascriptInterface, Serializable, JsonSerializable (View source)

Class Javascript

Methods

__construct(string $javascript, array|object|null $scope = null)

Construct a new Javascript

static 
__set_state(array $properties)

No description

string
getCode()

Returns the Javascript's code

object|null
getScope()

Returns the Javascript's scope document

string
__toString()

Returns the Javascript's code

string|null
serialize()

Serialize a Javascript

void
unserialize(string $data)

Unserialize a Javascript

mixed
jsonSerialize()

Returns a representation that can be converted to JSON

Details

final __construct(string $javascript, array|object|null $scope = null)

Construct a new Javascript

Parameters

string $javascript
array|object|null $scope

static __set_state(array $properties)

No description

Parameters

array $properties

final string getCode()

Returns the Javascript's code

Return Value

string

final object|null getScope()

Returns the Javascript's scope document

Return Value

object|null

final string __toString()

Returns the Javascript's code

Return Value

string

final string|null serialize()

Since: 1.2.0

Serialize a Javascript

Return Value

string|null

The string representation of the object or null

Exceptions

InvalidArgumentException

final void unserialize(string $data)

Since: 1.2.0

Unserialize a Javascript

Parameters

string $data

The string representation of the object.

Return Value

void

Exceptions

InvalidArgumentException
UnexpectedValueException

final mixed jsonSerialize()

Since: 1.2.0

Returns a representation that can be converted to JSON

Return Value

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

Exceptions

InvalidArgumentException