Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed CS

  • Loading branch information...
commit 985f3aa6c9f8074b2d1a12345e0768f8c24aa72d 1 parent 67f5684
@fabpot fabpot authored
Showing with 84 additions and 91 deletions.
  1. +2 −2 File/MimeType/ExtensionGuesser.php
  2. +1 −1  File/MimeType/ExtensionGuesserInterface.php
  3. +1 −1  File/MimeType/FileBinaryMimeTypeGuesser.php
  4. +1 −1  File/MimeType/FileinfoMimeTypeGuesser.php
  5. +1 −1  File/MimeType/MimeTypeExtensionGuesser.php
  6. +2 −2 File/MimeType/MimeTypeGuesser.php
  7. +1 −1  File/MimeType/MimeTypeGuesserInterface.php
  8. +1 −1  File/UploadedFile.php
  9. +1 −1  FileBag.php
  10. +1 −1  JsonResponse.php
  11. +1 −1  RedirectResponse.php
  12. +9 −8 Request.php
  13. +1 −1  RequestMatcherInterface.php
  14. +6 −6 Resources/stubs/SessionHandlerInterface.php
  15. +2 −2 Response.php
  16. +6 −6 Session/Attribute/AttributeBagInterface.php
  17. +2 −2 Session/Flash/AutoExpireFlashBag.php
  18. +9 −9 Session/Flash/FlashBagInterface.php
  19. +4 −4 Session/SessionBagInterface.php
  20. +19 −19 Session/SessionInterface.php
  21. +1 −1  Session/Storage/Proxy/SessionHandlerProxy.php
  22. +12 −12 Session/Storage/SessionStorageInterface.php
  23. +0 −2  Tests/File/UploadedFileTest.php
  24. +0 −1  Tests/ParameterBagTest.php
  25. +0 −2  Tests/RequestMatcherTest.php
  26. +0 −1  Tests/RequestTest.php
  27. +0 −1  Tests/Session/Storage/Handler/NullSessionHandlerTest.php
  28. +0 −1  Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
View
4 File/MimeType/ExtensionGuesser.php
@@ -33,7 +33,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface
*
* @var ExtensionGuesser
*/
- static private $instance = null;
+ private static $instance = null;
/**
* All registered ExtensionGuesserInterface instances
@@ -47,7 +47,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface
*
* @return ExtensionGuesser
*/
- static public function getInstance()
+ public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new self();
View
2  File/MimeType/ExtensionGuesserInterface.php
@@ -22,5 +22,5 @@
* @param string $mimeType The mime type
* @return string The guessed extension or NULL, if none could be guessed
*/
- function guess($mimeType);
+ public function guess($mimeType);
}
View
2  File/MimeType/FileBinaryMimeTypeGuesser.php
@@ -43,7 +43,7 @@ public function __construct($cmd = 'file -b --mime %s 2>/dev/null')
*
* @return Boolean
*/
- static public function isSupported()
+ public static function isSupported()
{
return !defined('PHP_WINDOWS_VERSION_BUILD');
}
View
2  File/MimeType/FileinfoMimeTypeGuesser.php
@@ -26,7 +26,7 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface
*
* @return Boolean
*/
- static public function isSupported()
+ public static function isSupported()
{
return function_exists('finfo_open');
}
View
2  File/MimeType/MimeTypeExtensionGuesser.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\HttpFoundation\File\Mimetype;
+namespace Symfony\Component\HttpFoundation\File\MimeType;
/**
* Provides a best-guess mapping of mime type to file extension.
View
4 File/MimeType/MimeTypeGuesser.php
@@ -38,7 +38,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
*
* @var MimeTypeGuesser
*/
- static private $instance = null;
+ private static $instance = null;
/**
* All registered MimeTypeGuesserInterface instances
@@ -52,7 +52,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
*
* @return MimeTypeGuesser
*/
- static public function getInstance()
+ public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new self();
View
2  File/MimeType/MimeTypeGuesserInterface.php
@@ -31,5 +31,5 @@
* @throws FileNotFoundException If the file does not exist
* @throws AccessDeniedException If the file could not be read
*/
- function guess($path);
+ public function guess($path);
}
View
2  File/UploadedFile.php
@@ -201,7 +201,7 @@ public function move($directory, $name = null)
*
* @return int The maximum size of an uploaded file in bytes
*/
- static public function getMaxFilesize()
+ public static function getMaxFilesize()
{
$max = trim(ini_get('upload_max_filesize'));
View
2  FileBag.php
@@ -23,7 +23,7 @@
*/
class FileBag extends ParameterBag
{
- static private $fileKeys = array('error', 'name', 'size', 'tmp_name', 'type');
+ private static $fileKeys = array('error', 'name', 'size', 'tmp_name', 'type');
/**
* Constructor.
View
2  JsonResponse.php
@@ -38,7 +38,7 @@ public function __construct($data = array(), $status = 200, $headers = array())
/**
* {@inheritDoc}
*/
- static public function create($data = array(), $status = 200, $headers = array())
+ public static function create($data = array(), $status = 200, $headers = array())
{
return new static($data, $status, $headers);
}
View
2  RedirectResponse.php
@@ -66,7 +66,7 @@ public function __construct($url, $status = 302, $headers = array())
/**
* {@inheritDoc}
*/
- static public function create($url = '', $status = 302, $headers = array())
+ public static function create($url = '', $status = 302, $headers = array())
{
return new static($url, $status, $headers);
}
View
17 Request.php
@@ -30,7 +30,7 @@
*/
class Request
{
- static protected $trustProxy = false;
+ protected static $trustProxy = false;
/**
* @var \Symfony\Component\HttpFoundation\ParameterBag
@@ -149,7 +149,7 @@ class Request
/**
* @var array
*/
- static protected $formats;
+ protected static $formats;
/**
* Constructor.
@@ -213,7 +213,7 @@ public function initialize(array $query = array(), array $request = array(), arr
*
* @api
*/
- static public function createFromGlobals()
+ public static function createFromGlobals()
{
$request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
@@ -242,7 +242,7 @@ static public function createFromGlobals()
*
* @api
*/
- static public function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)
+ public static function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)
{
$defaults = array(
'SERVER_NAME' => 'localhost',
@@ -444,7 +444,7 @@ public function overrideGlobals()
*
* @api
*/
- static public function trustProxyData()
+ public static function trustProxyData()
{
self::$trustProxy = true;
}
@@ -455,7 +455,7 @@ static public function trustProxyData()
*
* @return boolean
*/
- static public function isProxyTrusted()
+ public static function isProxyTrusted()
{
return self::$trustProxy;
}
@@ -470,7 +470,7 @@ static public function isProxyTrusted()
*
* @return string A normalized query string for the Request
*/
- static public function normalizeQueryString($qs)
+ public static function normalizeQueryString($qs)
{
if ('' == $qs) {
return '';
@@ -848,6 +848,7 @@ public function getUriForPath($path)
public function getQueryString()
{
$qs = static::normalizeQueryString($this->server->get('QUERY_STRING'));
+
return '' === $qs ? null : $qs;
}
@@ -1454,7 +1455,7 @@ protected function preparePathInfo()
/**
* Initializes HTTP request formats.
*/
- static protected function initializeFormats()
+ protected static function initializeFormats()
{
static::$formats = array(
'html' => array('text/html', 'application/xhtml+xml'),
View
2  RequestMatcherInterface.php
@@ -29,5 +29,5 @@
*
* @api
*/
- function matches(Request $request);
+ public function matches(Request $request);
}
View
12 Resources/stubs/SessionHandlerInterface.php
@@ -36,7 +36,7 @@
*
* @return boolean
*/
- function open($savePath, $sessionName);
+ public function open($savePath, $sessionName);
/**
* Close session.
@@ -45,7 +45,7 @@ function open($savePath, $sessionName);
*
* @return boolean
*/
- function close();
+ public function close();
/**
* Read session.
@@ -56,7 +56,7 @@ function close();
*
* @return string String as stored in persistent storage or empty string in all other cases.
*/
- function read($sessionId);
+ public function read($sessionId);
/**
* Commit session to storage.
@@ -68,7 +68,7 @@ function read($sessionId);
*
* @return boolean
*/
- function write($sessionId, $data);
+ public function write($sessionId, $data);
/**
* Destroys this session.
@@ -81,7 +81,7 @@ function write($sessionId, $data);
*
* @return boolean
*/
- function destroy($sessionId);
+ public function destroy($sessionId);
/**
* Garbage collection for storage.
@@ -94,5 +94,5 @@ function destroy($sessionId);
*
* @return boolean
*/
- function gc($lifetime);
+ public function gc($lifetime);
}
View
4 Response.php
@@ -61,7 +61,7 @@ class Response
*
* @var array
*/
- static public $statusTexts = array(
+ public static $statusTexts = array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', // RFC2518
@@ -158,7 +158,7 @@ public function __construct($content = '', $status = 200, $headers = array())
*
* @return Response
*/
- static public function create($content = '', $status = 200, $headers = array())
+ public static function create($content = '', $status = 200, $headers = array())
{
return new static($content, $status, $headers);
}
View
12 Session/Attribute/AttributeBagInterface.php
@@ -27,7 +27,7 @@
*
* @return Boolean true if the attribute is defined, false otherwise
*/
- function has($name);
+ public function has($name);
/**
* Returns an attribute.
@@ -37,7 +37,7 @@ function has($name);
*
* @return mixed
*/
- function get($name, $default = null);
+ public function get($name, $default = null);
/**
* Sets an attribute.
@@ -45,21 +45,21 @@ function get($name, $default = null);
* @param string $name
* @param mixed $value
*/
- function set($name, $value);
+ public function set($name, $value);
/**
* Returns attributes.
*
* @return array Attributes
*/
- function all();
+ public function all();
/**
* Sets attributes.
*
* @param array $attributes Attributes
*/
- function replace(array $attributes);
+ public function replace(array $attributes);
/**
* Removes an attribute.
@@ -68,5 +68,5 @@ function replace(array $attributes);
*
* @return mixed The removed value
*/
- function remove($name);
+ public function remove($name);
}
View
4 Session/Flash/AutoExpireFlashBag.php
@@ -93,7 +93,7 @@ public function peek($type, array $default = array())
*/
public function peekAll()
{
- return array_key_exists('display', $this->flashes) ? (array)$this->flashes['display'] : array();
+ return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : array();
}
/**
@@ -139,7 +139,7 @@ public function setAll(array $messages)
*/
public function set($type, $messages)
{
- $this->flashes['new'][$type] = (array)$messages;
+ $this->flashes['new'][$type] = (array) $messages;
}
/**
View
18 Session/Flash/FlashBagInterface.php
@@ -26,7 +26,7 @@
* @param string $type
* @param string $message
*/
- function add($type, $message);
+ public function add($type, $message);
/**
* Registers a message for a given type.
@@ -34,7 +34,7 @@ function add($type, $message);
* @param string $type
* @param string $message
*/
- function set($type, $message);
+ public function set($type, $message);
/**
* Gets flash message for a given type.
@@ -44,14 +44,14 @@ function set($type, $message);
*
* @return string
*/
- function peek($type, array $default = array());
+ public function peek($type, array $default = array());
/**
* Gets all flash messages.
*
* @return array
*/
- function peekAll();
+ public function peekAll();
/**
* Gets and clears flash from the stack.
@@ -61,19 +61,19 @@ function peekAll();
*
* @return string
*/
- function get($type, array $default = array());
+ public function get($type, array $default = array());
/**
* Gets and clears flashes from the stack.
*
* @return array
*/
- function all();
+ public function all();
/**
* Sets all flash messages.
*/
- function setAll(array $messages);
+ public function setAll(array $messages);
/**
* Has flash messages for a given type?
@@ -82,12 +82,12 @@ function setAll(array $messages);
*
* @return boolean
*/
- function has($type);
+ public function has($type);
/**
* Returns a list of all defined types.
*
* @return array
*/
- function keys();
+ public function keys();
}
View
8 Session/SessionBagInterface.php
@@ -23,26 +23,26 @@
*
* @return string
*/
- function getName();
+ public function getName();
/**
* Initializes the Bag
*
* @param array $array
*/
- function initialize(array &$array);
+ public function initialize(array &$array);
/**
* Gets the storage key for this bag.
*
* @return string
*/
- function getStorageKey();
+ public function getStorageKey();
/**
* Clears out data from bag.
*
* @return mixed Whatever data was contained.
*/
- function clear();
+ public function clear();
}
View
38 Session/SessionInterface.php
@@ -29,7 +29,7 @@
*
* @api
*/
- function start();
+ public function start();
/**
* Returns the session ID.
@@ -38,7 +38,7 @@ function start();
*
* @api
*/
- function getId();
+ public function getId();
/**
* Sets the session ID
@@ -47,7 +47,7 @@ function getId();
*
* @api
*/
- function setId($id);
+ public function setId($id);
/**
* Returns the session name.
@@ -56,7 +56,7 @@ function setId($id);
*
* @api
*/
- function getName();
+ public function getName();
/**
* Sets the session name.
@@ -65,7 +65,7 @@ function getName();
*
* @api
*/
- function setName($name);
+ public function setName($name);
/**
* Invalidates the current session.
@@ -82,7 +82,7 @@ function setName($name);
*
* @api
*/
- function invalidate($lifetime = null);
+ public function invalidate($lifetime = null);
/**
* Migrates the current session to a new session id while maintaining all
@@ -98,7 +98,7 @@ function invalidate($lifetime = null);
*
* @api
*/
- function migrate($destroy = false, $lifetime = null);
+ public function migrate($destroy = false, $lifetime = null);
/**
* Force the session to be saved and closed.
@@ -107,7 +107,7 @@ function migrate($destroy = false, $lifetime = null);
* the session will be automatically saved at the end of
* code execution.
*/
- function save();
+ public function save();
/**
* Checks if an attribute is defined.
@@ -118,7 +118,7 @@ function save();
*
* @api
*/
- function has($name);
+ public function has($name);
/**
* Returns an attribute.
@@ -130,7 +130,7 @@ function has($name);
*
* @api
*/
- function get($name, $default = null);
+ public function get($name, $default = null);
/**
* Sets an attribute.
@@ -140,7 +140,7 @@ function get($name, $default = null);
*
* @api
*/
- function set($name, $value);
+ public function set($name, $value);
/**
* Returns attributes.
@@ -149,14 +149,14 @@ function set($name, $value);
*
* @api
*/
- function all();
+ public function all();
/**
* Sets attributes.
*
* @param array $attributes Attributes
*/
- function replace(array $attributes);
+ public function replace(array $attributes);
/**
* Removes an attribute.
@@ -167,28 +167,28 @@ function replace(array $attributes);
*
* @api
*/
- function remove($name);
+ public function remove($name);
/**
* Clears all attributes.
*
* @api
*/
- function clear();
+ public function clear();
/**
* Checks if the session was started.
*
* @return Boolean
*/
- function isStarted();
+ public function isStarted();
/**
* Registers a SessionBagInterface with the session.
*
* @param SessionBagInterface $bag
*/
- function registerBag(SessionBagInterface $bag);
+ public function registerBag(SessionBagInterface $bag);
/**
* Gets a bag instance by name.
@@ -197,12 +197,12 @@ function registerBag(SessionBagInterface $bag);
*
* @return SessionBagInterface
*/
- function getBag($name);
+ public function getBag($name);
/**
* Gets session meta.
*
* @return MetadataBag
*/
- function getMetadataBag();
+ public function getMetadataBag();
}
View
2  Session/Storage/Proxy/SessionHandlerProxy.php
@@ -42,7 +42,7 @@ public function __construct(\SessionHandlerInterface $handler)
*/
public function open($savePath, $sessionName)
{
- $return = (bool)$this->handler->open($savePath, $sessionName);
+ $return = (bool) $this->handler->open($savePath, $sessionName);
if (true === $return) {
$this->active = true;
View
24 Session/Storage/SessionStorageInterface.php
@@ -33,14 +33,14 @@
*
* @api
*/
- function start();
+ public function start();
/**
* Checks if the session is started.
*
* @return boolean True if started, false otherwise.
*/
- function isStarted();
+ public function isStarted();
/**
* Returns the session ID
@@ -49,7 +49,7 @@ function isStarted();
*
* @api
*/
- function getId();
+ public function getId();
/**
* Sets the session ID
@@ -58,7 +58,7 @@ function getId();
*
* @api
*/
- function setId($id);
+ public function setId($id);
/**
* Returns the session name
@@ -67,7 +67,7 @@ function setId($id);
*
* @api
*/
- function getName();
+ public function getName();
/**
* Sets the session name
@@ -76,7 +76,7 @@ function getName();
*
* @api
*/
- function setName($name);
+ public function setName($name);
/**
* Regenerates id that represents this storage.
@@ -101,7 +101,7 @@ function setName($name);
*
* @api
*/
- function regenerate($destroy = false, $lifetime = null);
+ public function regenerate($destroy = false, $lifetime = null);
/**
* Force the session to be saved and closed.
@@ -111,12 +111,12 @@ function regenerate($destroy = false, $lifetime = null);
* a real PHP session would interfere with testing, in which case it
* it should actually persist the session data if required.
*/
- function save();
+ public function save();
/**
* Clear all session data in memory.
*/
- function clear();
+ public function clear();
/**
* Gets a SessionBagInterface by name.
@@ -127,17 +127,17 @@ function clear();
*
* @throws \InvalidArgumentException If the bag does not exist
*/
- function getBag($name);
+ public function getBag($name);
/**
* Registers a SessionBagInterface for use.
*
* @param SessionBagInterface $bag
*/
- function registerBag(SessionBagInterface $bag);
+ public function registerBag(SessionBagInterface $bag);
/**
* @return MetadataBag
*/
- function getMetadataBag();
+ public function getMetadataBag();
}
View
2  Tests/File/UploadedFileTest.php
@@ -132,7 +132,6 @@ public function testMoveLocalFileIsAllowedInTestMode()
@unlink($targetPath);
}
-
public function testGetClientOriginalNameSanitizeFilename()
{
$file = new UploadedFile(
@@ -207,7 +206,6 @@ public function testIsInvalidOnUploadError($error)
$this->assertFalse($file->isValid());
}
-
public function uploadedFileErrorProvider()
{
return array(
View
1  Tests/ParameterBagTest.php
@@ -200,7 +200,6 @@ public function testFilter()
$this->assertEquals(array('bang'), $bag->filter('array', '', false), '->filter() gets a value of parameter as an array');
-
}
/**
View
2  Tests/RequestMatcherTest.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\HttpFoundation\Tests;
-
-
use Symfony\Component\HttpFoundation\RequestMatcher;
use Symfony\Component\HttpFoundation\Request;
View
1  Tests/RequestTest.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\HttpFoundation\Tests;
-
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Request;
View
1  Tests/Session/Storage/Handler/NullSessionHandlerTest.php
@@ -55,4 +55,3 @@ public function getStorage()
return new NativeSessionStorage(array(), new NullSessionHandler());
}
}
-
View
1  Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
@@ -61,4 +61,3 @@ public function testSessionGC()
$this->assertEquals(0, count($this->pdo->query('SELECT * FROM sessions')->fetchAll()));
}
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.