Passed
Push — main ( b94a81...f6c2a3 )
by Pranjal
02:29
created

ModelManager::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
/*
3
 * This file is part of the Scrawler package.
4
 *
5
 * (c) Pranjal Pandey <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Scrawler\Arca\Manager;
14
15
use Scrawler\Arca\Model;
16
17
/**
18
 * Class for initializing and managing models.
19
 */
20
class ModelManager
21
{
22
    public function __construct(private \Di\Container $container)
23
    {
24
    }
25
26
    /**
27
     * Create a new model.
28
     */
29
    public function create(string $name): Model
30
    {
31
        return $this->container->make(Model::class, ['name' => $name]);
32
    }
33
}
34