vendor/sabberworm/php-css-parser/src/ShortClassNameProvider.php
raw| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Sabberworm\CSS; |
| 6 | |
| 7 | /** |
| 8 | * Provides a method to obtain the short name of the instantiated class (i.e. without namespace prefix). |
| 9 | * |
| 10 | * @internal |
| 11 | */ |
| 12 | trait ShortClassNameProvider |
| 13 | { |
| 14 | /** |
| 15 | * @return non-empty-string |
| 16 | */ |
| 17 | private function getShortClassName(): string |
| 18 | { |
| 19 | return (new \ReflectionClass($this))->getShortName(); |
| 20 | } |
| 21 | } |