Skip to content

Async cache wrong callback example #20874

Open
@torchello

Description

@torchello

Hey! Seems like an example of a callback in async cache section is incorrect:

$cachedValue = $asyncCache->get('my_value', [CacheComputation::class, 'compute'])

It's not a valid callback as the compute method is not static in the example:

class CacheComputation
{
    public function compute(ItemInterface $item): string
    {
        ...
    }
}

Am I missing something or we should adjust the docs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions