flarum / flarum/issue-archive

Add `prefix` helper method to SettingsRepositoryInterface

Open
#353 10 comments 0 reactions 0 assignees View on GitHub
type/feature
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Just a random syntactical idea. Instead of:

``` php
// constructor
$this->settings = $settings;

// body
$this->settings->get('flarum-auth-facebook.app_id');
$this->settings->get('flarum-auth-facebook.app_secret');
```

We could use:

``` php
// constructor
$this->settings = $settings->withPrefix('flarum-auth-facebook');

// body
$this->settings->get('app_id');
$this->settings->get('app_secret');
```

Also, for extension prefixes, we should probably make the best practice `vendor.package`, i.e. `flarum.auth-facebook` instead of `flarum-auth-facebook`.

Contributor guide

Open the contributing guide

Research direction

Read SettingsRepositoryInterface first and locate its implementations; the issue names no files or tests. Evaluate the proposed withPrefix API and the vendor.package naming convention, then identify the affected tests and confirm the intended prefix behavior before considering the work complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.