[HttpKernel] moved from protected to private
This commit is contained in:
parent
e4a3e0c2c7
commit
1b8dc80215
@ -21,7 +21,7 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
|||||||
*/
|
*/
|
||||||
class FileLocator extends BaseFileLocator
|
class FileLocator extends BaseFileLocator
|
||||||
{
|
{
|
||||||
protected $kernel;
|
private $kernel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class ControllerResolver implements ControllerResolverInterface
|
class ControllerResolver implements ControllerResolverInterface
|
||||||
{
|
{
|
||||||
protected $logger;
|
private $logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
*/
|
*/
|
||||||
class ConfigDataCollector extends DataCollector
|
class ConfigDataCollector extends DataCollector
|
||||||
{
|
{
|
||||||
protected $kernel;
|
private $kernel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -23,7 +23,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
|||||||
*/
|
*/
|
||||||
class EventDataCollector extends DataCollector
|
class EventDataCollector extends DataCollector
|
||||||
{
|
{
|
||||||
protected $dispatcher;
|
private $dispatcher;
|
||||||
|
|
||||||
public function setEventDispatcher(EventDispatcherInterface $dispatcher)
|
public function setEventDispatcher(EventDispatcherInterface $dispatcher)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
*/
|
*/
|
||||||
class LoggerDataCollector extends DataCollector
|
class LoggerDataCollector extends DataCollector
|
||||||
{
|
{
|
||||||
protected $logger;
|
private $logger;
|
||||||
|
|
||||||
public function __construct($logger = null)
|
public function __construct($logger = null)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@ class RequestDataCollector extends DataCollector
|
|||||||
return 'request';
|
return 'request';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
|
private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
|
||||||
{
|
{
|
||||||
$cookie = sprintf('%s=%s', $name, urlencode($value));
|
$cookie = sprintf('%s=%s', $name, urlencode($value));
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ namespace Symfony\Component\HttpKernel\Debug;
|
|||||||
*/
|
*/
|
||||||
class ErrorHandler
|
class ErrorHandler
|
||||||
{
|
{
|
||||||
protected $levels = array(
|
private $levels = array(
|
||||||
E_WARNING => 'Warning',
|
E_WARNING => 'Warning',
|
||||||
E_NOTICE => 'Notice',
|
E_NOTICE => 'Notice',
|
||||||
E_USER_ERROR => 'User Error',
|
E_USER_ERROR => 'User Error',
|
||||||
@ -28,7 +28,7 @@ class ErrorHandler
|
|||||||
E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
|
E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $level;
|
private $level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -26,8 +26,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class ExceptionListener
|
class ExceptionListener
|
||||||
{
|
{
|
||||||
protected $controller;
|
private $controller;
|
||||||
protected $logger;
|
private $logger;
|
||||||
|
|
||||||
public function __construct($controller, LoggerInterface $logger = null)
|
public function __construct($controller, LoggerInterface $logger = null)
|
||||||
{
|
{
|
||||||
|
@ -22,8 +22,8 @@ use Symfony\Component\DependencyInjection\Container;
|
|||||||
*/
|
*/
|
||||||
abstract class Extension implements ExtensionInterface
|
abstract class Extension implements ExtensionInterface
|
||||||
{
|
{
|
||||||
protected $classes = array();
|
private $classes = array();
|
||||||
protected $classMap = array();
|
private $classMap = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the classes to cache.
|
* Gets the classes to cache.
|
||||||
@ -40,7 +40,7 @@ abstract class Extension implements ExtensionInterface
|
|||||||
*
|
*
|
||||||
* @param array $classes An array of classes
|
* @param array $classes An array of classes
|
||||||
*/
|
*/
|
||||||
protected function addClassesToCompile(array $classes)
|
public function addClassesToCompile(array $classes)
|
||||||
{
|
{
|
||||||
$this->classes = array_merge($this->classes, $classes);
|
$this->classes = array_merge($this->classes, $classes);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ class FlattenException
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function flattenArgs($args)
|
private function flattenArgs($args)
|
||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($args as $key => $value) {
|
foreach ($args as $key => $value) {
|
||||||
|
@ -18,8 +18,8 @@ namespace Symfony\Component\HttpKernel\Exception;
|
|||||||
*/
|
*/
|
||||||
class HttpException extends \RuntimeException implements HttpExceptionInterface
|
class HttpException extends \RuntimeException implements HttpExceptionInterface
|
||||||
{
|
{
|
||||||
protected $statusCode;
|
private $statusCode;
|
||||||
protected $headers;
|
private $headers;
|
||||||
|
|
||||||
public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0)
|
public function __construct($statusCode, $message = null, \Exception $previous = null, array $headers = array(), $code = 0)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface;
|
|||||||
*/
|
*/
|
||||||
class Esi
|
class Esi
|
||||||
{
|
{
|
||||||
protected $contentTypes;
|
private $contentTypes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -212,7 +212,7 @@ class Esi
|
|||||||
*
|
*
|
||||||
* @return string The response content for the include.
|
* @return string The response content for the include.
|
||||||
*/
|
*/
|
||||||
protected function handleEsiIncludeTag($attributes)
|
private function handleEsiIncludeTag($attributes)
|
||||||
{
|
{
|
||||||
$options = array();
|
$options = array();
|
||||||
preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $attributes[1], $matches, PREG_SET_ORDER);
|
preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $attributes[1], $matches, PREG_SET_ORDER);
|
||||||
|
@ -22,8 +22,8 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
|||||||
*/
|
*/
|
||||||
class EsiListener
|
class EsiListener
|
||||||
{
|
{
|
||||||
protected $i;
|
private $i;
|
||||||
protected $esi;
|
private $esi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -28,9 +28,9 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
*/
|
*/
|
||||||
class EsiResponseCacheStrategy implements EsiResponseCacheStrategyInterface
|
class EsiResponseCacheStrategy implements EsiResponseCacheStrategyInterface
|
||||||
{
|
{
|
||||||
protected $cacheable = true;
|
private $cacheable = true;
|
||||||
protected $ttls = array();
|
private $ttls = array();
|
||||||
protected $maxAges = array();
|
private $maxAges = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a Response.
|
* Adds a Response.
|
||||||
|
@ -26,12 +26,12 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
*/
|
*/
|
||||||
class HttpCache implements HttpKernelInterface
|
class HttpCache implements HttpKernelInterface
|
||||||
{
|
{
|
||||||
protected $kernel;
|
private $kernel;
|
||||||
protected $traces;
|
private $store;
|
||||||
protected $store;
|
private $request;
|
||||||
protected $request;
|
private $esi;
|
||||||
protected $esi;
|
private $esiCacheStrategy;
|
||||||
protected $esiCacheStrategy;
|
private $traces;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -519,7 +519,7 @@ class HttpCache implements HttpKernelInterface
|
|||||||
*
|
*
|
||||||
* @return Response A Response instance
|
* @return Response A Response instance
|
||||||
*/
|
*/
|
||||||
protected function restoreResponseBody(Request $request, Response $response)
|
private function restoreResponseBody(Request $request, Response $response)
|
||||||
{
|
{
|
||||||
if ('head' === strtolower($request->getMethod())) {
|
if ('head' === strtolower($request->getMethod())) {
|
||||||
$response->setContent('');
|
$response->setContent('');
|
||||||
@ -568,7 +568,7 @@ class HttpCache implements HttpKernelInterface
|
|||||||
*
|
*
|
||||||
* @return Boolean true if the Request is private, false otherwise
|
* @return Boolean true if the Request is private, false otherwise
|
||||||
*/
|
*/
|
||||||
protected function isPrivateRequest(Request $request)
|
private function isPrivateRequest(Request $request)
|
||||||
{
|
{
|
||||||
foreach ($this->options['private_headers'] as $key) {
|
foreach ($this->options['private_headers'] as $key) {
|
||||||
$key = strtolower(str_replace('HTTP_', '', $key));
|
$key = strtolower(str_replace('HTTP_', '', $key));
|
||||||
@ -590,7 +590,7 @@ class HttpCache implements HttpKernelInterface
|
|||||||
*
|
*
|
||||||
* @param string $event The event name
|
* @param string $event The event name
|
||||||
*/
|
*/
|
||||||
protected function record(Request $request, $event)
|
private function record(Request $request, $event)
|
||||||
{
|
{
|
||||||
$path = $request->getPathInfo();
|
$path = $request->getPathInfo();
|
||||||
if ($qs = $request->getQueryString()) {
|
if ($qs = $request->getQueryString()) {
|
||||||
|
@ -25,9 +25,9 @@ use Symfony\Component\HttpFoundation\HeaderBag;
|
|||||||
*/
|
*/
|
||||||
class Store implements StoreInterface
|
class Store implements StoreInterface
|
||||||
{
|
{
|
||||||
protected $root;
|
private $root;
|
||||||
protected $keyCache;
|
private $keyCache;
|
||||||
protected $locks;
|
private $locks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@ -237,7 +237,7 @@ class Store implements StoreInterface
|
|||||||
*
|
*
|
||||||
* @return Boolean true if the the two environments match, false otherwise
|
* @return Boolean true if the the two environments match, false otherwise
|
||||||
*/
|
*/
|
||||||
protected function requestsMatch($vary, $env1, $env2)
|
private function requestsMatch($vary, $env1, $env2)
|
||||||
{
|
{
|
||||||
if (empty($vary)) {
|
if (empty($vary)) {
|
||||||
return true;
|
return true;
|
||||||
@ -264,7 +264,7 @@ class Store implements StoreInterface
|
|||||||
*
|
*
|
||||||
* @return array An array of data associated with the key
|
* @return array An array of data associated with the key
|
||||||
*/
|
*/
|
||||||
protected function getMetadata($key)
|
private function getMetadata($key)
|
||||||
{
|
{
|
||||||
if (false === $entries = $this->load($key)) {
|
if (false === $entries = $this->load($key)) {
|
||||||
return array();
|
return array();
|
||||||
@ -298,7 +298,7 @@ class Store implements StoreInterface
|
|||||||
*
|
*
|
||||||
* @return string The data associated with the key
|
* @return string The data associated with the key
|
||||||
*/
|
*/
|
||||||
protected function load($key)
|
private function load($key)
|
||||||
{
|
{
|
||||||
$path = $this->getPath($key);
|
$path = $this->getPath($key);
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ class Store implements StoreInterface
|
|||||||
* @param string $key The store key
|
* @param string $key The store key
|
||||||
* @param string $data The data to store
|
* @param string $data The data to store
|
||||||
*/
|
*/
|
||||||
protected function save($key, $data)
|
private function save($key, $data)
|
||||||
{
|
{
|
||||||
$path = $this->getPath($key);
|
$path = $this->getPath($key);
|
||||||
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
|
if (!is_dir(dirname($path)) && false === @mkdir(dirname($path), 0777, true)) {
|
||||||
@ -348,7 +348,7 @@ class Store implements StoreInterface
|
|||||||
*
|
*
|
||||||
* @return string A key for the given Request
|
* @return string A key for the given Request
|
||||||
*/
|
*/
|
||||||
protected function getCacheKey(Request $request)
|
private function getCacheKey(Request $request)
|
||||||
{
|
{
|
||||||
if (isset($this->keyCache[$request])) {
|
if (isset($this->keyCache[$request])) {
|
||||||
return $this->keyCache[$request];
|
return $this->keyCache[$request];
|
||||||
@ -364,7 +364,7 @@ class Store implements StoreInterface
|
|||||||
*
|
*
|
||||||
* @return array An array of HTTP headers
|
* @return array An array of HTTP headers
|
||||||
*/
|
*/
|
||||||
protected function persistRequest(Request $request)
|
private function persistRequest(Request $request)
|
||||||
{
|
{
|
||||||
return $request->headers->all();
|
return $request->headers->all();
|
||||||
}
|
}
|
||||||
@ -376,7 +376,7 @@ class Store implements StoreInterface
|
|||||||
*
|
*
|
||||||
* @return array An array of HTTP headers
|
* @return array An array of HTTP headers
|
||||||
*/
|
*/
|
||||||
protected function persistResponse(Response $response)
|
private function persistResponse(Response $response)
|
||||||
{
|
{
|
||||||
$headers = $response->headers->all();
|
$headers = $response->headers->all();
|
||||||
$headers['X-Status'] = array($response->getStatusCode());
|
$headers['X-Status'] = array($response->getStatusCode());
|
||||||
@ -390,7 +390,7 @@ class Store implements StoreInterface
|
|||||||
* @param array $headers An array of HTTP headers for the Response
|
* @param array $headers An array of HTTP headers for the Response
|
||||||
* @param string $body The Response body
|
* @param string $body The Response body
|
||||||
*/
|
*/
|
||||||
protected function restoreResponse($headers, $body = null)
|
private function restoreResponse($headers, $body = null)
|
||||||
{
|
{
|
||||||
$status = $headers['X-Status'][0];
|
$status = $headers['X-Status'][0];
|
||||||
unset($headers['X-Status']);
|
unset($headers['X-Status']);
|
||||||
|
@ -85,7 +85,7 @@ class HttpKernel implements HttpKernelInterface
|
|||||||
* @throws \LogicException If one of the listener does not behave as expected
|
* @throws \LogicException If one of the listener does not behave as expected
|
||||||
* @throws NotFoundHttpException When controller cannot be found
|
* @throws NotFoundHttpException When controller cannot be found
|
||||||
*/
|
*/
|
||||||
protected function handleRaw(Request $request, $type = self::MASTER_REQUEST)
|
private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
|
||||||
{
|
{
|
||||||
// request
|
// request
|
||||||
$event = new GetResponseEvent($this, $request, $type);
|
$event = new GetResponseEvent($this, $request, $type);
|
||||||
@ -138,7 +138,7 @@ class HttpKernel implements HttpKernelInterface
|
|||||||
*
|
*
|
||||||
* @throws \RuntimeException if the passed object is not a Response instance
|
* @throws \RuntimeException if the passed object is not a Response instance
|
||||||
*/
|
*/
|
||||||
protected function filterResponse(Response $response, Request $request, $type)
|
private function filterResponse(Response $response, Request $request, $type)
|
||||||
{
|
{
|
||||||
$event = new FilterResponseEvent($this, $request, $type, $response);
|
$event = new FilterResponseEvent($this, $request, $type, $response);
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ class HttpKernel implements HttpKernelInterface
|
|||||||
*
|
*
|
||||||
* @return Response A Response instance
|
* @return Response A Response instance
|
||||||
*/
|
*/
|
||||||
protected function handleException(\Exception $e, $request, $type)
|
private function handleException(\Exception $e, $request, $type)
|
||||||
{
|
{
|
||||||
$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
|
$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
|
||||||
$this->dispatcher->dispatch(Events::onCoreException, $event);
|
$this->dispatcher->dispatch(Events::onCoreException, $event);
|
||||||
@ -168,7 +168,7 @@ class HttpKernel implements HttpKernelInterface
|
|||||||
return $this->filterResponse($event->getResponse(), $request, $type);
|
return $this->filterResponse($event->getResponse(), $request, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function varToString($var)
|
private function varToString($var)
|
||||||
{
|
{
|
||||||
if (is_object($var)) {
|
if (is_object($var)) {
|
||||||
return sprintf('[object](%s)', get_class($var));
|
return sprintf('[object](%s)', get_class($var));
|
||||||
|
@ -24,18 +24,18 @@ use Symfony\Component\HttpKernel\Log\LoggerInterface;
|
|||||||
*/
|
*/
|
||||||
class Profiler
|
class Profiler
|
||||||
{
|
{
|
||||||
protected $storage;
|
private $storage;
|
||||||
protected $collectors;
|
private $collectors;
|
||||||
protected $logger;
|
private $logger;
|
||||||
protected $enabled;
|
private $enabled;
|
||||||
protected $token;
|
private $token;
|
||||||
protected $parent;
|
private $parent;
|
||||||
protected $data;
|
private $data;
|
||||||
protected $ip;
|
private $ip;
|
||||||
protected $url;
|
private $url;
|
||||||
protected $time;
|
private $time;
|
||||||
protected $empty;
|
private $empty;
|
||||||
protected $children;
|
private $children;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
*/
|
*/
|
||||||
class ResponseListener
|
class ResponseListener
|
||||||
{
|
{
|
||||||
protected $charset;
|
private $charset;
|
||||||
|
|
||||||
public function __construct($charset)
|
public function __construct($charset)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user