first commit
This commit is contained in:
36
vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php
vendored
Normal file
36
vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
use PHPStan\BetterReflection\Reflection;
|
||||
use ReflectionMethod;
|
||||
|
||||
if (!class_exists(AbstractReflectionMacro::class, false)) {
|
||||
abstract class AbstractReflectionMacro extends AbstractMacro
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getReflection(): ?ReflectionMethod
|
||||
{
|
||||
if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) {
|
||||
return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction);
|
||||
}
|
||||
|
||||
return $this->reflectionFunction instanceof ReflectionMethod
|
||||
? $this->reflectionFunction
|
||||
: null;
|
||||
}
|
||||
}
|
||||
}
|
45
vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php
vendored
Normal file
45
vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
use PHPStan\BetterReflection\Reflection;
|
||||
use ReflectionMethod;
|
||||
|
||||
if (!class_exists(AbstractReflectionMacro::class, false)) {
|
||||
abstract class AbstractReflectionMacro extends AbstractMacro
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getReflection(): ?Reflection\Adapter\ReflectionMethod
|
||||
{
|
||||
if ($this->reflectionFunction instanceof Reflection\Adapter\ReflectionMethod) {
|
||||
return $this->reflectionFunction;
|
||||
}
|
||||
|
||||
if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) {
|
||||
return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction);
|
||||
}
|
||||
|
||||
return $this->reflectionFunction instanceof ReflectionMethod
|
||||
? new Reflection\Adapter\ReflectionMethod(
|
||||
Reflection\ReflectionMethod::createFromName(
|
||||
$this->reflectionFunction->getDeclaringClass()->getName(),
|
||||
$this->reflectionFunction->getName()
|
||||
)
|
||||
)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
}
|
45
vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php
vendored
Normal file
45
vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
if (!class_exists(LazyMacro::class, false)) {
|
||||
abstract class LazyMacro extends AbstractReflectionMacro
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getFileName(): ?string
|
||||
{
|
||||
$file = $this->reflectionFunction->getFileName();
|
||||
|
||||
return (($file ? realpath($file) : null) ?: $file) ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getStartLine(): ?int
|
||||
{
|
||||
return $this->reflectionFunction->getStartLine();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getEndLine(): ?int
|
||||
{
|
||||
return $this->reflectionFunction->getEndLine();
|
||||
}
|
||||
}
|
||||
}
|
51
vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php
vendored
Normal file
51
vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Carbon\PHPStan;
|
||||
|
||||
if (!class_exists(LazyMacro::class, false)) {
|
||||
abstract class LazyMacro extends AbstractReflectionMacro
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
public function getFileName()
|
||||
{
|
||||
$file = $this->reflectionFunction->getFileName();
|
||||
|
||||
return (($file ? realpath($file) : null) ?: $file) ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int|false
|
||||
*/
|
||||
public function getStartLine()
|
||||
{
|
||||
return $this->reflectionFunction->getStartLine();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int|false
|
||||
*/
|
||||
public function getEndLine()
|
||||
{
|
||||
return $this->reflectionFunction->getEndLine();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user