Merge branch '2.6' into 2.7

* 2.6:
  Configure firewall's kernel exception listener with configured entry point or a default entry point
  PSR-2 fixes
  [DependencyInjection] make paths relative to __DIR__ in the generated container
  [FrameworkBundle][Router Cmd] use debug namespace.
  [FrameworkBundle] Update deprecated service call
  Removed a dev annotation from a version constraint
  Fixed the syntax of a composer.json file
  Fixed the symfony/config version constraint
  Tweaked the password-compat version constraint
  Docblock fixes
  [Filesystem] fix lock file permissions
  Remove dialog usage
  define constant only if it wasn't defined before
  Fix incorrect spanish translation
  Fixed typos
  Fixed a docblock
  bumped Symfony version to 2.6.1
  updated VERSION for 2.6.0
  updated CHANGELOG for 2.6.0
  removed unneeded check

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
This commit is contained in:
Fabien Potencier 2014-12-02 21:19:50 +01:00
commit eee117285a
389 changed files with 1763 additions and 1500 deletions

View File

@ -7,6 +7,14 @@ in 2.6 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.6.0...v2.6.1
* 2.6.0 (2014-11-28)
* bug #12553 [Debug] fix error message on double exception (nicolas-grekas)
* bug #12550 [FrameworkBundle] backport #12489 (xabbuh)
* bug #12437 [Validator] make DateTime objects represented as strings in the violation message (hhamon)
* bug #12575 [WebProfilerBundle] Remove usage of app.request in search bar template (jeromemacias)
* bug #12570 Fix initialized() with aliased services (Daniel Wehner)
* 2.6.0-BETA2 (2014-11-23)
* bug #12555 [Debug] fix ENT_SUBSTITUTE usage (nicolas-grekas)

View File

@ -74,7 +74,7 @@
"doctrine/doctrine-bundle": "~1.2",
"monolog/monolog": "~1.11",
"propel/propel1": "~1.6",
"ircmaxell/password-compat": "1.0.*",
"ircmaxell/password-compat": "~1.0",
"ocramius/proxy-manager": ">=0.3.1,<0.6-dev",
"egulias/email-validator": "~1.2"
},

View File

@ -40,10 +40,11 @@ class ContainerAwareEventManager extends EventManager
/**
* Dispatches an event to all registered listeners.
*
* @param string $eventName The name of the event to dispatch. The name of the event is
* the name of the method that is invoked on listeners.
* @param string $eventName The name of the event to dispatch. The name of the event is
* the name of the method that is invoked on listeners.
* @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners.
* If not supplied, the single empty EventArgs instance is used.
*
* @return bool
*/
public function dispatchEvent($eventName, EventArgs $eventArgs = null)
@ -81,7 +82,7 @@ class ContainerAwareEventManager extends EventManager
*
* @param string $event
*
* @return bool TRUE if the specified event has any listeners, FALSE otherwise.
* @return bool TRUE if the specified event has any listeners, FALSE otherwise.
*/
public function hasListeners($event)
{

View File

@ -398,9 +398,12 @@ abstract class AbstractDoctrineExtension extends Extension
/**
* Returns a modified version of $managerConfigs.
*
* The manager called $autoMappedManager will map all bundles that are not mepped by other managers.
*
* @param array $managerConfigs
* @param array $bundles
*
* @return array The modified version of $managerConfigs.
*/
protected function fixManagersAutoMappings(array $managerConfigs, array $bundles)

View File

@ -35,7 +35,7 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
* @param string $connections Parameter ID for connections
* @param string $managerTemplate sprintf() template for generating the event
* manager's service ID for a connection name
* @param string $tagPrefix Tag prefix for listeners and subscribers
* @param string $tagPrefix Tag prefix for listeners and subscribers
*/
public function __construct($connections, $managerTemplate, $tagPrefix)
{

View File

@ -168,7 +168,7 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
* @return string The name of the chain driver service
*
* @throws ParameterNotFoundException if non of the managerParameters has a
* non-empty value.
* non-empty value.
*/
protected function getChainDriverServiceName(ContainerBuilder $container)
{
@ -179,7 +179,7 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
* Create the service definition for the metadata driver.
*
* @param ContainerBuilder $container passed on in case an extending class
* needs access to the container.
* needs access to the container.
*
* @return Definition|Reference the metadata driver to add to all chain drivers
*/

View File

@ -369,8 +369,8 @@ class EntityChoiceList extends ObjectChoiceList
*
* @param mixed $entity The choice to create an index for
*
* @return int|string A unique index containing only ASCII letters,
* digits and underscores.
* @return int|string A unique index containing only ASCII letters,
* digits and underscores.
*/
protected function createIndex($entity)
{
@ -390,7 +390,7 @@ class EntityChoiceList extends ObjectChoiceList
*
* @param mixed $entity The choice to create a value for
*
* @return int|string A unique value without character limitations.
* @return int|string A unique value without character limitations.
*/
protected function createValue($entity)
{
@ -448,7 +448,7 @@ class EntityChoiceList extends ObjectChoiceList
*
* @param object $entity The entity for which to get the identifier
*
* @return array The identifier values
* @return array The identifier values
*
* @throws RuntimeException If the entity does not exist in Doctrine's identity map
*/

View File

@ -31,7 +31,7 @@ interface EntityLoaderInterface
* @param string $identifier The identifier field of the object. This method
* is not applicable for fields with multiple
* identifiers.
* @param array $values The values of the identifiers.
* @param array $values The values of the identifiers.
*
* @return array The entities.
*/

View File

@ -54,7 +54,7 @@ class CollectionToArrayTransformer implements DataTransformerInterface
*
* @param mixed $array An array of entities
*
* @return Collection A collection of entities
* @return Collection A collection of entities
*/
public function reverseTransform($array)
{

View File

@ -22,6 +22,7 @@ class EntityType extends DoctrineType
* @param ObjectManager $manager
* @param mixed $queryBuilder
* @param string $class
*
* @return ORMQueryBuilderLoader
*/
public function getLoader(ObjectManager $manager, $queryBuilder, $class)

View File

@ -52,8 +52,8 @@ class WebProcessorTest extends \PHPUnit_Framework_TestCase
}
/**
* @param int $level
* @param string $message
* @param int $level
* @param string $message
*
* @return array Record
*/

View File

@ -368,8 +368,8 @@ class ModelChoiceList extends ObjectChoiceList
*
* @param mixed $model The choice to create an index for
*
* @return int|string A unique index containing only ASCII letters,
* digits and underscores.
* @return int|string A unique index containing only ASCII letters,
* digits and underscores.
*/
protected function createIndex($model)
{
@ -389,7 +389,7 @@ class ModelChoiceList extends ObjectChoiceList
*
* @param mixed $model The choice to create a value for
*
* @return int|string A unique value without character limitations.
* @return int|string A unique value without character limitations.
*/
protected function createValue($model)
{

View File

@ -47,8 +47,8 @@ class PropelUserProvider implements UserProviderInterface
/**
* Default constructor
*
* @param string $class The User model class.
* @param string|null $property The property to use to retrieve a user.
* @param string $class The User model class.
* @param string|null $property The property to use to retrieve a user.
*/
public function __construct($class, $property = null)
{

View File

@ -97,7 +97,7 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr
/**
* @param string $name
* @param mixed $value
* @param mixed $value
*/
public function __set($name, $value)
{

View File

@ -21,7 +21,7 @@
"ocramius/proxy-manager": ">=0.3.1,<0.6-dev"
},
"require-dev": {
"symfony/config": "2.3"
"symfony/config": "~2.3"
},
"autoload": {
"psr-0": {

View File

@ -152,9 +152,9 @@ class CodeExtension extends \Twig_Extension
/**
* Formats a file path.
*
* @param string $file An absolute file path
* @param int $line The line number
* @param string $text Use this text for the link rather than the file path
* @param string $file An absolute file path
* @param int $line The line number
* @param string $text Use this text for the link rather than the file path
*
* @return string
*/
@ -189,8 +189,8 @@ class CodeExtension extends \Twig_Extension
/**
* Returns the link for a given file/line pair.
*
* @param string $file An absolute file path
* @param int $line The line number
* @param string $file An absolute file path
* @param int $line The line number
*
* @return string A link of false
*/

View File

@ -137,7 +137,7 @@ class FormExtension extends \Twig_Extension
* @param ChoiceView $choice The choice to check.
* @param string|array $selectedValue The selected value to compare.
*
* @return bool Whether the choice is selected.
* @return bool Whether the choice is selected.
*
* @see ChoiceView::isSelected()
*/

View File

@ -36,7 +36,7 @@ class HttpKernelExtension extends \Twig_Extension
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('render',array($this, 'renderFragment'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('render', array($this, 'renderFragment'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('render_*', array($this, 'renderFragmentStrategy'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('controller', array($this, 'controller')),
);
@ -45,8 +45,8 @@ class HttpKernelExtension extends \Twig_Extension
/**
* Renders a fragment.
*
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
* @param array $options An array of options
* @param string|ControllerReference $uri A URI as a string or a ControllerReference instance
* @param array $options An array of options
*
* @return string The fragment content
*

View File

@ -74,7 +74,7 @@ class TwigRendererEngine extends AbstractRendererEngine implements TwigRendererE
* @param FormView $view The form view for finding the applying themes.
* @param string $blockName The name of the block to load.
*
* @return bool True if the resource could be loaded, false otherwise.
* @return bool True if the resource could be loaded, false otherwise.
*/
protected function loadResourceForBlockName($cacheKey, FormView $view, $blockName)
{

View File

@ -49,7 +49,7 @@ class RouterCacheWarmer implements CacheWarmerInterface
/**
* Checks whether this warmer is optional or not.
*
* @return bool always true
* @return bool always true
*/
public function isOptional()
{

View File

@ -55,7 +55,7 @@ class TemplatePathsCacheWarmer extends CacheWarmer
/**
* Checks whether this warmer is optional or not.
*
* @return bool always true
* @return bool always true
*/
public function isOptional()
{

View File

@ -96,7 +96,7 @@ EOF
} elseif (TraceableUrlMatcher::ROUTE_MATCHES == $trace['level']) {
$output->writeln(sprintf('<fg=green>Route "%s" matches</>', $trace['name']));
$routerDebugcommand = $this->getApplication()->find('router:debug');
$routerDebugcommand = $this->getApplication()->find('debug:router');
$output->writeln('');
$routerDebugcommand->run(new ArrayInput(array('name' => $trace['name'])), $output);

View File

@ -71,11 +71,6 @@ EOF
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (defined('HHVM_VERSION')) {
$output->writeln('<error>This command is not supported on HHVM.</error>');
return 1;
}
if (!extension_loaded('pcntl')) {
$output->writeln('<error>This command needs the pcntl extension to run.</error>');
$output->writeln('You can either install it or use the <info>server:run</info> command instead to run the built-in web server.');

View File

@ -63,7 +63,7 @@ class Application extends BaseApplication
* @param InputInterface $input An Input instance
* @param OutputInterface $output An Output instance
*
* @return int 0 if everything went fine, or an error code
* @return int 0 if everything went fine, or an error code
*/
public function doRun(InputInterface $input, OutputInterface $output)
{

View File

@ -38,9 +38,9 @@ class Controller extends ContainerAware
/**
* Generates a URL from the given parameters.
*
* @param string $route The name of the route
* @param mixed $parameters An array of parameters
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
* @param string $route The name of the route
* @param mixed $parameters An array of parameters
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
*
* @return string The generated URL
*
@ -71,8 +71,8 @@ class Controller extends ContainerAware
/**
* Returns a RedirectResponse to the given URL.
*
* @param string $url The URL to redirect to
* @param int $status The status code to use for the Response
* @param string $url The URL to redirect to
* @param int $status The status code to use for the Response
*
* @return RedirectResponse
*/
@ -123,11 +123,11 @@ class Controller extends ContainerAware
*/
protected function isGranted($attributes, $object = null)
{
if (!$this->container->has('security.context')) {
if (!$this->container->has('security.authorization_checker')) {
throw new \LogicException('The SecurityBundle is not registered in your application.');
}
return $this->container->get('security.context')->isGranted($attributes, $object);
return $this->container->get('security.authorization_checker')->isGranted($attributes, $object);
}
/**
@ -324,7 +324,7 @@ class Controller extends ContainerAware
*
* @param string $id The service id
*
* @return bool true if the service id is defined, false otherwise
* @return bool true if the service id is defined, false otherwise
*/
public function has($id)
{

View File

@ -48,7 +48,7 @@ class ControllerResolver extends BaseControllerResolver
*
* @return mixed A PHP callable
*
* @throws \LogicException When the name could not be parsed
* @throws \LogicException When the name could not be parsed
* @throws \InvalidArgumentException When the controller class does not exist
*/
protected function createController($controller)

View File

@ -34,10 +34,10 @@ class RedirectController extends ContainerAware
* In case the route name is empty, the status code will be 404 when permanent is false
* and 410 otherwise.
*
* @param Request $request The request instance
* @param string $route The route name to redirect to
* @param bool $permanent Whether the redirection is permanent
* @param bool|array $ignoreAttributes Whether to ignore attributes or an array of attributes to ignore
* @param Request $request The request instance
* @param string $route The route name to redirect to
* @param bool $permanent Whether the redirection is permanent
* @param bool|array $ignoreAttributes Whether to ignore attributes or an array of attributes to ignore
*
* @return Response A Response instance
*
@ -70,12 +70,12 @@ class RedirectController extends ContainerAware
* In case the path is empty, the status code will be 404 when permanent is false
* and 410 otherwise.
*
* @param Request $request The request instance
* @param string $path The absolute path or URL to redirect to
* @param bool $permanent Whether the redirect is permanent or not
* @param string|null $scheme The URL scheme (null to keep the current one)
* @param int|null $httpPort The HTTP port (null to keep the current one for the same scheme or the configured port in the container)
* @param int|null $httpsPort The HTTPS port (null to keep the current one for the same scheme or the configured port in the container)
* @param Request $request The request instance
* @param string $path The absolute path or URL to redirect to
* @param bool $permanent Whether the redirect is permanent or not
* @param string|null $scheme The URL scheme (null to keep the current one)
* @param int|null $httpPort The HTTP port (null to keep the current one for the same scheme or the configured port in the container)
* @param int|null $httpsPort The HTTPS port (null to keep the current one for the same scheme or the configured port in the container)
*
* @return Response A Response instance
*

View File

@ -24,10 +24,10 @@ class TemplateController extends ContainerAware
/**
* Renders a template.
*
* @param string $template The template name
* @param int|null $maxAge Max age for client caching
* @param int|null $sharedAge Max age for shared (proxy) caching
* @param bool|null $private Whether or not caching should apply for client caches only
* @param string $template The template name
* @param int|null $maxAge Max age for client caching
* @param int|null $sharedAge Max age for shared (proxy) caching
* @param bool|null $private Whether or not caching should apply for client caches only
*
* @return Response A Response instance
*/

View File

@ -298,7 +298,7 @@ class FrameworkExtension extends Extension
'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage',
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
);
list($class, ) = explode(':', $config['dsn'], 2);
list($class,) = explode(':', $config['dsn'], 2);
if (!isset($supported[$class])) {
throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class));
}

View File

@ -111,7 +111,7 @@ class GlobalVariables
/**
* Returns the current app debug mode.
*
* @return bool The current debug mode
* @return bool The current debug mode
*/
public function getDebug()
{

View File

@ -146,9 +146,9 @@ class CodeHelper extends Helper
/**
* Formats a file path.
*
* @param string $file An absolute file path
* @param int $line The line number
* @param string $text Use this text for the link rather than the file path
* @param string $file An absolute file path
* @param int $line The line number
* @param string $text Use this text for the link rather than the file path
*
* @return string
*/
@ -181,8 +181,8 @@ class CodeHelper extends Helper
/**
* Returns the link for a given file/line pair.
*
* @param string $file An absolute file path
* @param int $line The line number
* @param string $file An absolute file path
* @param int $line The line number
*
* @return string A link of false
*/

View File

@ -36,9 +36,9 @@ class RouterHelper extends Helper
/**
* Generates a URL from the given parameters.
*
* @param string $name The name of the route
* @param mixed $parameters An array of parameters
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
* @param string $name The name of the route
* @param mixed $parameters An array of parameters
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
*
* @return string The generated URL
*

View File

@ -28,11 +28,11 @@ class TimedPhpEngine extends PhpEngine
/**
* Constructor.
*
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
* @param ContainerInterface $container A ContainerInterface instance
* @param LoaderInterface $loader A LoaderInterface instance
* @param Stopwatch $stopwatch A Stopwatch instance
* @param GlobalVariables $globals A GlobalVariables instance
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
* @param ContainerInterface $container A ContainerInterface instance
* @param LoaderInterface $loader A LoaderInterface instance
* @param Stopwatch $stopwatch A Stopwatch instance
* @param GlobalVariables $globals A GlobalVariables instance
*/
public function __construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, Stopwatch $stopwatch, GlobalVariables $globals = null)
{

View File

@ -36,7 +36,7 @@
"symfony/console": "~2.0",
"symfony/finder": "~2.0",
"symfony/security": "~2.4",
"symfony/form": "~2.6@dev",
"symfony/form": "~2.6",
"symfony/class-loader": "~2.1",
"symfony/expression-language": "~2.4",
"symfony/process": "~2.0",

View File

@ -65,7 +65,7 @@ class SecurityDataCollector extends DataCollector
/**
* Checks if security is enabled.
*
* @return bool true if security is enabled, false otherwise
* @return bool true if security is enabled, false otherwise
*/
public function isEnabled()
{
@ -95,7 +95,7 @@ class SecurityDataCollector extends DataCollector
/**
* Checks if the user is authenticated or not.
*
* @return bool true if the user is authenticated, false otherwise
* @return bool true if the user is authenticated, false otherwise
*/
public function isAuthenticated()
{

View File

@ -146,7 +146,7 @@ abstract class AbstractFactory implements SecurityFactoryInterface
*
* @param array $config
*
* @return bool Whether a possibly configured RememberMeServices should be set for this listener
* @return bool Whether a possibly configured RememberMeServices should be set for this listener
*/
protected function isRememberMeAware($config)
{

View File

@ -352,10 +352,10 @@ class SecurityExtension extends Extension
}
// Determine default entry point
$defaultEntryPoint = isset($firewall['entry_point']) ? $firewall['entry_point'] : null;
$configuredEntryPoint = isset($firewall['entry_point']) ? $firewall['entry_point'] : null;
// Authentication listeners
list($authListeners, $defaultEntryPoint) = $this->createAuthenticationListeners($container, $id, $firewall, $authenticationProviders, $defaultProvider, $defaultEntryPoint);
list($authListeners, $defaultEntryPoint) = $this->createAuthenticationListeners($container, $id, $firewall, $authenticationProviders, $defaultProvider, $configuredEntryPoint);
$listeners = array_merge($listeners, $authListeners);
@ -368,7 +368,7 @@ class SecurityExtension extends Extension
$listeners[] = new Reference('security.access_listener');
// Exception listener
$exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $defaultEntryPoint));
$exceptionListener = new Reference($this->createExceptionListener($container, $firewall, $id, $configuredEntryPoint ?: $defaultEntryPoint));
return array($matcher, $listeners, $exceptionListener);
}

View File

@ -88,8 +88,8 @@ class LogoutUrlHelper extends Helper
/**
* Generates the logout URL for the firewall.
*
* @param string $key The firewall key
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
* @param string $key The firewall key
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
*
* @return string The logout URL
*

View File

@ -35,6 +35,20 @@ class FirewallEntryPointTest extends WebTestCase
);
}
public function testItUsesTheConfiguredEntryPointFromTheExceptionListenerWithFormLoginAndNoCredentials()
{
$client = $this->createClient(array('test_case' => 'FirewallEntryPoint', 'root_config' => 'config_form_login.yml'));
$client->insulate();
$client->request('GET', '/secure/resource');
$this->assertEquals(
EntryPointStub::RESPONSE_TEXT,
$client->getResponse()->getContent(),
"Custom entry point wasn't started"
);
}
protected function setUp()
{
parent::setUp();

View File

@ -0,0 +1,9 @@
imports:
- { resource: ./config.yml }
security:
firewalls:
secure:
pattern: ^/
form_login:
check_path: /login_check

View File

@ -47,6 +47,7 @@ class LogoutUrlExtension extends \Twig_Extension
* Generate the relative logout URL for the firewall.
*
* @param string $key The firewall key
*
* @return string The relative logout URL
*/
public function getLogoutPath($key)
@ -58,6 +59,7 @@ class LogoutUrlExtension extends \Twig_Extension
* Generate the absolute logout URL for the firewall.
*
* @param string $key The firewall key
*
* @return string The absolute logout URL
*/
public function getLogoutUrl($key)

View File

@ -69,7 +69,7 @@ class TemplateCacheCacheWarmer implements CacheWarmerInterface
/**
* Checks whether this warmer is optional or not.
*
* @return bool always true
* @return bool always true
*/
public function isOptional()
{

View File

@ -75,7 +75,7 @@ class ExceptionController
}
/**
* @param int $startObLevel
* @param int $startObLevel
*
* @return string
*/
@ -93,7 +93,7 @@ class ExceptionController
/**
* @param Request $request
* @param string $format
* @param int $code An HTTP response status code
* @param int $code An HTTP response status code
* @param bool $showException
*
* @return TemplateReferenceInterface

View File

@ -155,8 +155,8 @@ class ProfilerController
/**
* Renders the Web Debug Toolbar.
*
* @param Request $request The current HTTP Request
* @param string $token The profiler token
* @param Request $request The current HTTP Request
* @param string $token The profiler token
*
* @return Response A Response instance
*

View File

@ -115,7 +115,7 @@
/**
* Query an element with a CSS selector.
*
* @param string selector a CSS-selector-compatible query string.
* @param string selector a CSS-selector-compatible query string.
*
* @return DOMElement|null
*/

View File

@ -100,9 +100,9 @@ class TemplateManagerTest extends TestCase
->will($this->returnCallback(array($this, 'profileHasCollectorCallback')));
$result = $this->templateManager->getTemplates($profile);
$this->assertArrayHasKey('foo',$result);
$this->assertArrayNotHasKey('bar',$result);
$this->assertArrayNotHasKey('baz',$result);
$this->assertArrayHasKey('foo', $result);
$this->assertArrayNotHasKey('bar', $result);
$this->assertArrayNotHasKey('baz', $result);
}
public function profilerHasCallback($panel)

View File

@ -65,7 +65,7 @@ abstract class Client
/**
* Sets whether to automatically follow redirects or not.
*
* @param bool $followRedirect Whether to follow redirects
* @param bool $followRedirect Whether to follow redirects
*
* @api
*/
@ -77,7 +77,7 @@ abstract class Client
/**
* Sets the maximum number of requests that crawler can follow.
*
* @param int $maxRedirects
* @param int $maxRedirects
*/
public function setMaxRedirects($maxRedirects)
{
@ -88,7 +88,7 @@ abstract class Client
/**
* Sets the insulated flag.
*
* @param bool $insulated Whether to insulate the requests or not
* @param bool $insulated Whether to insulate the requests or not
*
* @throws \RuntimeException When Symfony Process Component is not installed
*
@ -274,13 +274,13 @@ abstract class Client
/**
* Calls a URI.
*
* @param string $method The request method
* @param string $uri The URI to fetch
* @param array $parameters The Request parameters
* @param array $files The files
* @param array $server The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)
* @param string $content The raw body data
* @param bool $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
* @param string $method The request method
* @param string $uri The URI to fetch
* @param array $parameters The Request parameters
* @param array $files The files
* @param array $server The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)
* @param string $content The raw body data
* @param bool $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
*
* @return Crawler
*

View File

@ -48,14 +48,14 @@ class Cookie
/**
* Sets a cookie.
*
* @param string $name The cookie name
* @param string $value The value of the cookie
* @param string $expires The time the cookie expires
* @param string $path The path on the server in which the cookie will be available on
* @param string $domain The domain that the cookie is available
* @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
* @param bool $httponly The cookie httponly flag
* @param bool $encodedValue Whether the value is encoded or not
* @param string $name The cookie name
* @param string $value The value of the cookie
* @param string $expires The time the cookie expires
* @param string $path The path on the server in which the cookie will be available on
* @param string $domain The domain that the cookie is available
* @param bool $secure Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
* @param bool $httponly The cookie httponly flag
* @param bool $encodedValue Whether the value is encoded or not
*
* @api
*/
@ -297,7 +297,7 @@ class Cookie
/**
* Returns the secure flag of the cookie.
*
* @return bool The cookie secure flag
* @return bool The cookie secure flag
*
* @api
*/
@ -309,7 +309,7 @@ class Cookie
/**
* Returns the httponly flag of the cookie.
*
* @return bool The cookie httponly flag
* @return bool The cookie httponly flag
*
* @api
*/
@ -321,7 +321,7 @@ class Cookie
/**
* Returns true if the cookie has expired.
*
* @return bool true if the cookie has expired, false otherwise
* @return bool true if the cookie has expired, false otherwise
*
* @api
*/

View File

@ -198,8 +198,8 @@ class CookieJar
/**
* Returns not yet expired cookie values for the given URI.
*
* @param string $uri A URI
* @param bool $returnsRawValue Returns raw value or urldecoded value
* @param string $uri A URI
* @param bool $returnsRawValue Returns raw value or urldecoded value
*
* @return array An array of cookie values
*/

View File

@ -45,7 +45,7 @@ class History
/**
* Returns true if the history is empty.
*
* @return bool true if the history is empty, false otherwise
* @return bool true if the history is empty, false otherwise
*/
public function isEmpty()
{

View File

@ -30,9 +30,9 @@ class Response
* The headers array is a set of key/value pairs. If a header is present multiple times
* then the value is an array of all the values.
*
* @param string $content The content of the response
* @param int $status The response status code
* @param array $headers An array of headers
* @param string $content The content of the response
* @param int $status The response status code
* @param array $headers An array of headers
*
* @api
*/
@ -92,7 +92,7 @@ class Response
/**
* Gets the response status code.
*
* @return int The response status code
* @return int The response status code
*
* @api
*/
@ -116,8 +116,8 @@ class Response
/**
* Gets a response header.
*
* @param string $header The header name
* @param bool $first Whether to return the first value or all header values
* @param string $header The header name
* @param bool $first Whether to return the first value or all header values
*
* @return string|array The first header value if $first is true, an array of values otherwise
*/

View File

@ -202,9 +202,9 @@ class CookieJarTest extends \PHPUnit_Framework_TestCase
$cookieJar->set($cookie1 = new Cookie('foo', 'bar', null, '/', '.example.com'));
$cookieJar->set($cookie2 = new Cookie('foo1', 'bar', null, '/', 'test.example.com'));
$this->assertEquals($cookie1, $cookieJar->get('foo','/','foo.example.com'));
$this->assertEquals($cookie1, $cookieJar->get('foo','/','example.com'));
$this->assertEquals($cookie2, $cookieJar->get('foo1','/','test.example.com'));
$this->assertEquals($cookie1, $cookieJar->get('foo', '/', 'foo.example.com'));
$this->assertEquals($cookie1, $cookieJar->get('foo', '/', 'example.com'));
$this->assertEquals($cookie2, $cookieJar->get('foo1', '/', 'test.example.com'));
}
public function testCookieGetWithSubdirectory()
@ -213,11 +213,11 @@ class CookieJarTest extends \PHPUnit_Framework_TestCase
$cookieJar->set($cookie1 = new Cookie('foo', 'bar', null, '/test', '.example.com'));
$cookieJar->set($cookie2 = new Cookie('foo1', 'bar1', null, '/', '.example.com'));
$this->assertNull($cookieJar->get('foo','/','.example.com'));
$this->assertNull($cookieJar->get('foo','/bar','.example.com'));
$this->assertEquals($cookie1, $cookieJar->get('foo','/test','example.com'));
$this->assertEquals($cookie2, $cookieJar->get('foo1','/','example.com'));
$this->assertEquals($cookie2, $cookieJar->get('foo1','/bar','example.com'));
$this->assertNull($cookieJar->get('foo', '/', '.example.com'));
$this->assertNull($cookieJar->get('foo', '/bar', '.example.com'));
$this->assertEquals($cookie1, $cookieJar->get('foo', '/test', 'example.com'));
$this->assertEquals($cookie2, $cookieJar->get('foo1', '/', 'example.com'));
$this->assertEquals($cookie2, $cookieJar->get('foo1', '/bar', 'example.com'));
}
public function testCookieWithWildcardDomain()

View File

@ -54,8 +54,8 @@ class ApcClassLoader
/**
* Constructor.
*
* @param string $prefix The APC namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
* @param string $prefix The APC namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
*
* @throws \RuntimeException
* @throws \InvalidArgumentException
@ -79,7 +79,7 @@ class ApcClassLoader
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
@ -99,7 +99,7 @@ class ApcClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
* @return bool|null True, if loaded
*/
public function loadClass($class)
{

View File

@ -25,12 +25,12 @@ class ClassCollectionLoader
/**
* Loads a list of classes and caches them in one big file.
*
* @param array $classes An array of classes to load
* @param string $cacheDir A cache directory
* @param string $name The cache name prefix
* @param bool $autoReload Whether to flush the cache when the cache is stale or not
* @param bool $adaptive Whether to remove already declared classes or not
* @param string $extension File extension of the resulting file
* @param array $classes An array of classes to load
* @param string $cacheDir A cache directory
* @param string $name The cache name prefix
* @param bool $autoReload Whether to flush the cache when the cache is stale or not
* @param bool $adaptive Whether to remove already declared classes or not
* @param string $extension File extension of the resulting file
*
* @throws \InvalidArgumentException When class can't be loaded
*/
@ -335,10 +335,10 @@ class ClassCollectionLoader
* This function does not check for circular dependencies as it should never
* occur with PHP traits.
*
* @param array $tree The dependency tree
* @param \ReflectionClass $node The node
* @param \ArrayObject $resolved An array of already resolved dependencies
* @param \ArrayObject $unresolved An array of dependencies to be resolved
* @param array $tree The dependency tree
* @param \ReflectionClass $node The node
* @param \ArrayObject $resolved An array of already resolved dependencies
* @param \ArrayObject $unresolved An array of dependencies to be resolved
*
* @return \ArrayObject The dependencies for the given node
*

View File

@ -103,7 +103,7 @@ class ClassLoader
/**
* Turns on searching the include for class files.
*
* @param bool $useIncludePath
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
@ -124,7 +124,7 @@ class ClassLoader
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
@ -144,7 +144,7 @@ class ClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
* @return bool|null True, if loaded
*/
public function loadClass($class)
{

View File

@ -11,10 +11,12 @@
namespace Symfony\Component\ClassLoader;
if (PHP_VERSION_ID >= 50400) {
define('SYMFONY_TRAIT', T_TRAIT);
} else {
define('SYMFONY_TRAIT', 0);
if (!defined('SYMFONY_TRAIT')) {
if (PHP_VERSION_ID >= 50400) {
define('SYMFONY_TRAIT', T_TRAIT);
} else {
define('SYMFONY_TRAIT', 0);
}
}
/**

View File

@ -98,7 +98,7 @@ class DebugClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
* @return bool|null True, if loaded
*
* @throws \RuntimeException
*/

View File

@ -33,7 +33,7 @@ class MapClassLoader
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{

View File

@ -227,7 +227,7 @@ class WithComments
{
public static \$loaded = true;
}
\$string ='string shoult not be modified {\$string}';
\$string ='string should not be modified {\$string}';
\$heredoc = (<<<HD

View File

@ -17,7 +17,7 @@ class WithComments
public static $loaded = true;
}
$string = 'string shoult not be modified {$string}';
$string = 'string should not be modified {$string}';
$heredoc = (<<<HD

View File

@ -74,7 +74,7 @@ class UniversalClassLoader
* Turns on searching the include for class files. Allows easy loading
* of installed PEAR packages
*
* @param bool $useIncludePath
* @param bool $useIncludePath
*/
public function useIncludePath($useIncludePath)
{
@ -233,7 +233,7 @@ class UniversalClassLoader
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
* @param bool $prepend Whether to prepend the autoloader or not
*
* @api
*/
@ -247,7 +247,7 @@ class UniversalClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
* @return bool|null True, if loaded
*/
public function loadClass($class)
{

View File

@ -53,8 +53,8 @@ class WinCacheClassLoader
/**
* Constructor.
*
* @param string $prefix The WinCache namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
* @param string $prefix The WinCache namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
*
* @throws \RuntimeException
* @throws \InvalidArgumentException
@ -76,7 +76,7 @@ class WinCacheClassLoader
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
@ -96,7 +96,7 @@ class WinCacheClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
* @return bool|null True, if loaded
*/
public function loadClass($class)
{

View File

@ -52,8 +52,8 @@ class XcacheClassLoader
/**
* Constructor.
*
* @param string $prefix The XCache namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
* @param string $prefix The XCache namespace prefix to use.
* @param object $decorated A class loader object that implements the findFile() method.
*
* @throws \RuntimeException
* @throws \InvalidArgumentException
@ -77,7 +77,7 @@ class XcacheClassLoader
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
@ -97,7 +97,7 @@ class XcacheClassLoader
*
* @param string $class The name of the class
*
* @return bool|null True, if loaded
* @return bool|null True, if loaded
*/
public function loadClass($class)
{

View File

@ -31,8 +31,8 @@ class ConfigCache
/**
* Constructor.
*
* @param string $file The absolute cache path
* @param bool $debug Whether debugging is enabled or not
* @param string $file The absolute cache path
* @param bool $debug Whether debugging is enabled or not
*/
public function __construct($file, $debug)
{
@ -56,7 +56,7 @@ class ConfigCache
* This method always returns true when debug is off and the
* cache file exists.
*
* @return bool true if the cache is fresh, false otherwise
* @return bool true if the cache is fresh, false otherwise
*/
public function isFresh()
{

View File

@ -99,7 +99,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
* Sets whether to add default values for this array if it has not been
* defined in any of the configuration files.
*
* @param bool $boolean
* @param bool $boolean
*/
public function setAddIfNotSet($boolean)
{
@ -109,7 +109,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
/**
* Sets whether false is allowed as value indicating that the array should be unset.
*
* @param bool $allow
* @param bool $allow
*/
public function setAllowFalse($allow)
{
@ -119,7 +119,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
/**
* Sets whether new keys can be defined in subsequent configurations.
*
* @param bool $allow
* @param bool $allow
*/
public function setAllowNewKeys($allow)
{
@ -129,7 +129,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
/**
* Sets if deep merging should occur.
*
* @param bool $boolean
* @param bool $boolean
*/
public function setPerformDeepMerging($boolean)
{
@ -139,7 +139,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
/**
* Whether extra keys should just be ignore without an exception.
*
* @param bool $boolean To allow extra keys
* @param bool $boolean To allow extra keys
*/
public function setIgnoreExtraKeys($boolean)
{

View File

@ -133,7 +133,7 @@ abstract class BaseNode implements NodeInterface
/**
* Set this node as required.
*
* @param bool $boolean Required node
* @param bool $boolean Required node
*/
public function setRequired($boolean)
{
@ -143,7 +143,7 @@ abstract class BaseNode implements NodeInterface
/**
* Sets if this node can be overridden.
*
* @param bool $allow
* @param bool $allow
*/
public function setAllowOverwrite($allow)
{

View File

@ -97,7 +97,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
/**
* Adds children with a default value when none are defined.
*
* @param int|string|array|null $children The number of children|The child name|The children names to be added
* @param int|string|array|null $children The number of children|The child name|The children names to be added
*
* This method is applicable to prototype nodes only.
*
@ -176,8 +176,8 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
*
* This method is applicable to prototype nodes only.
*
* @param string $name The name of the key
* @param bool $removeKeyItem Whether or not the key item should be removed.
* @param string $name The name of the key
* @param bool $removeKeyItem Whether or not the key item should be removed.
*
* @return ArrayNodeDefinition
*/
@ -192,7 +192,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
/**
* Sets whether the node can be unset.
*
* @param bool $allow
* @param bool $allow
*
* @return ArrayNodeDefinition
*/
@ -295,7 +295,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
/**
* Sets key normalization.
*
* @param bool $bool Whether to enable key normalization
* @param bool $bool Whether to enable key normalization
*
* @return ArrayNodeDefinition
*/

View File

@ -35,7 +35,7 @@ class MergeBuilder
/**
* Sets whether the node can be unset.
*
* @param bool $allow
* @param bool $allow
*
* @return MergeBuilder
*/
@ -49,7 +49,7 @@ class MergeBuilder
/**
* Sets whether the node can be overwritten.
*
* @param bool $deny Whether the overwriting is forbidden or not
* @param bool $deny Whether the overwriting is forbidden or not
*
* @return MergeBuilder
*/

View File

@ -93,7 +93,7 @@ abstract class NodeDefinition implements NodeParentInterface
* Sets an attribute on the node.
*
* @param string $key
* @param mixed $value
* @param mixed $value
*
* @return NodeDefinition
*/
@ -117,7 +117,7 @@ abstract class NodeDefinition implements NodeParentInterface
/**
* Creates the node.
*
* @param bool $forceRootNode Whether to force this node as the root node
* @param bool $forceRootNode Whether to force this node as the root node
*
* @return NodeInterface
*/
@ -279,7 +279,7 @@ abstract class NodeDefinition implements NodeParentInterface
/**
* Sets whether the node can be overwritten.
*
* @param bool $deny Whether the overwriting is forbidden or not
* @param bool $deny Whether the overwriting is forbidden or not
*
* @return NodeDefinition
*/

View File

@ -38,21 +38,21 @@ interface NodeInterface
/**
* Returns true when the node is required.
*
* @return bool If the node is required
* @return bool If the node is required
*/
public function isRequired();
/**
* Returns true when the node has a default value.
*
* @return bool If the node has a default value
* @return bool If the node has a default value
*/
public function hasDefaultValue();
/**
* Returns the default value of the node.
*
* @return mixed The default value
* @return mixed The default value
* @throws \RuntimeException if the node has no default value
*/
public function getDefaultValue();

View File

@ -34,7 +34,7 @@ class PrototypedArrayNode extends ArrayNode
* Sets the minimum number of elements that a prototype based node must
* contain. By default this is zero, meaning no elements.
*
* @param int $number
* @param int $number
*/
public function setMinNumberOfElements($number)
{
@ -62,8 +62,8 @@ class PrototypedArrayNode extends ArrayNode
* If you'd like "'id' => 'my_name'" to still be present in the resulting
* array, then you can set the second argument of this method to false.
*
* @param string $attribute The name of the attribute which value is to be used as a key
* @param bool $remove Whether or not to remove the key
* @param string $attribute The name of the attribute which value is to be used as a key
* @param bool $remove Whether or not to remove the key
*/
public function setKeyAttribute($attribute, $remove = true)
{
@ -110,7 +110,7 @@ class PrototypedArrayNode extends ArrayNode
/**
* Adds default children when none are set.
*
* @param int|string|array|null $children The number of children|The child name|The children names to be added
* @param int|string|array|null $children The number of children|The child name|The children names to be added
*/
public function setAddChildrenIfNoneSet($children = array('defaults'))
{

View File

@ -55,7 +55,7 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface
/**
* Sets if this node is allowed to have an empty value.
*
* @param bool $boolean True if this entity will accept empty values.
* @param bool $boolean True if this entity will accept empty values.
*/
public function setAllowEmptyValue($boolean)
{

View File

@ -91,7 +91,7 @@ abstract class FileLoader extends Loader
}
$resources = is_array($resource) ? $resource : array($resource);
for ($i = 0; $i < $resourcesCount = count($resources); $i++ ) {
for ($i = 0; $i < $resourcesCount = count($resources); $i++) {
if (isset(self::$loading[$resources[$i]])) {
if ($i == $resourcesCount-1) {
throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading));

View File

@ -116,10 +116,10 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase
'string_key' => 'just value',
),
array(
0 => array (
0 => array(
'name' => 'something',
),
5 => array (
5 => array(
0 => 'this won\'t work too',
'new_key' => 'some other value',
),

View File

@ -33,16 +33,16 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
$this->assertFinalizedValueIs('new_value', $test, array('key' => true));
$test = $this->getTestBuilder()
->ifTrue( function ($v) { return true; })
->ifTrue(function ($v) { return true; })
->then($this->returnClosure('new_value'))
->end();
$this->assertFinalizedValueIs('new_value', $test);
$test = $this->getTestBuilder()
->ifTrue( function ($v) { return false; })
->ifTrue(function ($v) { return false; })
->then($this->returnClosure('new_value'))
->end();
$this->assertFinalizedValueIs('value',$test);
$this->assertFinalizedValueIs('value', $test);
}
public function testIfStringExpression()
@ -151,7 +151,8 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
}
/**
* Create a test treebuilder with a variable node, and init the validation
* Create a test treebuilder with a variable node, and init the validation.
*
* @return TreeBuilder
*/
protected function getTestBuilder()
@ -163,14 +164,16 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
->children()
->variableNode('key')
->validate()
;
;
}
/**
* Close the validation process and finalize with the given config
* Close the validation process and finalize with the given config.
*
* @param TreeBuilder $testBuilder The tree builder to finalize
* @param array $config The config you want to use for the finalization, if nothing provided
* a simple array('key'=>'value') will be used
* a simple array('key'=>'value') will be used
*
* @return array The finalized config values
*/
protected function finalizeTestBuilder($testBuilder, $config = null)
@ -185,8 +188,10 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
}
/**
* Return a closure that will return the given value
* @param $val The value that the closure must return
* Return a closure that will return the given value.
*
* @param mixed $val The value that the closure must return
*
* @return Closure
*/
protected function returnClosure($val)
@ -201,7 +206,8 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
*
* @param mixed $value The value to test
* @param TreeBuilder $treeBuilder The tree builder to finalize
* @param mixed $config The config values that new to be finalized
*
* @param mixed $config The config values that new to be finalized
*/
protected function assertFinalizedValueIs($value, $treeBuilder, $config = null)
{

View File

@ -828,8 +828,8 @@ class Application
if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) {
$input->setInteractive(false);
} elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
$inputStream = $this->getHelperSet()->get('dialog')->getInputStream();
} elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) {
$inputStream = $this->getHelperSet()->get('question')->getInputStream();
if (!@posix_isatty($inputStream)) {
$input->setInteractive(false);
}

View File

@ -159,7 +159,7 @@ class Command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return null|int null or 0 if everything went fine, or an error code
* @return null|int null or 0 if everything went fine, or an error code
*
* @throws \LogicException When this abstract method is not implemented
* @see setCode()
@ -202,7 +202,7 @@ class Command
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*
* @return int The command exit code
* @return int The command exit code
*
* @throws \Exception
*
@ -287,7 +287,7 @@ class Command
*
* This method is not part of public API and should not be used directly.
*
* @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments
* @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments
*/
public function mergeApplicationDefinition($mergeArgs = true)
{
@ -361,10 +361,10 @@ class Command
/**
* Adds an argument.
*
* @param string $name The argument name
* @param int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
* @param string $name The argument name
* @param int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
*
* @return Command The current instance
*
@ -380,11 +380,11 @@ class Command
/**
* Adds an option.
*
* @param string $name The option name
* @param string $shortcut The shortcut (can be null)
* @param int $mode The option mode: One of the InputOption::VALUE_* constants
* @param string $description A description text
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
* @param string $name The option name
* @param string $shortcut The shortcut (can be null)
* @param int $mode The option mode: One of the InputOption::VALUE_* constants
* @param string $description A description text
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
*
* @return Command The current instance
*
@ -513,7 +513,7 @@ class Command
* Returns the processed help for the command replacing the %command.name% and
* %command.full_name% patterns with the real values dynamically.
*
* @return string The processed help for the command
* @return string The processed help for the command
*/
public function getProcessedHelp()
{
@ -618,7 +618,7 @@ class Command
/**
* Returns an XML representation of the command.
*
* @param bool $asDom Whether to return a DOM or an XML string
* @param bool $asDom Whether to return a DOM or an XML string
*
* @return string|\DOMDocument An XML string representing the command
*

View File

@ -128,7 +128,7 @@ class MarkdownDescriptor extends Descriptor
$this->write("\n\n");
$this->write(implode("\n", array_map(function ($commandName) {
return '* '.$commandName;
} , $namespace['commands'])));
}, $namespace['commands'])));
}
foreach ($description->getCommands() as $command) {

View File

@ -58,7 +58,7 @@ class ConsoleExceptionEvent extends ConsoleEvent
/**
* Gets the exit code.
*
* @return int The command exit code
* @return int The command exit code
*/
public function getExitCode()
{

View File

@ -39,7 +39,7 @@ class ConsoleTerminateEvent extends ConsoleEvent
/**
* Sets the exit code.
*
* @param int $exitCode The command exit code
* @param int $exitCode The command exit code
*/
public function setExitCode($exitCode)
{
@ -49,7 +49,7 @@ class ConsoleTerminateEvent extends ConsoleEvent
/**
* Gets the exit code.
*
* @return int The command exit code
* @return int The command exit code
*/
public function getExitCode()
{

View File

@ -39,7 +39,7 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Initializes console output formatter.
*
* @param bool $decorated Whether this formatter should actually decorate strings
* @param bool $decorated Whether this formatter should actually decorate strings
* @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
*
* @api
@ -63,7 +63,7 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Sets the decorated flag.
*
* @param bool $decorated Whether to decorate the messages or not
* @param bool $decorated Whether to decorate the messages or not
*
* @api
*/
@ -75,7 +75,7 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Gets the decorated flag.
*
* @return bool true if the output will decorate messages, false otherwise
* @return bool true if the output will decorate messages, false otherwise
*
* @api
*/
@ -194,7 +194,7 @@ class OutputFormatter implements OutputFormatterInterface
*
* @param string $string
*
* @return OutputFormatterStyle|bool false if string is not format string
* @return OutputFormatterStyle|bool false if string is not format string
*/
private function createStyleFromString($string)
{

View File

@ -23,7 +23,7 @@ interface OutputFormatterInterface
/**
* Sets the decorated flag.
*
* @param bool $decorated Whether to decorate the messages or not
* @param bool $decorated Whether to decorate the messages or not
*
* @api
*/
@ -32,7 +32,7 @@ interface OutputFormatterInterface
/**
* Gets the decorated flag.
*
* @return bool true if the output will decorate messages, false otherwise
* @return bool true if the output will decorate messages, false otherwise
*
* @api
*/

View File

@ -62,7 +62,7 @@ class OutputFormatterStyleStack
*
* @return OutputFormatterStyleInterface
*
* @throws \InvalidArgumentException When style tags incorrectly nested
* @throws \InvalidArgumentException When style tags incorrectly nested
*/
public function pop(OutputFormatterStyleInterface $style = null)
{

View File

@ -37,11 +37,11 @@ class DialogHelper extends InputAwareHelper
* @param string|array $question The question to ask
* @param array $choices List of choices to pick from
* @param bool|string $default The default answer if the user enters nothing
* @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param bool|int $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param string $errorMessage Message which will be shown if invalid value from choice list would be picked
* @param bool $multiselect Select more than one value separated by comma
*
* @return int|string|array The selected value or values (the key of the choices array)
* @return int|string|array The selected value or values (the key of the choices array)
*
* @throws \InvalidArgumentException
*/
@ -235,7 +235,7 @@ class DialogHelper extends InputAwareHelper
* @param string|array $question The question to ask
* @param bool $default The default answer if the user enters nothing
*
* @return bool true if the user has confirmed, false otherwise
* @return bool true if the user has confirmed, false otherwise
*/
public function askConfirmation(OutputInterface $output, $question, $default = true)
{
@ -258,7 +258,7 @@ class DialogHelper extends InputAwareHelper
* @param string|array $question The question
* @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
*
* @return string The answer
* @return string The answer
*
* @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden
*/
@ -363,7 +363,7 @@ class DialogHelper extends InputAwareHelper
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
* @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
*
* @return string The response
* @return string The response
*
* @throws \Exception When any of the validators return an error
* @throws \RuntimeException In case the fallback is deactivated and the response can not be hidden
@ -413,7 +413,7 @@ class DialogHelper extends InputAwareHelper
/**
* Return a valid Unix shell
*
* @return string|bool The valid shell name, false in case no valid shell is found
* @return string|bool The valid shell name, false in case no valid shell is found
*/
private function getShell()
{
@ -451,12 +451,12 @@ class DialogHelper extends InputAwareHelper
/**
* Validate an attempt
*
* @param callable $interviewer A callable that will ask for a question and return the result
* @param OutputInterface $output An Output instance
* @param callable $validator A PHP callback
* @param int|false $attempts Max number of times to ask before giving up ; false will ask infinitely
* @param callable $interviewer A callable that will ask for a question and return the result
* @param OutputInterface $output An Output instance
* @param callable $validator A PHP callback
* @param int|false $attempts Max number of times to ask before giving up ; false will ask infinitely
*
* @return string The validated response
* @return string The validated response
*
* @throws \Exception In case the max number of attempts has been reached and no valid response has been given
*/

View File

@ -47,7 +47,7 @@ abstract class Helper implements HelperInterface
*
* @param string $string The string to check its length
*
* @return int The length of the string
* @return int The length of the string
*/
public static function strlen($string)
{

View File

@ -56,7 +56,7 @@ class HelperSet implements \IteratorAggregate
*
* @param string $name The helper name
*
* @return bool true if the helper is defined, false otherwise
* @return bool true if the helper is defined, false otherwise
*/
public function has($name)
{

View File

@ -227,8 +227,8 @@ class ProgressHelper extends Helper
/**
* Advances the progress output X steps.
*
* @param int $step Number of steps to advance
* @param bool $redraw Whether to redraw or not
* @param int $step Number of steps to advance
* @param bool $redraw Whether to redraw or not
*
* @throws \LogicException
*/
@ -240,8 +240,8 @@ class ProgressHelper extends Helper
/**
* Sets the current progress.
*
* @param int $current The current progress
* @param bool $redraw Whether to redraw or not
* @param int $current The current progress
* @param bool $redraw Whether to redraw or not
*
* @throws \LogicException
*/
@ -274,7 +274,7 @@ class ProgressHelper extends Helper
/**
* Outputs the current progress string.
*
* @param bool $finish Forces the end result
* @param bool $finish Forces the end result
*
* @throws \LogicException
*/
@ -347,7 +347,7 @@ class ProgressHelper extends Helper
/**
* Generates the array map of format variables to values.
*
* @param bool $finish Forces the end result
* @param bool $finish Forces the end result
*
* @return array Array of format vars and values
*/
@ -405,7 +405,7 @@ class ProgressHelper extends Helper
/**
* Converts seconds into human-readable format.
*
* @param int $secs Number of seconds
* @param int $secs Number of seconds
*
* @return string Time in readable format
*/
@ -430,8 +430,8 @@ class ProgressHelper extends Helper
/**
* Overwrites a previous message to the output.
*
* @param OutputInterface $output An Output instance
* @param string $message The message
* @param OutputInterface $output An Output instance
* @param string $message The message
*/
private function overwrite(OutputInterface $output, $message)
{

View File

@ -222,7 +222,7 @@ class TableHelper extends Helper
/**
* Sets cell padding type.
*
* @param int $padType STR_PAD_*
* @param int $padType STR_PAD_*
*
* @return TableHelper
*/

View File

@ -278,7 +278,7 @@ class ArgvInput extends Input
*
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
*
* @return bool true if the value is contained in the raw parameters
* @return bool true if the value is contained in the raw parameters
*/
public function hasParameterOption($values)
{

View File

@ -65,7 +65,7 @@ class ArrayInput extends Input
*
* @param string|array $values The values to look for in the raw parameters (can be an array)
*
* @return bool true if the value is contained in the raw parameters
* @return bool true if the value is contained in the raw parameters
*/
public function hasParameterOption($values)
{

View File

@ -81,7 +81,7 @@ abstract class Input implements InputInterface
/**
* Checks if the input is interactive.
*
* @return bool Returns true if the input is interactive
* @return bool Returns true if the input is interactive
*/
public function isInteractive()
{
@ -91,7 +91,7 @@ abstract class Input implements InputInterface
/**
* Sets the input interactivity.
*
* @param bool $interactive If the input should be interactive
* @param bool $interactive If the input should be interactive
*/
public function setInteractive($interactive)
{
@ -146,9 +146,9 @@ abstract class Input implements InputInterface
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
* @param string|int $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
* @return bool true if the InputArgument object exists, false otherwise
*/
public function hasArgument($name)
{
@ -186,8 +186,8 @@ abstract class Input implements InputInterface
/**
* Sets an option value by name.
*
* @param string $name The option name
* @param string|bool $value The option value
* @param string $name The option name
* @param string|bool $value The option value
*
* @throws \InvalidArgumentException When option given doesn't exist
*/
@ -205,7 +205,7 @@ abstract class Input implements InputInterface
*
* @param string $name The InputOption name
*
* @return bool true if the InputOption object exists, false otherwise
* @return bool true if the InputOption object exists, false otherwise
*/
public function hasOption($name)
{

View File

@ -32,10 +32,10 @@ class InputArgument
/**
* Constructor.
*
* @param string $name The argument name
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for self::OPTIONAL mode only)
* @param string $name The argument name
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param mixed $default The default value (for self::OPTIONAL mode only)
*
* @throws \InvalidArgumentException When argument mode is not valid
*
@ -69,7 +69,7 @@ class InputArgument
/**
* Returns true if the argument is required.
*
* @return bool true if parameter mode is self::REQUIRED, false otherwise
* @return bool true if parameter mode is self::REQUIRED, false otherwise
*/
public function isRequired()
{
@ -79,7 +79,7 @@ class InputArgument
/**
* Returns true if the argument can take multiple values.
*
* @return bool true if mode is self::IS_ARRAY, false otherwise
* @return bool true if mode is self::IS_ARRAY, false otherwise
*/
public function isArray()
{

View File

@ -144,7 +144,7 @@ class InputDefinition
/**
* Returns an InputArgument by name or by position.
*
* @param string|int $name The InputArgument name or position
* @param string|int $name The InputArgument name or position
*
* @return InputArgument An InputArgument object
*
@ -166,9 +166,9 @@ class InputDefinition
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
* @param string|int $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
* @return bool true if the InputArgument object exists, false otherwise
*
* @api
*/
@ -194,7 +194,7 @@ class InputDefinition
/**
* Returns the number of InputArguments.
*
* @return int The number of InputArguments
* @return int The number of InputArguments
*/
public function getArgumentCount()
{
@ -204,7 +204,7 @@ class InputDefinition
/**
* Returns the number of required InputArguments.
*
* @return int The number of required InputArguments
* @return int The number of required InputArguments
*/
public function getArgumentRequiredCount()
{
@ -310,7 +310,7 @@ class InputDefinition
*
* @param string $name The InputOption name
*
* @return bool true if the InputOption object exists, false otherwise
* @return bool true if the InputOption object exists, false otherwise
*
* @api
*/
@ -336,7 +336,7 @@ class InputDefinition
*
* @param string $name The InputOption shortcut
*
* @return bool true if the InputOption object exists, false otherwise
* @return bool true if the InputOption object exists, false otherwise
*/
public function hasShortcut($name)
{
@ -431,7 +431,7 @@ class InputDefinition
/**
* Returns an XML representation of the InputDefinition.
*
* @param bool $asDom Whether to return a DOM or an XML string
* @param bool $asDom Whether to return a DOM or an XML string
*
* @return string|\DOMDocument An XML string representing the InputDefinition
*

View File

@ -33,7 +33,7 @@ interface InputInterface
*
* @param string|array $values The values to look for in the raw parameters (can be an array)
*
* @return bool true if the value is contained in the raw parameters
* @return bool true if the value is contained in the raw parameters
*/
public function hasParameterOption($values);
@ -95,9 +95,9 @@ interface InputInterface
/**
* Returns true if an InputArgument object exists by name or position.
*
* @param string|int $name The InputArgument name or position
* @param string|int $name The InputArgument name or position
*
* @return bool true if the InputArgument object exists, false otherwise
* @return bool true if the InputArgument object exists, false otherwise
*/
public function hasArgument($name);
@ -120,8 +120,8 @@ interface InputInterface
/**
* Sets an option value by name.
*
* @param string $name The option name
* @param string|bool $value The option value
* @param string $name The option name
* @param string|bool $value The option value
*
* @throws \InvalidArgumentException When option given doesn't exist
*/
@ -132,7 +132,7 @@ interface InputInterface
*
* @param string $name The InputOption name
*
* @return bool true if the InputOption object exists, false otherwise
* @return bool true if the InputOption object exists, false otherwise
*/
public function hasOption($name);
@ -146,7 +146,7 @@ interface InputInterface
/**
* Sets the input interactivity.
*
* @param bool $interactive If the input should be interactive
* @param bool $interactive If the input should be interactive
*/
public function setInteractive($interactive);
}

View File

@ -112,7 +112,7 @@ class InputOption
/**
* Returns true if the option accepts a value.
*
* @return bool true if value mode is not self::VALUE_NONE, false otherwise
* @return bool true if value mode is not self::VALUE_NONE, false otherwise
*/
public function acceptValue()
{
@ -122,7 +122,7 @@ class InputOption
/**
* Returns true if the option requires a value.
*
* @return bool true if value mode is self::VALUE_REQUIRED, false otherwise
* @return bool true if value mode is self::VALUE_REQUIRED, false otherwise
*/
public function isValueRequired()
{
@ -132,7 +132,7 @@ class InputOption
/**
* Returns true if the option takes an optional value.
*
* @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise
* @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise
*/
public function isValueOptional()
{
@ -142,7 +142,7 @@ class InputOption
/**
* Returns true if the option can take multiple values.
*
* @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise
* @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise
*/
public function isArray()
{
@ -194,9 +194,10 @@ class InputOption
}
/**
* Checks whether the given option equals this one
* Checks whether the given option equals this one.
*
* @param InputOption $option option to compare
*
* @return bool
*/
public function equals(InputOption $option)

View File

@ -158,8 +158,8 @@ abstract class Output implements OutputInterface
/**
* Writes a message to the output.
*
* @param string $message A message to write to the output
* @param bool $newline Whether to add a newline or not
* @param string $message A message to write to the output
* @param bool $newline Whether to add a newline or not
*/
abstract protected function doWrite($message, $newline);
}

View File

@ -60,7 +60,7 @@ interface OutputInterface
/**
* Sets the verbosity of the output.
*
* @param int $level The level of verbosity (one of the VERBOSITY constants)
* @param int $level The level of verbosity (one of the VERBOSITY constants)
*
* @api
*/
@ -69,7 +69,7 @@ interface OutputInterface
/**
* Gets the current verbosity of the output.
*
* @return int The current level of verbosity (one of the VERBOSITY constants)
* @return int The current level of verbosity (one of the VERBOSITY constants)
*
* @api
*/
@ -78,7 +78,7 @@ interface OutputInterface
/**
* Sets the decorated flag.
*
* @param bool $decorated Whether to decorate the messages
* @param bool $decorated Whether to decorate the messages
*
* @api
*/
@ -87,7 +87,7 @@ interface OutputInterface
/**
* Gets the decorated flag.
*
* @return bool true if the output will decorate messages, false otherwise
* @return bool true if the output will decorate messages, false otherwise
*
* @api
*/
@ -105,7 +105,7 @@ interface OutputInterface
/**
* Returns current output formatter instance.
*
* @return OutputFormatterInterface
* @return OutputFormatterInterface
*
* @api
*/

View File

@ -90,7 +90,7 @@ class StreamOutput extends Output
* - Windows without Ansicon and ConEmu
* - non tty consoles
*
* @return bool true if the stream supports colorization, false otherwise
* @return bool true if the stream supports colorization, false otherwise
*/
protected function hasColorSupport()
{

View File

@ -163,7 +163,7 @@ EOF;
*
* @param string $text The last segment of the entered text
*
* @return bool|array A list of guessed strings or true
* @return bool|array A list of guessed strings or true
*/
private function autocompleter($text)
{

View File

@ -56,7 +56,7 @@ class ApplicationTester
* @param array $input An array of arguments and options
* @param array $options An array of options
*
* @return int The command exit code
* @return int The command exit code
*/
public function run(array $input, $options = array())
{
@ -79,7 +79,7 @@ class ApplicationTester
/**
* Gets the display returned by the last execution of the application.
*
* @param bool $normalize Whether to normalize end of lines to \n or not
* @param bool $normalize Whether to normalize end of lines to \n or not
*
* @return string The display
*/

Some files were not shown because too many files have changed in this diff Show More