This commit is contained in:
Fabien Potencier 2011-12-18 14:33:54 +01:00
parent 73fc8f6ec5
commit 6504d05804
26 changed files with 124 additions and 121 deletions

View File

@ -67,7 +67,7 @@
<service id="translation.loader.mo" class="%translation.loader.mo.class%">
<tag name="translation.loader" alias="mo" />
</service>
<service id="translation.loader.qt" class="%translation.loader.qt.class%">
<tag name="translation.loader" alias="ts" />
</service>

View File

@ -45,6 +45,7 @@ class SessionController extends ContainerAware
public function logoutAction()
{
$request = $this->container->get('request')->getSession('session')->clear();
return new Response('Session cleared.');
}

View File

@ -48,9 +48,9 @@ class SecurityExtension extends Extension
if (!array_filter($configs)) {
return;
}
$mainConfig = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($mainConfig, $configs);
// load services

View File

@ -16,4 +16,4 @@ class FormLoginExtension extends Extension
->addArgument(new Reference('router'))
;
}
}
}

View File

@ -21,4 +21,4 @@ class LocalizedFormFailureHandler implements AuthenticationFailureHandlerInterfa
{
return new RedirectResponse($this->router->generate('localized_login_path', array(), true));
}
}
}

View File

@ -15,6 +15,6 @@ security:
default:
form_login:
login_path: localized_login_path
check_path: localized_check_path
check_path: localized_check_path
failure_handler: localized_form_failure_handler
anonymous: ~
anonymous: ~

View File

@ -49,10 +49,10 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
$this->allowNewKeys = true;
$this->performDeepMerging = true;
}
/**
* Retrieves the children of this node.
*
*
* @return array The children
*/
public function getChildren()

View File

@ -54,17 +54,17 @@ abstract class BaseNode implements NodeInterface
$this->required = false;
$this->equivalentValues = array();
}
/**
* Sets info message
*
*
* @param string $info The info text
*/
public function setInfo($info)
{
$this->info = $info;
}
/**
* Returns info message
*
@ -77,8 +77,8 @@ abstract class BaseNode implements NodeInterface
/**
* Sets the example configuration for this node.
*
* @param array $example
*
* @param array $example
*/
public function setExample($example)
{
@ -87,7 +87,7 @@ abstract class BaseNode implements NodeInterface
/**
* Retrieves the example configuration for this node.
*
*
* @return mixed The example
*/
public function getExample()

View File

@ -62,32 +62,32 @@ abstract class NodeDefinition implements NodeParentInterface
return $this;
}
/**
* Sets info message
*
*
* @param string $info The info text
*
*
* @return NodeDefinition
*/
public function setInfo($info)
{
$this->info = $info;
return $this;
}
/**
* Sets example configuration
*
*
* @param example $example
*
*
* @return NodeDefinition
*/
public function setExample($example)
{
$this->example = $example;
return $this;
}
@ -121,9 +121,9 @@ abstract class NodeDefinition implements NodeParentInterface
if (null !== $this->validation) {
$this->validation->rules = ExprBuilder::buildExpressions($this->validation->rules);
}
$node = $this->createNode();
$node->setInfo($this->info);
$node->setExample($this->example);

View File

@ -80,7 +80,7 @@ class PrototypedArrayNode extends ArrayNode
/**
* Retrieves the name of the attribute which value should be used as key.
*
*
* @return string The name of the attribute
*/
public function getKeyAttribute()
@ -133,10 +133,10 @@ class PrototypedArrayNode extends ArrayNode
{
$this->prototype = $node;
}
/**
* Retrieves the prototype
*
*
* @return PrototypeNodeInterface The prototype
*/
public function getPrototype()

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* ConfigurationExtensionInterface is the interface implemented by container extension classes.
*
@ -22,10 +22,10 @@ interface ConfigurationExtensionInterface
{
/**
* Returns extension configuration
*
*
* @param array $config $config An array of configuration values
* @param ContainerBuilder $container A ContainerBuilder instance
*
*
* @return ConfigurationInterface|null The configuration or null
*/
function getConfiguration(array $config, ContainerBuilder $container);

View File

@ -38,7 +38,7 @@ class Event
* @var EventDispatcher Dispatcher that dispatched this event
*/
private $dispatcher;
/**
* @var string This event's name
*/
@ -94,24 +94,24 @@ class Event
{
return $this->dispatcher;
}
/**
* Gets the event's name.
*
*
* @return string
*
*
* @api
*/
public function getName()
{
return $this->name;
}
/**
* Sets the event's name property.
*
*
* @param string $name The event name.
*
*
* @api
*/
public function setName($name)

View File

@ -22,7 +22,7 @@ class ParameterBag
{
/**
* Parameter storage.
*
*
* @var array
*/
protected $parameters;

View File

@ -75,62 +75,62 @@ class Request
* @var string
*/
protected $content;
/**
* @var string
*/
protected $languages;
/**
* @var string
*/
protected $charsets;
/**
* @var string
*/
protected $acceptableContentTypes;
/**
* @var string
*/
protected $pathInfo;
/**
* @var string
*/
protected $requestUri;
/**
* @var string
*/
protected $baseUrl;
/**
* @var string
*/
protected $basePath;
/**
* @var string
*/
protected $method;
/**
* @var string
*/
protected $format;
/**
* @var \Symfony\Component\HttpFoundation\Session
*/
protected $session;
/**
* @var string
*/
protected $locale;
/**
* @var string
*/
@ -957,16 +957,16 @@ class Request
*
* @api
*/
public function getContentType()
public function getContentType()
{
return $this->getFormat($this->server->get('CONTENT_TYPE'));
}
/**
* Sets the default locale.
*
* @param string $locale
*
*
* @param string $locale
*
* @api
*/
public function setDefaultLocale($locale)
@ -976,9 +976,9 @@ class Request
/**
* Sets the locale.
*
* @param string $locale
*
*
* @param string $locale
*
* @api
*/
public function setLocale($locale)
@ -988,7 +988,7 @@ class Request
/**
* Get the locale.
*
*
* @return string
*/
public function getLocale()
@ -1234,8 +1234,8 @@ class Request
/**
* Prepares the base URL.
*
* @return string
*
* @return string
*/
protected function prepareBaseUrl()
{
@ -1374,8 +1374,8 @@ class Request
/**
* Sets the default PHP locale.
*
* @param string $locale
*
* @param string $locale
*/
private function setPhpDefaultLocale($locale)
{

View File

@ -24,26 +24,26 @@ class RequestMatcher implements RequestMatcherInterface
* @var string
*/
private $path;
/**
* @var string
*/
private $host;
/**
* @var string
*/
private $methods;
/**
* @var string
* @var string
*/
private $ip;
/**
* Attributes.
*
* @var array
*
* @var array
*/
private $attributes;
@ -145,10 +145,10 @@ class RequestMatcher implements RequestMatcherInterface
/**
* Validates an IP address.
*
*
* @param string $requestIp
* @param string $ip
*
*
* @return boolean True valid, false if not.
*/
protected function checkIp($requestIp, $ip)
@ -163,10 +163,10 @@ class RequestMatcher implements RequestMatcherInterface
/**
* Validates an IPv4 address.
*
*
* @param string $requestIp
* @param string $ip
*
*
* @return boolean True valid, false if not.
*/
protected function checkIp4($requestIp, $ip)
@ -187,13 +187,13 @@ class RequestMatcher implements RequestMatcherInterface
/**
* Validates an IPv6 address.
*
*
* @author David Soria Parra <dsp at php dot net>
* @see https://github.com/dsp/v6tools
*
*
* @param string $requestIp
* @param string $ip
*
*
* @return boolean True valid, false if not.
*/
protected function checkIp6($requestIp, $ip)

View File

@ -29,22 +29,22 @@ class Response
* @var string
*/
protected $content;
/**
* @var string
*/
protected $version;
/**
* @var integer
*/
protected $statusCode;
/**
* @var string
*/
protected $statusText;
/**
* @var string
*/
@ -851,9 +851,9 @@ class Response
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
/**
* Is response invalid?
*
*
* @return boolean
*
*
* @api
*/
public function isInvalid()
@ -863,9 +863,9 @@ class Response
/**
* Is response informative?
*
*
* @return boolean
*
*
* @api
*/
public function isInformational()
@ -875,9 +875,9 @@ class Response
/**
* Is response successful?
*
*
* @return boolean
*
*
* @api
*/
public function isSuccessful()
@ -887,9 +887,9 @@ class Response
/**
* Is the response a redirect?
*
*
* @return boolean
*
*
* @api
*/
public function isRedirection()
@ -899,9 +899,9 @@ class Response
/**
* Is there a client error?
*
*
* @return boolean
*
*
* @api
*/
public function isClientError()
@ -911,9 +911,9 @@ class Response
/**
* Was there a server side error?
*
*
* @return boolean
*
*
* @api
*/
public function isServerError()
@ -923,9 +923,9 @@ class Response
/**
* Is the response OK?
*
*
* @return boolean
*
*
* @api
*/
public function isOk()
@ -935,9 +935,9 @@ class Response
/**
* Is the reponse forbidden?
*
*
* @return boolean
*
*
* @api
*/
public function isForbidden()
@ -947,9 +947,9 @@ class Response
/**
* Is the response a not found error?
*
*
* @return boolean
*
*
* @api
*/
public function isNotFound()
@ -959,9 +959,9 @@ class Response
/**
* Is the response a redirect of some form?
*
*
* @return boolean
*
*
* @api
*/
public function isRedirect($location = null)
@ -971,13 +971,13 @@ class Response
/**
* Is the response empty?
*
*
* @return boolean
*
*
* @api
*/
public function isEmpty()
{
return in_array($this->statusCode, array(201, 204, 304));
}
}
}

View File

@ -30,7 +30,7 @@ class ResponseHeaderBag extends HeaderBag
* @var array
*/
protected $computedCacheControl = array();
/**
* @var array
*/

View File

@ -21,8 +21,8 @@ class ServerBag extends ParameterBag
{
/**
* Gets the HTTP headers.
*
* @return string
*
* @return string
*/
public function getHeaders()
{

View File

@ -24,7 +24,7 @@ class ArraySessionStorage implements SessionStorageInterface
{
/**
* Storage data.
*
*
* @var array
*/
private $data = array();

View File

@ -25,21 +25,21 @@ class FilesystemSessionStorage extends NativeSessionStorage
{
/**
* File path.
*
*
* @var string
*/
private $path;
/**
* Data.
*
*
* @var array
*/
private $data;
/**
* Session started flag.
*
*
* @var boolean
*/
private $started;

View File

@ -21,14 +21,14 @@ class PdoSessionStorage extends NativeSessionStorage
{
/**
* PDO instance.
*
*
* @var \PDO
*/
private $db;
/**
* Database options.
*
*
* @var array
*/
private $dbOptions;
@ -253,7 +253,7 @@ class PdoSessionStorage extends NativeSessionStorage
*
* @param string $id
* @param string $data
*
*
* @return boolean True.
*/
private function createNewSession($id, $data = '')
@ -276,4 +276,4 @@ class PdoSessionStorage extends NativeSessionStorage
return true;
}
}
}

View File

@ -32,4 +32,4 @@ class AuthenticationEvent extends Event
{
return $this->authenticationToken;
}
}
}

View File

@ -34,4 +34,4 @@ class AuthenticationFailureEvent extends AuthenticationEvent
{
return $this->authenticationException;
}
}
}

View File

@ -310,6 +310,7 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
&& $encoder->supportsEncoding($format)
) {
$this->encoderByFormat[$format] = $i;
return $encoder;
}
}
@ -333,6 +334,7 @@ class Serializer implements SerializerInterface, NormalizerInterface, Denormaliz
&& $encoder->supportsDecoding($format)
) {
$this->decoderByFormat[$format] = $i;
return $encoder;
}
}

View File

@ -166,4 +166,4 @@ class MoFileLoader extends ArrayLoader implements LoaderInterface
return (integer) substr($result, -8);
}
}
}

View File

@ -26,7 +26,7 @@ class ListCommandTest extends \PHPUnit_Framework_TestCase
$commandTester->execute(array('command' => $command->getName(), '--xml' => true));
$this->assertRegExp('/<command id="list" name="list">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
$commandTester->execute(array('command' => $command->getName(), '--raw' => true));
$output = <<<EOF
help Displays help for a command