Completed
Push — external_storage_registry ( 06bed8 )
by
unknown
17:52
created

getExternalStorageHandlers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * File containing the ExternalStorageRegistryFactory class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Base\Container\ApiLoader\Storage;
10
11
class ExternalStorageRegistry
12
{
13
    /**
14
     * Collection of external storage handlers for field types that need them.
15
     *
16
     * @var \eZ\Publish\SPI\FieldType\FieldStorage[]
17
     */
18
    protected $externalStorages;
19
20
    /**
21
     * @param \eZ\Publish\SPI\FieldType\FieldStorage[] $externalStorages
22
     */
23
    public function __construct(array $externalStorages)
24
    {
25
        $this->externalStorages = $externalStorages;
26
    }
27
28
    public function registerExternalStorageHandler(string $identifier, $externalStorage): void
29
    {
30
        $this->externalStorages[$identifier] = $externalStorage;
31
    }
32
33
    /**
34
     * @return \eZ\Publish\SPI\FieldType\FieldStorage[]
35
     */
36
    public function getExternalStorageHandlers(): array
37
    {
38
        return $this->externalStorages;
39
    }
40
}
41