PluginProbe
Packeta / 2.0.9
Packeta v2.0.9
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / deps / nette / php-generator / src / PhpGenerator / TraitUse.php

TraitUse.php in Packeta 2.0.9, at deps/nette/php-generator/src/PhpGenerator/TraitUse.php

38 lines 935 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * This file is part of the Nette Framework (https://nette.org)
5 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6 */
7 declare (strict_types=1);
8 namespace Packetery\Nette\PhpGenerator;
9
10 use Packetery\Nette;
11 /**
12 * use Trait
13 */
14 final class TraitUse
15 {
16 use \Packetery\Nette\SmartObject;
17 use Traits\NameAware;
18 use Traits\CommentAware;
19 /** @var array */
20 private $resolutions = [];
21 public function __construct(string $name)
22 {
23 if (!Nette\PhpGenerator\Helpers::isNamespaceIdentifier($name, \true)) {
24 throw new \Packetery\Nette\InvalidArgumentException("Value '{$name}' is not valid trait name.");
25 }
26 $this->name = $name;
27 }
28 public function addResolution(string $resolution) : self
29 {
30 $this->resolutions[] = $resolution;
31 return $this;
32 }
33 public function getResolutions() : array
34 {
35 return $this->resolutions;
36 }
37 }
38