Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CacheManager::remove() throws a TypeError for a string path

Closed Beginner friendly
#403 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #406 by @silverbackdan — merged
  • #409 by @silverbackdan — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, symfony
Domain
backend

Research direction

Start in the Silverback\ApiComponentsBundle\Imagine\CacheManager class, at its remove() method, and at the ImagineRemoveEvent constructor it calls, which the issue says requires ?array. Compare remove()'s parameter type with liip's CacheManager::remove() signature. Done when a single string path is accepted and normalised to an array before the event is built, and a test covering remove() with a string path passes.

Written by the indexing model from the issue text.

Description

Found while working on components-web-app#143. Silverback\ApiComponentsBundle\Imagine\CacheManager::remove() passes its $paths to ImagineRemoveEvent, which requires ?array. liip's CacheManager::remove() signature allows string|array|null, so remove('path/to/file.jpg') (a single path, as liip's own callers and docs use it) throws a TypeError. Fix: normalise a string to [$path] before building the event.

Dominant language
PHP
Stars
32
Forks
8
Avg merge
40m
Merged PRs (30d)
129

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from components-web-app/api-components-bundle

All issues in components-web-app/api-components-bundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.