Skip to content

EchoKey extension: Properly handle getConstantStrings() and getConstantArrays() #160

@IanDelMar

Description

@IanDelMar

I only skimmed through it but saw first element access of array and string arrays. Jfyi in most cases the generic approach is to handle all of them and union the results then 😊

Originally posted by @herndlm in #146 (comment)

Loop through all elements in the list of constant strings/array:

if (count($type->getConstantStrings()) === 0) {
    return []; // no constant strings
}

foreach ($type->getConstantStrings() as $constantString) {
    // do something with each value
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions