Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace League\Flysystem;
6
 
7
use function array_merge;
8
 
9
class Config
10
{
11
    public const OPTION_VISIBILITY = 'visibility';
12
    public const OPTION_DIRECTORY_VISIBILITY = 'directory_visibility';
13
 
14
    public function __construct(private array $options = [])
15
    {
16
    }
17
 
18
    /**
19
     * @param mixed $default
20
     *
21
     * @return mixed
22
     */
23
    public function get(string $property, $default = null)
24
    {
25
        return $this->options[$property] ?? $default;
26
    }
27
 
28
    public function extend(array $options): Config
29
    {
30
        return new Config(array_merge($this->options, $options));
31
    }
32
 
33
    public function withDefaults(array $defaults): Config
34
    {
35
        return new Config($this->options + $defaults);
36
    }
37
}