-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
- I've read the guidelines for Contributing to Roots Projects
- This request isn't a duplicate of an existing issue
- I've read the docs and followed them (if applicable)
- This is not a personal support request that should be posted on the Roots Discourse community
Discussion
Should we encourage Config::get?
Or, should we encourage constant() as single source of truth?
Lines 34 to 42 in 2ae55cc
| public static function get($key) | |
| { | |
| if (!array_key_exists($key, self::$configMap)) { | |
| $class = self::class; | |
| throw new UndefinedConfigKeyException("'$key' has not been defined. Use `$class::define('$key', ...)`."); | |
| } | |
| return self::$configMap[$key]; | |
| } |
Values in Config::$configMap is not guaranteed to be define-d as constants (See: Config::remove and #4).
Therefore, usages of Config::get('SENTRY_DSN') and similar in #3 (comment) is unsafe.
cc @kellymears
Metadata
Metadata
Assignees
Labels
No labels