Skip to content

Commit

Permalink
feat: port script engine resolver interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vicvolk committed Aug 10, 2022
1 parent ee71dcf commit f4b994a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":1,"defects":{"Tests\\JuelEngineTest::testEngine":4,"Tests\\JuelEngineTest::testEngineManager":5,"Tests\\JuelEngineTest::testEngineFactory":4,"Tests\\JuelEngineTest::testJuelEngineManager":4,"Tests\\ExpressionLanguageTest::testNumericMethods":4,"Tests\\ExpressionLanguageTest::testMethodInvocation":4,"Tests\\JuelEngineTest::testJuelEngineManagerWithFunction":4,"Tests\\LuaEngineTest::testLuaScript":5},"times":{"Tests\\JuelEngineTest::testEngine":0.003,"Tests\\JuelEngineTest::testEngineFactory":0.006,"Tests\\JuelEngineTest::testEngineManager":0.003,"Tests\\JuelEngineTest::testJuelEngineManager":0.001,"Tests\\ExpressionLanguageTest::testNumericVariables":0.006,"Tests\\ExpressionLanguageTest::testNumericMethods":0,"Tests\\ExpressionLanguageTest::testBooleanMethods":0,"Tests\\ExpressionLanguageTest::testMethodInvocation":0.001,"Tests\\ExpressionLanguageTest::testExpressionString":0,"Tests\\ExpressionLanguageTest::testIsDeferred":0,"Tests\\ExpressionLanguageTest::testGetExpectedType":0,"Tests\\ExpressionLanguageTest::testGetType":0,"Tests\\JuelEngineTest::testJuelEngineManagerWithVariable":0.001,"Tests\\JuelEngineTest::testJuelEngineManagerWithFunction":0.001,"Tests\\LuaEngineTest::testLuaScript":0.001}}
{"version":1,"defects":{"Tests\\JuelEngineTest::testEngine":4,"Tests\\JuelEngineTest::testEngineManager":5,"Tests\\JuelEngineTest::testEngineFactory":4,"Tests\\JuelEngineTest::testJuelEngineManager":4,"Tests\\ExpressionLanguageTest::testNumericMethods":4,"Tests\\ExpressionLanguageTest::testMethodInvocation":4,"Tests\\JuelEngineTest::testJuelEngineManagerWithFunction":4,"Tests\\LuaEngineTest::testLuaScript":5},"times":{"Tests\\JuelEngineTest::testEngine":0.003,"Tests\\JuelEngineTest::testEngineFactory":0.006,"Tests\\JuelEngineTest::testEngineManager":0.003,"Tests\\JuelEngineTest::testJuelEngineManager":0.001,"Tests\\ExpressionLanguageTest::testNumericVariables":0.006,"Tests\\ExpressionLanguageTest::testNumericMethods":0,"Tests\\ExpressionLanguageTest::testBooleanMethods":0,"Tests\\ExpressionLanguageTest::testMethodInvocation":0.001,"Tests\\ExpressionLanguageTest::testExpressionString":0,"Tests\\ExpressionLanguageTest::testIsDeferred":0,"Tests\\ExpressionLanguageTest::testGetExpectedType":0,"Tests\\ExpressionLanguageTest::testGetType":0,"Tests\\JuelEngineTest::testJuelEngineManagerWithVariable":0.001,"Tests\\JuelEngineTest::testJuelEngineManagerWithFunction":0.001,"Tests\\LuaEngineTest::testLuaScript":0}}
15 changes: 15 additions & 0 deletions src/ScriptEngineResolverInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Script;

interface ScriptEngineResolverInterface
{
public function addScriptEngineFactory(ScriptEngineFactoryInterface $scriptEngineFactory): void;

public function getScriptEngineManager(): ScriptEngineManager;

/**
* Returns a cached script engine or creates a new script engine if no such engine is currently cached.
*/
public function getScriptEngine(string $language, bool $resolveFromCache = false): ?ScriptEngineInterface;
}

0 comments on commit f4b994a

Please sign in to comment.