AbstractMacroBuiltin.php 717 B

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