BundleNamespace.php 579 Bytes
Newer Older
1
<?php declare(strict_types=1);
2
/*
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
3
4
 * Copyright (C) 2016-2017 IRSTEA
 * All rights reserved.
5
6
7
8
9
 */

namespace Irstea\PlantUmlBundle\Model\Namespace_;

/**
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
10
 * Description of BundleNamespace.
11
12
13
 */
class BundleNamespace extends MappedNamespace
{
14
15
    public const CONF_TYPE = 'bundles';
    public const SEPARATOR = '::';
16
17
18
19

    public function __construct(array $bundles)
    {
        $mapping = [];
Guillaume Perréal's avatar
CS.    
Guillaume Perréal committed
20
21
        foreach ($bundles as $bundle => $php) {
            $mapping[substr($php, 0, 1 + strrpos($php, '\\'))] = $bundle . '::';
22
23
24
25
26
        }

        parent::__construct($mapping);
    }
}