Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
/**
6
 * This file is part of the Carbon package.
7
 *
8
 * (c) Brian Nesbitt <brian@nesbot.com>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
 
14
namespace Carbon\PHPStan;
15
 
16
use PHPStan\BetterReflection\Reflection;
17
use ReflectionMethod;
18
 
19
if (!class_exists(AbstractReflectionMacro::class, false)) {
20
    abstract class AbstractReflectionMacro extends AbstractMacro
21
    {
22
        /**
23
         * {@inheritdoc}
24
         */
25
        public function getReflection(): ?ReflectionMethod
26
        {
27
            if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) {
28
                return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction);
29
            }
30
 
31
            return $this->reflectionFunction instanceof ReflectionMethod
32
                ? $this->reflectionFunction
33
                : null;
34
        }
35
    }
36
}