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

Pass a custom variable to flush()

Open
#358 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

Start by reading the flush() entry point and how each $report is constructed. Determine whether the API can carry a caller-supplied UserID through the loop, then define and verify a supported usage pattern that makes the custom value available alongside each report.

Written by the indexing model from the issue text.

Description

We are using the following simple code to flush the Queue:

foreach( $webPush->flush() as $report ){ .... }

The problem is, we need our own variables (the UserID) inside the loop. Is there a way to pass custom variables into the loop? Maybe so that it is available in $report

Dominant language
PHP
Stars
1.9k
Forks
312
Avg merge
1d 15h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

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 web-push-libs/web-push-php

All issues in web-push-libs/web-push-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.