Merge branch '2.4'

* 2.4:
  [Validator] added missing @Target
  [Validator] fixed @Target config
  added @Target annotations
  [Process] Add missing docblocks, remove variable declarations

Conflicts:
	src/Symfony/Component/Process/Process.php
	src/Symfony/Component/Process/ProcessBuilder.php
This commit is contained in:
Fabien Potencier 2014-04-23 16:08:54 +02:00
commit 61e287e0b6
53 changed files with 121 additions and 8 deletions

View File

@ -17,6 +17,8 @@ use Symfony\Component\Validator\Constraint;
* Constraint for the Unique Entity validator
*
* @Annotation
* @Target("CLASS")
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class UniqueEntity extends Constraint

View File

@ -57,7 +57,7 @@ class Process
private $outputDisabled = false;
private $stdout;
private $stderr;
private $enhanceWindowsCompatibility;
private $enhanceWindowsCompatibility = true;
private $enhanceSigchildCompatibility;
private $process;
private $status = self::STATUS_READY;
@ -149,15 +149,13 @@ class Process
// on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected
// @see : https://bugs.php.net/bug.php?id=51800
// @see : https://bugs.php.net/bug.php?id=50524
if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || defined('PHP_WINDOWS_VERSION_BUILD'))) {
$this->cwd = getcwd();
}
if (null !== $env) {
$this->setEnv($env);
} else {
$this->env = null;
}
$this->stdin = $stdin;
$this->setTimeout($timeout);
$this->useFileHandles = defined('PHP_WINDOWS_VERSION_BUILD');
@ -1426,7 +1424,7 @@ class Process
/**
* Ensures the process is running or terminated, throws a LogicException if the process has a not started.
*
* @param $functionName The function name that was called.
* @param string $functionName The function name that was called.
*
* @throws LogicException If the process has not run.
*/
@ -1440,7 +1438,7 @@ class Process
/**
* Ensures the process is terminated, throws a LogicException if the process has a status different than `terminated`.
*
* @param $functionName The function name that was called.
* @param string $functionName The function name that was called.
*
* @throws LogicException If the process is not yet terminated.
*/

View File

@ -31,11 +31,23 @@ class ProcessBuilder
private $prefix = array();
private $outputDisabled = false;
/**
* Constructor
*
* @param string[] $arguments An array of arguments
*/
public function __construct(array $arguments = array())
{
$this->arguments = $arguments;
}
/**
* Creates a process builder instance.
*
* @param string[] $arguments An array of arguments
*
* @return ProcessBuilder
*/
public static function create(array $arguments = array())
{
return new static($arguments);
@ -72,7 +84,12 @@ class ProcessBuilder
}
/**
* @param array $arguments
* Sets the arguments of the process.
*
* Arguments must not be escaped.
* Previous arguments are removed.
*
* @param string[] $arguments
*
* @return ProcessBuilder
*/
@ -83,6 +100,13 @@ class ProcessBuilder
return $this;
}
/**
* Sets the working directory.
*
* @param null|string $cwd The working directory
*
* @return ProcessBuilder
*/
public function setWorkingDirectory($cwd)
{
$this->cwd = $cwd;
@ -90,6 +114,13 @@ class ProcessBuilder
return $this;
}
/**
* Sets whether environment variables will be inherited or not.
*
* @param bool $inheritEnv
*
* @return ProcessBuilder
*/
public function inheritEnvironmentVariables($inheritEnv = true)
{
$this->inheritEnv = $inheritEnv;
@ -97,6 +128,17 @@ class ProcessBuilder
return $this;
}
/**
* Sets an environment variable
*
* Setting a variable overrides its previous value. Use `null` to unset a
* defined environment variable.
*
* @param string $name The variable name
* @param null|string $value The variable value
*
* @return ProcessBuilder
*/
public function setEnv($name, $value)
{
$this->env[$name] = $value;
@ -111,6 +153,13 @@ class ProcessBuilder
return $this;
}
/**
* Sets the input of the process.
*
* @param string $stdin The input as a string
*
* @return ProcessBuilder
*/
public function setInput($stdin)
{
$this->stdin = $stdin;
@ -148,6 +197,14 @@ class ProcessBuilder
return $this;
}
/**
* Adds a proc_open option.
*
* @param string $name The option name
* @param string $value The option value
*
* @return ProcessBuilder
*/
public function setOption($name, $value)
{
$this->options[$name] = $value;
@ -179,6 +236,13 @@ class ProcessBuilder
return $this;
}
/**
* Creates a Process instance and returns it.
*
* @return Process
*
* @throws LogicException In case no arguments have been provided
*/
public function getProcess()
{
if (0 === count($this->prefix) && 0 === count($this->arguments)) {

View File

@ -15,6 +15,7 @@ namespace Symfony\Component\Routing\Annotation;
* Annotation class for @Route().
*
* @Annotation
* @Target({"CLASS", "METHOD"})
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
class UserPassword extends Constraint
{

View File

@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -17,6 +17,7 @@ use Symfony\Component\Validator\Constraint;
* Metadata for the CardSchemeValidator.
*
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
class CardScheme extends Constraint
{

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraints\Optional as BaseOptional;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraints\Required as BaseRequired;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\MissingOptionsException;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Miha Vrhovnik <miha.vrhovnik@pagein.si>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"CLASS", "PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Bernhard Schussek <bschussek@gmail.com>

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -50,6 +50,7 @@ use Symfony\Component\Validator\Exception\OutOfBoundsException;
* $validator->validate($address, null, "Address")
*
* @Annotation
* @Target("CLASS")
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,8 +15,8 @@ namespace Symfony\Component\Validator\Constraints;
* Annotation to define a group sequence provider
*
* @Annotation
* @Target("CLASS")
*/
class GroupSequenceProvider
{
}

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
class Iban extends Constraint
{

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @api
*/

View File

@ -18,6 +18,7 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
* Validates that a value is a valid IP address
*
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
* @author Joseph Bielawski <stloyd@gmail.com>

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author The Whole Life To Learn <thewholelifetolearn@gmail.com>
* @author Manuel Reinhard <manu@sprain.ch>

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Antonio J. García Lagar <aj@garcialagar.es>
*/

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\MissingOptionsException;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -17,6 +17,7 @@ use Symfony\Component\Validator\Constraint;
* Metadata for the LuhnValidator.
*
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*/
class Luhn extends Constraint
{

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Daniel Holmes <daniel@danielholmes.org>
*/

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/

View File

@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\MissingOptionsException;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*

View File

@ -16,6 +16,7 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Bernhard Schussek <bschussek@gmail.com>
*