nextcloud / nextcloud/server

Add functional helpers

Open
#11,911 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement technical debt
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

In some places more functional programming would make sense. See https://medium.com/ifixit-engineering/functional-programming-with-php-generators-837a6c91b0e3 for example.

The library https://github.com/nikic/iter already does a nice job at wrapping most of it.

Of course we should only use it when it makes sense. But we seem to already use use array_map, array_filter etc in a lot of places. So it might make sense to try to move some things to generators.

CC: @ChristophWurst @MorrisJobke @juliushaertl @icewind1991 for some brainstorming

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.

Research direction

Start by reading the linked article and reviewing the existing array_map and array_filter usage mentioned in the issue, along with the nikic/iter library. The issue does not identify files, entry points, tests, or a concrete target; completion would require an agreed scope for which code should use generators and how to validate it.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.