classNodeText
final class NodeText
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Renders a node back to source, short enough to quote inside a finding.
Constants§
public const MAX_LENGTH = 60How many characters of rendered source a quoted expression keeps.
Methods§
public function __construct()Builds a renderer over the standard pretty printer.
Calls 1
- new
Standardline 29
public function render(Node $node): stringThe node rendered on one line, truncated with an ellipsis when long.
Parameters
$node | Node |
Returns
stringTest cases 4
Called from 17
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluate() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:106
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateMethod() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:191
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateMethod() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:205
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateMethod() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:219
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateStatic() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:275
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateStatic() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:296
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateFunction() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:317
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateFunction() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:344
- method-call SqlCatalog\Core\Analysis\ConstantReader::readClassConstant() packages/sql-catalog/src/Core/Analysis/ConstantReader.php:104
- method-call SqlCatalog\Core\Analysis\Derivation\SliceExecutor::assign() packages/sql-catalog/src/Core/Analysis/Derivation/SliceExecutor.php:357
- method-call SqlCatalog\Core\Analysis\ExpressionEvaluator::evaluate() packages/sql-catalog/src/Core/Analysis/ExpressionEvaluator.php:87
- method-call SqlCatalog\Core\Analysis\Interpreter::unread() packages/sql-catalog/src/Core/Analysis/Interpreter.php:371
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readElement() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:148
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readElement() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:150
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readProperty() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:197
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readProperty() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:214
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::assignList() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:344
public function asExpr(Node $node): ExprThe node as an expression, falling back to a placeholder for anything else.
Parameters
$node | Node |
Returns
ExprTest cases 1
Called from 1
Calls 1
- new
String_line 53
Private surface 1§
Implementation details, listed for orientation only.
private Standard $printerTest cases 101§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 97
CatalogCommandTestcallsCallEvaluatorTest::testApplyEffectsKeepsKnownByValueArgumentsAndOpensReferencescallsCallEvaluatorTest::testApplySinkHandsBackAHandleNamingThePreparingCallcallsCallEvaluatorTest::testApplySinkHandsBackWhatEachKindOfDatabaseCallHandsBackcallsCallEvaluatorTest::testArgumentsIsCalledWithTheCallItselfcallsCallEvaluatorTest::testCallKeyOfTellsOneCallApartFromEveryOthercallsCallEvaluatorTest::testDispatchReadsTheImplementationsTheSourceDeclarescallsCallEvaluatorTest::testEvaluateAppliesOnlyPossibleCallWritescallsCallEvaluatorTest::testEvaluateFunctionGivesUpOnAFunctionWhoseNameIsNotWrittencallsCallEvaluatorTest::testEvaluateFunctionHandsBackWhatADatabaseCallHandsBackcallsCallEvaluatorTest::testEvaluateFunctionNamesTheExternalInputItReadscallsCallEvaluatorTest::testEvaluateInstantiationNamesTheClassItCreatescallsCallEvaluatorTest::testEvaluateMethodFollowsAMethodDeclaredWithoutABodycallsCallEvaluatorTest::testEvaluateMethodFollowsIntoAClassNoExtensionModelscallsCallEvaluatorTest::testEvaluateMethodFollowsIntoAModelledClassOnlyFromItsOwnBodycallsCallEvaluatorTest::testEvaluateMethodGivesUpOnAMethodWhoseNameIsNotWrittencallsCallEvaluatorTest::testEvaluateOfAFirstClassCallableIsAClosurecallsCallEvaluatorTest::testEvaluateRetainsReferenceWritesForAModeledNamespacedFunctioncallsCallEvaluatorTest::testEvaluateStaticGivesUpWhenTheClassOrTheNameIsNotWrittencallsCallEvaluatorTest::testEvaluateStaticHandsBackWhatADatabaseCallHandsBackcallsCallEvaluatorTest::testEvaluateStaticResolvesTheSelfKeywordsToTheEnclosingClasscallsCallEvaluatorTest::testFollowWithoutReturnsToReadNamesTheCalleecallsCallEvaluatorTest::testFunctionNameUsesRegisteredNamespaceBeforeGlobalFallbackcallsCallEvaluatorTest::testInvalidateEscapesOpensAliasedObjectStatecallsCallEvaluatorTest::testIsOwnReceiverTellsACallOnItselfApartFromOneOnSomethingElsecallsCallEvaluatorTest::testSiteKeyOfNamesTheCallAndTheDatabaseCallcallsCallEvaluatorTest::testTheCallMethodsAreReachedDirectlycallsConstantReaderTest::testConstantNamePrefersTheOneTheNamespaceDeclarescallsConstantReaderTest::testConstantNameReadsTheNamespacedConstantOnlyWhenTheNamespaceDeclaresItcallsConstantReaderTest::testReadClassConstantGivesUpOnAConstantNothingDeclarescallsConstantReaderTest::testReadClassConstantGivesUpWhenTheClassIsNotWrittencallsConstantReaderTest::testReadClassConstantQuotesWhatItCouldNotReadcallsConstantReaderTest::testReadClassConstantReadsTheClassKeywordWhateverItsCasecallsConstantReaderTest::testReadClassConstantReadsWhatTheClassDeclarescallsConstantReaderTest::testReadClassConstantTellsAnEnumCaseFromAConstantOfTheEnumcallsConstantReaderTest::testReadConstantReadsTheKeywordsWhateverTheirCasecallsConstantReaderTest::testReadConstantResolvesTheKeywordsAndTheDeclarationscallsConstantReaderTest::testReadRuntimeConstantOnlyTrustsThePhpConstantscallsConstantReaderTest::testReadRuntimeConstantReadsAFullyQualifiedNamecallsConstantReaderTest::testResolveClassNameResolvesEveryKeywordForTheEnclosingClasscallsConstantReaderTest::testResolveClassNameResolvesTheSelfKeywordscallsCalleeReturnsTestcallsCallersTestcallsDeriverTestcallsEntryBinderTestcallsCallbackEffectsTestcallsPropertyWritesTestcallsSliceExecutorTestcallsExpressionEvaluatorTestcallsRegistryTestcallsInterpreterTestcallsModelQueriesTestcallsReferenceEvaluatorTest::testAssignElementIgnoresATargetItCannotNamecallsReferenceEvaluatorTest::testAssignElementKeepsWhetherTheArrayIsKnownInFullcallsReferenceEvaluatorTest::testAssignElementMarksTheArrayANestedWriteGoesIntoAsIncompletecallsReferenceEvaluatorTest::testAssignLeavesATargetItDoesNotTrackAlonecallsReferenceEvaluatorTest::testAssignListDescendsIntoANestedListcallsReferenceEvaluatorTest::testAssignListLeavesAGapCarryingTheOriginOfAValueThatIsNotAKnownArraycallsReferenceEvaluatorTest::testAssignListLeavesAGapForAnElementTheArrayDoesNotHoldcallsReferenceEvaluatorTest::testAssignListReadsAKeyedTargetByItsKeycallsReferenceEvaluatorTest::testAssignListWritesEachElementIntoTheTargetAtItsPositioncallsReferenceEvaluatorTest::testEvaluateOnlyAnswersForReferencescallsReferenceEvaluatorTest::testEvaluateReadsAnInstantiationAStaticPropertyAndAClosurecallsReferenceEvaluatorTest::testLoseTrackLeavesAnythingThatIsNotATrackedArrayAlonecallsReferenceEvaluatorTest::testLoseTrackMarksAnArrayHeldByAPropertyOfThisAsIncompletecallsReferenceEvaluatorTest::testLoseTrackMarksTheArrayANestedWriteGoesIntoAsIncompletecallsReferenceEvaluatorTest::testOriginOfIsTheOriginOfTheFirstGapUnlessAnyGapIsExternalInputcallsReferenceEvaluatorTest::testOriginOfReportsExternalInputWhenAnyTermCarriesItcallsReferenceEvaluatorTest::testReadArrayIsCalledWithTheExpressionItselfcallsReferenceEvaluatorTest::testReadArrayKeepsTheElementsWrittenAfterAnUnpackingcallsReferenceEvaluatorTest::testReadArrayKnowsALiteralWithoutUnpackingInFullcallsReferenceEvaluatorTest::testReadElementIsCalledWithTheExpressionItselfcallsReferenceEvaluatorTest::testReadEnumPropertyIgnoresAClassTheSourceDoesNotDeclarecallsReferenceEvaluatorTest::testReadEnumPropertyOnlyAnswersForAnEnumcallsReferenceEvaluatorTest::testReadEnumPropertyReadsTheCaseTheValueIscallsReferenceEvaluatorTest::testReadInstanceGivesUpOnAnExpressionClasscallsReferenceEvaluatorTest::testReadInstanceResolvesStaticToTheEnclosingClasscallsReferenceEvaluatorTest::testReadPropertyIsCalledWithTheExpressionItselfcallsReferenceEvaluatorTest::testReadPropertyPrefersWhatTheBodyAssignedEarliercallsReferenceEvaluatorTest::testReadPropertyQuotesAPropertyItCannotNamecallsReferenceEvaluatorTest::testReadPropertyQuotesAStaticPropertyWhoseClassItCannotNamecallsReferenceEvaluatorTest::testReadVariableGivesUpOnAVariableVariablecallsReferenceEvaluatorTest::testReadVariableNamesTheExternalInputItReadscallsReferenceEvaluatorTest::testReadVariablePreservesProvenanceAndDomainFlagsWhileNamingOpaqueValuescallsReferenceEvaluatorTest::testReadVariableResolvesThisToTheEnclosingClasscallsReferenceEvaluatorTest::testTrackedNameNamesAVariableOrAPropertyOfThiscallsCallContextTestcallsModelContextTest::testKeepsTheModelContractInputscallsQueryModelInterfaceTestcallsBuilderCallsTestcallsBuilderQueriesTest::testInputsUsesTheReceiverOrModelFactoryBeforeTheArgumentscallsCallbackModelTestcallsCallModelTestcallsLaravelExtensionTest::testModelsRegistersLaravelSemanticsThroughTheOptionalContractcallsAnalyzerTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 2
Method calls 17
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluate() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:106
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateMethod() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:191
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateMethod() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:205
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateMethod() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:219
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateStatic() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:275
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateStatic() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:296
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateFunction() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:317
- method-call SqlCatalog\Core\Analysis\CallEvaluator::evaluateFunction() packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:344
- method-call SqlCatalog\Core\Analysis\ConstantReader::readClassConstant() packages/sql-catalog/src/Core/Analysis/ConstantReader.php:104
- method-call SqlCatalog\Core\Analysis\Derivation\SliceExecutor::assign() packages/sql-catalog/src/Core/Analysis/Derivation/SliceExecutor.php:357
- method-call SqlCatalog\Core\Analysis\ExpressionEvaluator::evaluate() packages/sql-catalog/src/Core/Analysis/ExpressionEvaluator.php:87
- method-call SqlCatalog\Core\Analysis\Interpreter::unread() packages/sql-catalog/src/Core/Analysis/Interpreter.php:371
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readElement() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:148
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readElement() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:150
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readProperty() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:197
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::readProperty() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:214
- method-call SqlCatalog\Core\Analysis\ReferenceEvaluator::assignList() packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:344
Type declarations 11
- type SqlCatalog\Core\Analysis\CallEvaluator packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:47
- type SqlCatalog\Core\Analysis\CallEvaluator packages/sql-catalog/src/Core/Analysis/CallEvaluator.php:61
- type SqlCatalog\Core\Analysis\ConstantReader packages/sql-catalog/src/Core/Analysis/ConstantReader.php:30
- type SqlCatalog\Core\Analysis\ConstantReader packages/sql-catalog/src/Core/Analysis/ConstantReader.php:35
- type SqlCatalog\Core\Analysis\Derivation\SliceExecutor packages/sql-catalog/src/Core/Analysis/Derivation/SliceExecutor.php:62
- type SqlCatalog\Core\Analysis\Derivation\SliceExecutor packages/sql-catalog/src/Core/Analysis/Derivation/SliceExecutor.php:73
- type SqlCatalog\Core\Analysis\ExpressionEvaluator packages/sql-catalog/src/Core/Analysis/ExpressionEvaluator.php:31
- type SqlCatalog\Core\Analysis\ExpressionEvaluator packages/sql-catalog/src/Core/Analysis/ExpressionEvaluator.php:42
- type SqlCatalog\Core\Analysis\Interpreter packages/sql-catalog/src/Core/Analysis/Interpreter.php:69
- type SqlCatalog\Core\Analysis\ReferenceEvaluator packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:31
- type SqlCatalog\Core\Analysis\ReferenceEvaluator packages/sql-catalog/src/Core/Analysis/ReferenceEvaluator.php:40