Skip to content

Commit 13a72ac

Browse files
committed
docs: add doc comments
1 parent 60b368b commit 13a72ac

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

system/Config/Factories.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class Factories
6565
* A multi-dimensional array with components as
6666
* keys to the array of name-indexed instances.
6767
*
68+
* [component => [FQCN => instance]]
69+
*
6870
* @var array<string, array<string, object>>
6971
* @phpstan-var array<string, array<class-string, object>>
7072
*/
@@ -118,6 +120,8 @@ public static function __callStatic(string $component, array $arguments)
118120

119121
/**
120122
* Is the component Config?
123+
*
124+
* @param string $component Lowercase, plural component name
121125
*/
122126
private static function isConfig(string $component): bool
123127
{
@@ -231,6 +235,8 @@ protected static function verifyInstanceOf(array $options, string $name): bool
231235
* @param string $component Lowercase, plural component name
232236
*
233237
* @return array<string, bool|string|null>
238+
*
239+
* @internal For testing only
234240
*/
235241
public static function getOptions(string $component): array
236242
{
@@ -247,13 +253,16 @@ public static function getOptions(string $component): array
247253
// Load values from the best Factory configuration (will include Registrars)
248254
: config(Factory::class)->{$component} ?? [];
249255

256+
// The setOptions() reset the component. So getOptions() may reset
257+
// the component.
250258
return self::setOptions($component, $values);
251259
}
252260

253261
/**
254262
* Normalizes, stores, and returns the configuration for a specific component
255263
*
256264
* @param string $component Lowercase, plural component name
265+
* @param array $values option values
257266
*
258267
* @return array<string, bool|string|null> The result after applying defaults and normalization
259268
*/
@@ -305,6 +314,8 @@ public static function reset(?string $component = null)
305314
*
306315
* @param string $component Lowercase, plural component name
307316
* @param string $name The name of the instance
317+
*
318+
* @internal For testing only
308319
*/
309320
public static function injectMock(string $component, string $name, object $instance)
310321
{
@@ -321,6 +332,8 @@ public static function injectMock(string $component, string $name, object $insta
321332

322333
/**
323334
* Gets a basename from a class name, namespaced or not.
335+
*
336+
* @internal For testing only
324337
*/
325338
public static function getBasename(string $name): string
326339
{

0 commit comments

Comments
 (0)