Search in sources :

Example 1 with TickHandler

use of php.runtime.env.handler.TickHandler in project jphp by jphp-compiler.

the class Environment method __tick.

/**
 *** UTILS ****
 */
public void __tick(TraceInfo trace, ArrayMemory locals) {
    TickHandler tickHandler = scope.getTickHandler();
    if (tickHandler != null) {
        IObject $this = this.getLateObject();
        if ($this != null) {
            Memory value = ObjectMemory.valueOf($this);
            if ($this instanceof Closure) {
                value = ((Closure) $this).getSelf();
            }
            if (value.isObject()) {
                locals.putAsKeyString("this", value);
            }
        }
        tickHandler.onTick(this, trace, locals);
    }
}
Also used : IObject(php.runtime.lang.IObject) Closure(php.runtime.lang.Closure) ReferenceMemory(php.runtime.memory.ReferenceMemory) ObjectMemory(php.runtime.memory.ObjectMemory) StringMemory(php.runtime.memory.StringMemory) ArrayMemory(php.runtime.memory.ArrayMemory) Memory(php.runtime.Memory) TickHandler(php.runtime.env.handler.TickHandler)

Aggregations

Memory (php.runtime.Memory)1 TickHandler (php.runtime.env.handler.TickHandler)1 Closure (php.runtime.lang.Closure)1 IObject (php.runtime.lang.IObject)1 ArrayMemory (php.runtime.memory.ArrayMemory)1 ObjectMemory (php.runtime.memory.ObjectMemory)1 ReferenceMemory (php.runtime.memory.ReferenceMemory)1 StringMemory (php.runtime.memory.StringMemory)1