Import return annotations from vendors
This commit is contained in:
parent
10fc13e4a7
commit
aa338c8b42
@ -39,6 +39,8 @@ class ContainerAwareEventManager extends EventManager
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function dispatchEvent($eventName, EventArgs $eventArgs = null)
|
||||
{
|
||||
@ -59,6 +61,8 @@ class ContainerAwareEventManager extends EventManager
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return object[][]
|
||||
*/
|
||||
public function getListeners($event = null)
|
||||
{
|
||||
@ -81,6 +85,8 @@ class ContainerAwareEventManager extends EventManager
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasListeners($event)
|
||||
{
|
||||
@ -89,6 +95,8 @@ class ContainerAwareEventManager extends EventManager
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addEventListener($events, $listener)
|
||||
{
|
||||
@ -109,6 +117,8 @@ class ContainerAwareEventManager extends EventManager
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeEventListener($events, $listener)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class DbalLogger implements SQLLogger
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function startQuery($sql, array $params = null, array $types = null)
|
||||
{
|
||||
@ -48,6 +50,8 @@ class DbalLogger implements SQLLogger
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function stopQuery()
|
||||
{
|
||||
|
@ -29,6 +29,8 @@ abstract class ManagerRegistry extends AbstractManagerRegistry
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
protected function getService($name)
|
||||
{
|
||||
@ -37,6 +39,8 @@ abstract class ManagerRegistry extends AbstractManagerRegistry
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function resetService($name)
|
||||
{
|
||||
|
@ -28,6 +28,8 @@ final class TestRepositoryFactory implements RepositoryFactory
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return ObjectRepository
|
||||
*/
|
||||
public function getRepository(EntityManagerInterface $entityManager, $entityName)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class StringWrapperType extends StringType
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -27,6 +27,8 @@ class DoctrineFooType extends Type
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@ -35,6 +37,8 @@ class DoctrineFooType extends Type
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||
{
|
||||
@ -76,6 +80,8 @@ class DoctrineFooType extends Type
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform)
|
||||
{
|
||||
|
@ -72,6 +72,8 @@ class ChromePhpHandler extends BaseChromePhpHandler
|
||||
|
||||
/**
|
||||
* Override default behavior since we check it in onKernelResponse.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function headersAccepted()
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace Symfony\Bridge\Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\Handler\AbstractProcessingHandler;
|
||||
use Monolog\Logger;
|
||||
@ -73,6 +74,8 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isHandling(array $record)
|
||||
{
|
||||
@ -81,6 +84,8 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handle(array $record)
|
||||
{
|
||||
@ -142,6 +147,8 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
@ -151,6 +158,8 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return FormatterInterface
|
||||
*/
|
||||
protected function getDefaultFormatter()
|
||||
{
|
||||
|
@ -45,6 +45,9 @@ class HttpCodeActivationStrategy extends ErrorLevelActivationStrategy
|
||||
$this->exclusions = $exclusions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isHandlerActivated(array $record)
|
||||
{
|
||||
$isActivated = parent::isHandlerActivated($record);
|
||||
|
@ -34,6 +34,9 @@ class NotFoundActivationStrategy extends ErrorLevelActivationStrategy
|
||||
$this->blacklist = '{('.implode('|', $excludedUrls).')}i';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isHandlerActivated(array $record)
|
||||
{
|
||||
$isActivated = parent::isHandlerActivated($record);
|
||||
|
@ -74,6 +74,8 @@ class FirePHPHandler extends BaseFirePHPHandler
|
||||
|
||||
/**
|
||||
* Override default behavior since we check the user agent in onKernelResponse.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function headersAccepted()
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace Symfony\Bridge\Monolog\Handler;
|
||||
|
||||
use Monolog\Formatter\FormatterInterface;
|
||||
use Monolog\Handler\AbstractHandler;
|
||||
use Monolog\Logger;
|
||||
use Symfony\Bridge\Monolog\Formatter\VarDumperFormatter;
|
||||
@ -38,6 +39,8 @@ class ServerLogHandler extends AbstractHandler
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function handle(array $record)
|
||||
{
|
||||
@ -77,6 +80,8 @@ class ServerLogHandler extends AbstractHandler
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return FormatterInterface
|
||||
*/
|
||||
protected function getDefaultFormatter()
|
||||
{
|
||||
|
@ -29,6 +29,8 @@ class LazyLoadingValueHolderGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator)
|
||||
{
|
||||
|
@ -31,6 +31,8 @@ class AssetExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -40,6 +40,8 @@ class CodeExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
|
@ -17,6 +17,7 @@ use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
use Twig\Environment;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\Template;
|
||||
use Twig\TokenParser\TokenParserInterface;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,9 @@ class DumpExtension extends AbstractExtension
|
||||
$this->dumper = $dumper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
@ -42,6 +46,9 @@ class DumpExtension extends AbstractExtension
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TokenParserInterface[]
|
||||
*/
|
||||
public function getTokenParsers()
|
||||
{
|
||||
return [new DumpTokenParser()];
|
||||
|
@ -24,6 +24,8 @@ class ExpressionExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ use Symfony\Bridge\Twig\TokenParser\FormThemeTokenParser;
|
||||
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TokenParser\TokenParserInterface;
|
||||
use Twig\TwigFilter;
|
||||
use Twig\TwigFunction;
|
||||
use Twig\TwigTest;
|
||||
@ -29,6 +30,8 @@ class FormExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TokenParserInterface[]
|
||||
*/
|
||||
public function getTokenParsers()
|
||||
{
|
||||
@ -40,6 +43,8 @@ class FormExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
@ -60,6 +65,8 @@ class FormExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
@ -71,6 +78,8 @@ class FormExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigTest[]
|
||||
*/
|
||||
public function getTests()
|
||||
{
|
||||
|
@ -57,6 +57,8 @@ class HttpFoundationExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -22,6 +22,9 @@ use Twig\TwigFunction;
|
||||
*/
|
||||
class HttpKernelExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
|
@ -31,6 +31,8 @@ class LogoutUrlExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class RoutingExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -50,6 +50,8 @@ class SecurityExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ namespace Symfony\Bridge\Twig\Extension;
|
||||
use Symfony\Bridge\Twig\TokenParser\StopwatchTokenParser;
|
||||
use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TokenParser\TokenParserInterface;
|
||||
|
||||
/**
|
||||
* Twig extension for the stopwatch helper.
|
||||
@ -36,6 +37,9 @@ class StopwatchExtension extends AbstractExtension
|
||||
return $this->stopwatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TokenParserInterface[]
|
||||
*/
|
||||
public function getTokenParsers()
|
||||
{
|
||||
return [
|
||||
|
@ -68,6 +68,8 @@ class TranslationExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
@ -100,6 +102,8 @@ class TranslationExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return NodeVisitorInterface[]
|
||||
*/
|
||||
public function getNodeVisitors()
|
||||
{
|
||||
|
@ -33,6 +33,8 @@ class WebLinkExtension extends AbstractExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -31,6 +31,9 @@ class WorkflowExtension extends AbstractExtension
|
||||
$this->workflowRegistry = $workflowRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
|
@ -25,6 +25,8 @@ class YamlExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFilter[]
|
||||
*/
|
||||
public function getFilters()
|
||||
{
|
||||
|
@ -39,6 +39,8 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
protected function doEnterNode(Node $node, Environment $env)
|
||||
{
|
||||
@ -91,6 +93,8 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node|null
|
||||
*/
|
||||
protected function doLeaveNode(Node $node, Environment $env)
|
||||
{
|
||||
|
@ -49,6 +49,8 @@ class TranslationNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
protected function doEnterNode(Node $node, Environment $env)
|
||||
{
|
||||
@ -89,6 +91,8 @@ class TranslationNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node|null
|
||||
*/
|
||||
protected function doLeaveNode(Node $node, Environment $env)
|
||||
{
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Bridge\Twig\TokenParser;
|
||||
|
||||
use Symfony\Bridge\Twig\Node\DumpNode;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Token;
|
||||
use Twig\TokenParser\AbstractTokenParser;
|
||||
|
||||
@ -30,6 +31,8 @@ class DumpTokenParser extends AbstractTokenParser
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
public function parse(Token $token)
|
||||
{
|
||||
@ -44,6 +47,8 @@ class DumpTokenParser extends AbstractTokenParser
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace Symfony\Bridge\Twig\TokenParser;
|
||||
|
||||
use Symfony\Bridge\Twig\Node\StopwatchNode;
|
||||
use Twig\Node\Expression\AssignNameExpression;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Token;
|
||||
use Twig\TokenParser\AbstractTokenParser;
|
||||
|
||||
@ -30,6 +31,9 @@ class StopwatchTokenParser extends AbstractTokenParser
|
||||
$this->stopwatchIsAvailable = $stopwatchIsAvailable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Node
|
||||
*/
|
||||
public function parse(Token $token)
|
||||
{
|
||||
$lineno = $token->getLine();
|
||||
@ -56,6 +60,9 @@ class StopwatchTokenParser extends AbstractTokenParser
|
||||
return $token->test('endstopwatch');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
return 'stopwatch';
|
||||
|
@ -15,6 +15,7 @@ use Symfony\Bridge\Twig\Node\TransNode;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\Expression\AbstractExpression;
|
||||
use Twig\Node\Expression\ArrayExpression;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\TextNode;
|
||||
use Twig\Token;
|
||||
|
||||
@ -29,6 +30,8 @@ class TransChoiceTokenParser extends TransTokenParser
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
public function parse(Token $token)
|
||||
{
|
||||
@ -82,6 +85,8 @@ class TransChoiceTokenParser extends TransTokenParser
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Bridge\Twig\TokenParser;
|
||||
|
||||
use Symfony\Bridge\Twig\Node\TransDefaultDomainNode;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Token;
|
||||
use Twig\TokenParser\AbstractTokenParser;
|
||||
|
||||
@ -24,6 +25,8 @@ class TransDefaultDomainTokenParser extends AbstractTokenParser
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
public function parse(Token $token)
|
||||
{
|
||||
@ -36,6 +39,8 @@ class TransDefaultDomainTokenParser extends AbstractTokenParser
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ use Symfony\Bridge\Twig\Node\TransNode;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\Expression\AbstractExpression;
|
||||
use Twig\Node\Expression\ArrayExpression;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Node\TextNode;
|
||||
use Twig\Token;
|
||||
use Twig\TokenParser\AbstractTokenParser;
|
||||
@ -28,6 +29,8 @@ class TransTokenParser extends AbstractTokenParser
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
public function parse(Token $token)
|
||||
{
|
||||
@ -86,6 +89,8 @@ class TransTokenParser extends AbstractTokenParser
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTag()
|
||||
{
|
||||
|
@ -43,6 +43,8 @@ class LegacyRouteLoaderContainer implements ContainerInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($id)
|
||||
{
|
||||
|
@ -47,6 +47,8 @@ class FilesystemLoader extends BaseFilesystemLoader
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* The name parameter might also be a TemplateReferenceInterface.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function exists($name)
|
||||
{
|
||||
|
@ -62,6 +62,8 @@ class WebProfilerExtension extends ProfilerExtension
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return TwigFunction[]
|
||||
*/
|
||||
public function getFunctions()
|
||||
{
|
||||
|
@ -144,6 +144,8 @@ abstract class AbstractAdapter implements AdapterInterface, CacheInterface, Logg
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -151,6 +151,8 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
@ -213,6 +215,8 @@ abstract class AbstractTagAwareAdapter implements TagAwareAdapterInterface, TagA
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* Overloaded in order to deal with tags for adjusted doDelete() signature.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
|
@ -39,6 +39,8 @@ interface AdapterInterface extends CacheItemPoolInterface
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/);
|
||||
}
|
||||
|
@ -96,6 +96,8 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -108,6 +110,8 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -139,6 +143,8 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -147,6 +153,8 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -178,6 +178,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -194,6 +196,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -214,6 +218,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -229,6 +235,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -244,6 +252,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -259,6 +269,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -274,6 +286,8 @@ class ChainAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -67,6 +67,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -77,6 +79,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -85,6 +89,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -93,6 +99,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -101,6 +109,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -109,6 +119,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -117,6 +129,8 @@ class NullAdapter implements AdapterInterface, CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -165,6 +165,8 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -180,6 +182,8 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -195,6 +199,8 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -225,6 +231,8 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -237,6 +245,8 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -249,6 +259,8 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -139,6 +139,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -149,6 +151,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -163,6 +167,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -171,6 +177,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -185,6 +193,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -193,6 +203,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -201,6 +213,8 @@ class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterfa
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -151,6 +151,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -215,6 +217,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -239,6 +243,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -247,6 +253,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -261,6 +269,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -274,6 +284,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -287,6 +299,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -89,6 +89,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -102,6 +104,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -115,6 +119,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -128,6 +134,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
@ -169,6 +177,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -187,6 +197,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
@ -201,6 +213,8 @@ class TraceableAdapter implements AdapterInterface, CacheInterface, PruneableInt
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
|
@ -36,6 +36,8 @@ final class CacheItem implements ItemInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getKey()
|
||||
{
|
||||
@ -52,6 +54,8 @@ final class CacheItem implements ItemInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isHit()
|
||||
{
|
||||
@ -60,6 +64,8 @@ final class CacheItem implements ItemInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function set($value)
|
||||
{
|
||||
@ -70,6 +76,8 @@ final class CacheItem implements ItemInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function expiresAt($expiration)
|
||||
{
|
||||
@ -86,6 +94,8 @@ final class CacheItem implements ItemInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function expiresAfter($time)
|
||||
{
|
||||
|
@ -58,6 +58,8 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doContains($id)
|
||||
{
|
||||
@ -66,6 +68,8 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doSave($id, $data, $lifeTime = 0)
|
||||
{
|
||||
@ -80,6 +84,8 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doDelete($id)
|
||||
{
|
||||
@ -88,6 +94,8 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function doFlush()
|
||||
{
|
||||
@ -96,6 +104,8 @@ class DoctrineProvider extends CacheProvider implements PruneableInterface, Rese
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
protected function doGetStats()
|
||||
{
|
||||
|
@ -85,6 +85,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -108,6 +110,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
@ -122,6 +126,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
@ -130,6 +136,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -178,6 +186,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
@ -229,6 +239,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
@ -249,6 +261,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
|
@ -69,6 +69,8 @@ abstract class AbstractCache implements Psr16CacheInterface, LoggerAwareInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -79,6 +81,8 @@ abstract class AbstractCache implements Psr16CacheInterface, LoggerAwareInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -105,6 +109,8 @@ abstract class AbstractCache implements Psr16CacheInterface, LoggerAwareInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
@ -142,6 +148,8 @@ abstract class AbstractCache implements Psr16CacheInterface, LoggerAwareInterfac
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
|
@ -66,6 +66,8 @@ class ArrayCache implements Psr16CacheInterface, LoggerAwareInterface, Resettabl
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -85,6 +87,8 @@ class ArrayCache implements Psr16CacheInterface, LoggerAwareInterface, Resettabl
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
@ -100,6 +104,8 @@ class ArrayCache implements Psr16CacheInterface, LoggerAwareInterface, Resettabl
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -112,6 +118,8 @@ class ArrayCache implements Psr16CacheInterface, LoggerAwareInterface, Resettabl
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
|
@ -82,6 +82,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -123,6 +125,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
@ -137,6 +141,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
@ -152,6 +158,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
@ -167,6 +175,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
@ -185,6 +195,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -200,6 +212,8 @@ class ChainCache implements Psr16CacheInterface, PruneableInterface, ResettableI
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
|
@ -32,6 +32,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -42,6 +44,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
@ -50,6 +54,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
@ -58,6 +64,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
@ -66,6 +74,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
@ -74,6 +84,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -82,6 +94,8 @@ class NullCache implements Psr16CacheInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
|
@ -87,6 +87,8 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -109,6 +111,8 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
@ -124,6 +128,8 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
@ -139,6 +145,8 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
@ -173,6 +181,8 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -188,6 +198,8 @@ class PhpArrayCache implements Psr16CacheInterface, PruneableInterface, Resettab
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
|
@ -58,6 +58,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
@ -71,6 +73,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
@ -84,6 +88,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function set($key, $value, $ttl = null)
|
||||
{
|
||||
@ -97,6 +103,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setMultiple($values, $ttl = null)
|
||||
{
|
||||
@ -124,6 +132,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return iterable
|
||||
*/
|
||||
public function getMultiple($keys, $default = null)
|
||||
{
|
||||
@ -152,6 +162,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
@ -165,6 +177,8 @@ class TraceableCache implements Psr16CacheInterface, PruneableInterface, Resetta
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMultiple($keys)
|
||||
{
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\Cache\Tests\Adapter;
|
||||
|
||||
use Psr\Cache\CacheItemInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
||||
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
|
||||
use Symfony\Component\Cache\Adapter\ProxyAdapter;
|
||||
@ -28,6 +29,9 @@ class ProxyAdapterTest extends AdapterTestCase
|
||||
'testPrune' => 'ProxyAdapter just proxies',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return CacheItemPoolInterface
|
||||
*/
|
||||
public function createCachePool($defaultLifetime = 0, $testMethod = null)
|
||||
{
|
||||
if ('testGetMetadata' === $testMethod) {
|
||||
|
@ -13,6 +13,9 @@ class ArrayCache extends CacheProvider
|
||||
return $this->doContains($id) ? $this->data[$id][0] : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function doContains($id)
|
||||
{
|
||||
if (!isset($this->data[$id])) {
|
||||
@ -24,6 +27,9 @@ class ArrayCache extends CacheProvider
|
||||
return !$expiry || microtime(true) < $expiry || !$this->doDelete($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function doSave($id, $data, $lifeTime = 0)
|
||||
{
|
||||
$this->data[$id] = [$data, $lifeTime ? microtime(true) + $lifeTime : false];
|
||||
@ -31,6 +37,9 @@ class ArrayCache extends CacheProvider
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function doDelete($id)
|
||||
{
|
||||
unset($this->data[$id]);
|
||||
@ -38,6 +47,9 @@ class ArrayCache extends CacheProvider
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function doFlush()
|
||||
{
|
||||
$this->data = [];
|
||||
@ -45,6 +57,9 @@ class ArrayCache extends CacheProvider
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
*/
|
||||
protected function doGetStats()
|
||||
{
|
||||
return null;
|
||||
|
@ -29,46 +29,73 @@ class ExternalAdapter implements CacheItemPoolInterface
|
||||
$this->cache = new ArrayAdapter($defaultLifetime);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return CacheItemInterface
|
||||
*/
|
||||
public function getItem($key)
|
||||
{
|
||||
return $this->cache->getItem($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable
|
||||
*/
|
||||
public function getItems(array $keys = [])
|
||||
{
|
||||
return $this->cache->getItems($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
return $this->cache->hasItem($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
return $this->cache->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
return $this->cache->deleteItem($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
return $this->cache->deleteItems($keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
return $this->cache->save($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
return $this->cache->saveDeferred($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function commit()
|
||||
{
|
||||
return $this->cache->commit();
|
||||
|
@ -26,6 +26,9 @@ abstract class CacheTestCase extends SimpleCacheTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function validKeys()
|
||||
{
|
||||
return array_merge(parent::validKeys(), [["a\0b"]]);
|
||||
|
@ -84,6 +84,8 @@ trait AbstractAdapterTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save(CacheItemInterface $item)
|
||||
{
|
||||
@ -97,6 +99,8 @@ trait AbstractAdapterTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveDeferred(CacheItemInterface $item)
|
||||
{
|
||||
|
@ -82,6 +82,8 @@ trait AbstractTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -104,6 +106,8 @@ trait AbstractTrait
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -133,6 +137,8 @@ trait AbstractTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
@ -141,6 +147,8 @@ trait AbstractTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItems(array $keys)
|
||||
{
|
||||
|
@ -53,6 +53,8 @@ trait ArrayTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasItem($key)
|
||||
{
|
||||
@ -68,6 +70,8 @@ trait ArrayTrait
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
@ -88,6 +92,8 @@ trait ArrayTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteItem($key)
|
||||
{
|
||||
|
@ -124,6 +124,8 @@ EOF;
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear(/*string $prefix = ''*/)
|
||||
{
|
||||
|
@ -61,6 +61,8 @@ class ConsoleLogger extends AbstractLogger
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function log($level, $message, array $context = [])
|
||||
{
|
||||
|
@ -26,6 +26,9 @@ class BufferingLogger extends AbstractLogger
|
||||
{
|
||||
private $logs = [];
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function log($level, $message, array $context = [])
|
||||
{
|
||||
$this->logs[] = [$level, $message, $context];
|
||||
|
@ -67,6 +67,7 @@ class DebugClassLoader
|
||||
private $classLoader;
|
||||
private $isFinder;
|
||||
private $loaded = [];
|
||||
private $compatPatch;
|
||||
private static $caseCheck;
|
||||
private static $checkedClasses = [];
|
||||
private static $final = [];
|
||||
@ -84,6 +85,7 @@ class DebugClassLoader
|
||||
{
|
||||
$this->classLoader = $classLoader;
|
||||
$this->isFinder = \is_array($classLoader) && method_exists($classLoader[0], 'findFile');
|
||||
$this->compatPatch = getenv('SYMFONY_PATCH_TYPE_DECLARATIONS_COMPAT') ?: null;
|
||||
|
||||
if (!isset(self::$caseCheck)) {
|
||||
$file = file_exists(__FILE__) ? __FILE__ : rtrim(realpath('.'), \DIRECTORY_SEPARATOR);
|
||||
@ -412,14 +414,18 @@ class DebugClassLoader
|
||||
}
|
||||
|
||||
if (isset(self::$returnTypes[$class][$method->name]) && !$method->hasReturnType() && !($doc && preg_match('/\n\s+\* @return +(\S+)/', $doc))) {
|
||||
list($returnType, $declaringClass, $declaringFile) = self::$returnTypes[$class][$method->name];
|
||||
list($normalizedType, $returnType, $declaringClass, $declaringFile) = self::$returnTypes[$class][$method->name];
|
||||
|
||||
if (null !== $this->compatPatch && 0 === strpos($class, $this->compatPatch)) {
|
||||
self::fixReturnStatements($method, $normalizedType);
|
||||
}
|
||||
|
||||
if (strncmp($ns, $declaringClass, $len)) {
|
||||
//if (0 === strpos($class, 'Symfony\\')) {
|
||||
// self::patchMethod($method, $returnType, $declaringFile);
|
||||
//}
|
||||
if (null !== $this->compatPatch && 0 === strpos($class, $this->compatPatch)) {
|
||||
self::patchMethod($method, $returnType, $declaringFile);
|
||||
}
|
||||
|
||||
$deprecations[] = sprintf('Method "%s::%s()" will return "%s" as of its next major version. Doing the same in child class "%s" will be required when upgrading.', $declaringClass, $method->name, $returnType, $class);
|
||||
$deprecations[] = sprintf('Method "%s::%s()" will return "%s" as of its next major version. Doing the same in child class "%s" will be required when upgrading.', $declaringClass, $method->name, $normalizedType, $class);
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,6 +435,10 @@ class DebugClassLoader
|
||||
|
||||
if (!$method->hasReturnType() && false !== strpos($doc, '@return') && preg_match('/\n\s+\* @return +(\S+)/', $doc, $matches)) {
|
||||
$this->setReturnType($matches[1], $method, $parent);
|
||||
|
||||
if (null !== $this->compatPatch && 0 === strpos($class, $this->compatPatch)) {
|
||||
self::fixReturnStatements($method, self::$returnTypes[$class][$method->name][0] ?? '?');
|
||||
}
|
||||
}
|
||||
|
||||
$finalOrInternal = false;
|
||||
@ -456,7 +466,7 @@ class DebugClassLoader
|
||||
foreach ($matches as list(, $parameterType, $parameterName)) {
|
||||
if (!isset($definedParameters[$parameterName])) {
|
||||
$parameterType = trim($parameterType);
|
||||
self::$annotatedParameters[$class][$method->name][$parameterName] = sprintf('The "%%s::%s()" method will require a new "%s$%s" argument in the next major version of its parent class "%s", not defining it is deprecated.', $method->name, $parameterType ? $parameterType.' ' : '', $parameterName, $method->class);
|
||||
self::$annotatedParameters[$class][$method->name][$parameterName] = sprintf('The "%%s::%s()" method will require a new "%s$%s" argument in the next major version of its parent class "%s", not defining it is deprecated.', $method->name, $parameterType ? $parameterType.' ' : '', $parameterName, $class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -596,8 +606,12 @@ class DebugClassLoader
|
||||
$nullable = false;
|
||||
$typesMap = [];
|
||||
foreach (explode('|', $types) as $t) {
|
||||
$t = $this->normalizeType($t, $method->class, $parent);
|
||||
$typesMap[strtolower($t)] = $t;
|
||||
$typesMap[$this->normalizeType($t, $method->class, $parent)] = $t;
|
||||
}
|
||||
|
||||
if (isset($typesMap['array']) && (isset($typesMap['Traversable']) || isset($typesMap['\Traversable']))) {
|
||||
$typesMap['iterable'] = 'array' !== $typesMap['array'] ? $typesMap['array'] : 'iterable';
|
||||
unset($typesMap['array'], $typesMap['Traversable'], $typesMap['\Traversable']);
|
||||
}
|
||||
|
||||
if (isset($typesMap['array']) && isset($typesMap['iterable'])) {
|
||||
@ -630,10 +644,11 @@ class DebugClassLoader
|
||||
}
|
||||
|
||||
if ($nullable) {
|
||||
$returnType = '?'.$returnType;
|
||||
$normalizedType = '?'.$normalizedType;
|
||||
$returnType .= '|null';
|
||||
}
|
||||
|
||||
self::$returnTypes[$method->class][$method->name] = [$returnType, $method->class, $method->getFileName()];
|
||||
self::$returnTypes[$method->class][$method->name] = [$normalizedType, $returnType, $method->class, $method->getFileName()];
|
||||
}
|
||||
|
||||
private function normalizeType(string $type, string $class, ?string $parent): string
|
||||
@ -677,55 +692,70 @@ class DebugClassLoader
|
||||
$patchedMethods[$file][$startLine] = true;
|
||||
$patchedMethods[$file][0] = $patchedMethods[$file][0] ?? 0;
|
||||
$startLine += $patchedMethods[$file][0] - 2;
|
||||
$nullable = '?' === $returnType[0] ? '?' : '';
|
||||
$returnType = ltrim($returnType, '?');
|
||||
$returnType = explode('|', $returnType);
|
||||
$code = file($file);
|
||||
|
||||
if (!isset(self::BUILTIN_RETURN_TYPES[$returnType]) && ('\\' !== $returnType[0] || $p = strrpos($returnType, '\\', 1))) {
|
||||
list($namespace, $useOffset, $useMap) = $useStatements[$file] ?? $useStatements[$file] = self::getUseStatements($file);
|
||||
|
||||
if ('\\' !== $returnType[0]) {
|
||||
list($declaringNamespace, , $declaringUseMap) = $useStatements[$declaringFile] ?? $useStatements[$declaringFile] = self::getUseStatements($declaringFile);
|
||||
|
||||
$p = strpos($returnType, '\\', 1);
|
||||
$alias = $p ? substr($returnType, 0, $p) : $returnType;
|
||||
|
||||
if (isset($declaringUseMap[$alias])) {
|
||||
$returnType = '\\'.$declaringUseMap[$alias].($p ? substr($returnType, $p) : '');
|
||||
} else {
|
||||
$returnType = '\\'.$declaringNamespace.$returnType;
|
||||
}
|
||||
|
||||
$p = strrpos($returnType, '\\', 1);
|
||||
foreach ($returnType as $i => $type) {
|
||||
if (preg_match('/((?:\[\])+)$/', $type, $m)) {
|
||||
$type = substr($type, 0, -\strlen($m[1]));
|
||||
$format = '%s'.$m[1];
|
||||
} elseif (preg_match('/^(array|iterable)<([^,>]++)>$/', $type, $m)) {
|
||||
$type = $m[2];
|
||||
$format = $m[1].'<%s>';
|
||||
} else {
|
||||
$format = null;
|
||||
}
|
||||
|
||||
$alias = substr($returnType, 1 + $p);
|
||||
$returnType = substr($returnType, 1);
|
||||
if (isset(self::SPECIAL_RETURN_TYPES[$type]) || ('\\' === $type[0] && !$p = strrpos($type, '\\', 1))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
list($namespace, $useOffset, $useMap) = $useStatements[$file] ?? $useStatements[$file] = self::getUseStatements($file);
|
||||
|
||||
if ('\\' !== $type[0]) {
|
||||
list($declaringNamespace, , $declaringUseMap) = $useStatements[$declaringFile] ?? $useStatements[$declaringFile] = self::getUseStatements($declaringFile);
|
||||
|
||||
$p = strpos($type, '\\', 1);
|
||||
$alias = $p ? substr($type, 0, $p) : $type;
|
||||
|
||||
if (isset($declaringUseMap[$alias])) {
|
||||
$type = '\\'.$declaringUseMap[$alias].($p ? substr($type, $p) : '');
|
||||
} else {
|
||||
$type = '\\'.$declaringNamespace.$type;
|
||||
}
|
||||
|
||||
$p = strrpos($type, '\\', 1);
|
||||
}
|
||||
|
||||
$alias = substr($type, 1 + $p);
|
||||
$type = substr($type, 1);
|
||||
|
||||
if (!isset($useMap[$alias]) && (class_exists($c = $namespace.$alias) || interface_exists($c) || trait_exists($c))) {
|
||||
$useMap[$alias] = $c;
|
||||
}
|
||||
|
||||
if (!isset($useMap[$alias])) {
|
||||
$useStatements[$file][2][$alias] = $returnType;
|
||||
$code[$useOffset] = "use $returnType;\n".$code[$useOffset];
|
||||
$useStatements[$file][2][$alias] = $type;
|
||||
$code[$useOffset] = "use $type;\n".$code[$useOffset];
|
||||
++$patchedMethods[$file][0];
|
||||
} elseif ($useMap[$alias] !== $returnType) {
|
||||
} elseif ($useMap[$alias] !== $type) {
|
||||
$alias .= 'FIXME';
|
||||
$useStatements[$file][2][$alias] = $returnType;
|
||||
$code[$useOffset] = "use $returnType as $alias;\n".$code[$useOffset];
|
||||
$useStatements[$file][2][$alias] = $type;
|
||||
$code[$useOffset] = "use $type as $alias;\n".$code[$useOffset];
|
||||
++$patchedMethods[$file][0];
|
||||
}
|
||||
|
||||
$returnType = $alias;
|
||||
$returnType[$i] = null !== $format ? sprintf($format, $alias) : $alias;
|
||||
}
|
||||
|
||||
$returnType = implode('|', $returnType);
|
||||
|
||||
if ($method->getDocComment()) {
|
||||
$code[$startLine] = " * @return $nullable$returnType\n".$code[$startLine];
|
||||
$code[$startLine] = " * @return $returnType\n".$code[$startLine];
|
||||
} else {
|
||||
$code[$startLine] .= <<<EOTXT
|
||||
/**
|
||||
* @return $nullable$returnType
|
||||
* @return $returnType
|
||||
*/
|
||||
|
||||
EOTXT;
|
||||
@ -777,4 +807,27 @@ EOTXT;
|
||||
|
||||
return [$namespace, $useOffset, $useMap];
|
||||
}
|
||||
|
||||
private static function fixReturnStatements(\ReflectionMethod $method, string $returnType)
|
||||
{
|
||||
if (!file_exists($file = $method->getFileName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fixedCode = $code = file($file);
|
||||
$end = $method->getEndLine();
|
||||
for ($i = $method->getStartLine(); $i < $end; ++$i) {
|
||||
if ('void' === $returnType) {
|
||||
$fixedCode[$i] = str_replace(' return null;', ' return;', $code[$i]);
|
||||
} elseif ('mixed' === $returnType || '?' === $returnType[0]) {
|
||||
$fixedCode[$i] = str_replace(' return;', ' return null;', $code[$i]);
|
||||
} else {
|
||||
$fixedCode[$i] = str_replace(' return;', " return $returnType!?;", $code[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($fixedCode !== $code) {
|
||||
file_put_contents($file, $fixedCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,11 +33,11 @@ class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
|
||||
$notFoundSuffix = '\' not found';
|
||||
$notFoundSuffixLen = \strlen($notFoundSuffix);
|
||||
if ($notFoundSuffixLen > $messageLen) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (['class', 'interface', 'trait'] as $typeName) {
|
||||
|
@ -30,17 +30,17 @@ class UndefinedFunctionFatalErrorHandler implements FatalErrorHandlerInterface
|
||||
$notFoundSuffix = '()';
|
||||
$notFoundSuffixLen = \strlen($notFoundSuffix);
|
||||
if ($notFoundSuffixLen > $messageLen) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$prefix = 'Call to undefined function ';
|
||||
$prefixLen = \strlen($prefix);
|
||||
if (0 !== strpos($error['message'], $prefix)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$fullyQualifiedFunctionName = substr($error['message'], $prefixLen, -$notFoundSuffixLen);
|
||||
|
@ -28,7 +28,7 @@ class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface
|
||||
{
|
||||
preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', $error['message'], $matches);
|
||||
if (!$matches) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$className = $matches[1];
|
||||
|
@ -65,6 +65,8 @@ class Logger extends AbstractLogger
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function log($level, $message, array $context = [])
|
||||
{
|
||||
|
@ -41,46 +41,73 @@ class Logger implements LoggerInterface
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function log($level, $message, array $context = [])
|
||||
{
|
||||
$this->logs[$level][] = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function emergency($message, array $context = [])
|
||||
{
|
||||
$this->log('emergency', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function alert($message, array $context = [])
|
||||
{
|
||||
$this->log('alert', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function critical($message, array $context = [])
|
||||
{
|
||||
$this->log('critical', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function error($message, array $context = [])
|
||||
{
|
||||
$this->log('error', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function warning($message, array $context = [])
|
||||
{
|
||||
$this->log('warning', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function notice($message, array $context = [])
|
||||
{
|
||||
$this->log('notice', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function info($message, array $context = [])
|
||||
{
|
||||
$this->log('info', $message, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function debug($message, array $context = [])
|
||||
{
|
||||
$this->log('debug', $message, $context);
|
||||
|
@ -84,13 +84,13 @@ class TimezoneDataGenerator extends AbstractDataGenerator
|
||||
// Don't generate aliases, as they are resolved during runtime
|
||||
// Unless an alias is needed as fallback for de-duplication purposes
|
||||
if (isset($this->localeAliases[$displayLocale]) && !$this->generatingFallback) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$localeBundle = $reader->read($tempDir, $displayLocale);
|
||||
|
||||
if (!isset($localeBundle['zoneStrings']) || null === $localeBundle['zoneStrings']) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [
|
||||
@ -115,7 +115,7 @@ class TimezoneDataGenerator extends AbstractDataGenerator
|
||||
$data['Meta'] = array_diff($data['Meta'], $fallback['Meta']);
|
||||
}
|
||||
if (!$data['Names'] && !$data['Meta']) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->zoneIds = array_merge($this->zoneIds, array_keys($data['Names']));
|
||||
|
@ -61,6 +61,8 @@ class GenericLinkProvider implements EvolvableLinkProviderInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withLink(LinkInterface $link)
|
||||
{
|
||||
@ -72,6 +74,8 @@ class GenericLinkProvider implements EvolvableLinkProviderInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withoutLink(LinkInterface $link)
|
||||
{
|
||||
|
@ -92,6 +92,8 @@ class Link implements EvolvableLinkInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withHref($href)
|
||||
{
|
||||
@ -104,6 +106,8 @@ class Link implements EvolvableLinkInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withRel($rel)
|
||||
{
|
||||
@ -115,6 +119,8 @@ class Link implements EvolvableLinkInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withoutRel($rel)
|
||||
{
|
||||
@ -126,6 +132,8 @@ class Link implements EvolvableLinkInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withAttribute($attribute, $value)
|
||||
{
|
||||
@ -137,6 +145,8 @@ class Link implements EvolvableLinkInterface
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withoutAttribute($attribute)
|
||||
{
|
||||
|
@ -36,6 +36,8 @@ trait ServiceLocatorTrait
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has($id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user