final class ModelContext
Public API: explicitly declared with @visibility public.

Shared source metadata and bounded callback evaluation available to extensions.

Passing analysis services to an extensiondoctest
$index = new \SqlCatalog\Core\Php\ProgramIndex();
    $budget = new \SqlCatalog\Core\Analysis\EvaluationBudget();
    $names = new \SqlCatalog\Core\Analysis\Derivation\FreeNames();
    $modified = new \SqlCatalog\Core\Analysis\Derivation\ModifiedNames($names);
    $callbacks = new \SqlCatalog\Core\Analysis\Derivation\Objects\CallbackEffects(new \SqlCatalog\Core\Analysis\Derivation\Slice\BackwardSlicer(new \SqlCatalog\Core\Analysis\Derivation\SourceTree([]), $budget, $names, $modified), new \SqlCatalog\Core\Analysis\Derivation\SliceExecutor(new \SqlCatalog\Core\Php\DeclaredGlobals(), new \SqlCatalog\Core\Php\TypeReader(), $modified, new \SqlCatalog\Core\Php\NodeText(), $budget));
    $modelContext = new \SqlCatalog\Core\Extension\Model\ModelContext($index, $callbacks, 'application');
    $modelContext->dialect // => 'application'

Properties§

public ProgramIndex $index
public CallbackEffects $callbacks
public ?string $dialect = null

Methods§

public function __construct(
    public ProgramIndex $index,
    public CallbackEffects $callbacks,
    public ?string $dialect = null,
)

The services of the current analysis; no application code is executed.

Parameters

$indexProgramIndex
$callbacksCallbackEffects
$dialect?string

Test cases 7§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Type declarations 3