Skip to content

Commit

Permalink
minor #25585 Add type string to docblock for Process::setInput() (ica…
Browse files Browse the repository at this point in the history
…nhazstring)

This PR was submitted for the 3.4 branch but it was squashed and merged into the 3.3 branch instead (closes #25585).

Discussion
----------

Add type string to docblock for Process::setInput()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

Add `string` as valid `$input` for `Process::setInput()`. Since `getInput()` will also return as string and the internal method `ProcessUtils::validateInput()` will accept a string, this should be a viable input type.

Commits
-------

e3de68f Add type string to docblock for Process::setInput()
  • Loading branch information
nicolas-grekas committed Jan 7, 2018
2 parents 840a3d8 + e3de68f commit 6108a21
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/Symfony/Component/Process/InputStream.php
Expand Up @@ -20,6 +20,7 @@
*/
class InputStream implements \IteratorAggregate
{
/** @var null|callable */
private $onEmpty = null;
private $input = array();
private $open = true;
Expand All @@ -35,7 +36,8 @@ public function onEmpty(callable $onEmpty = null)
/**
* Appends an input to the write buffer.
*
* @param resource|scalar|\Traversable|null The input to append as stream resource, scalar or \Traversable
* @param resource|string|int|float|bool|\Traversable|null The input to append as scalar,
* stream resource or \Traversable
*/
public function write($input)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Pipes/AbstractPipes.php
Expand Up @@ -27,7 +27,7 @@ abstract class AbstractPipes implements PipesInterface
private $blocked = true;

/**
* @param resource|scalar|\Iterator|null $input
* @param resource|string|int|float|bool|\Iterator|null $input
*/
public function __construct($input)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/Process.php
Expand Up @@ -1158,7 +1158,7 @@ public function getInput()
*
* This content will be passed to the underlying process standard input.
*
* @param resource|scalar|\Traversable|null $input The content
* @param string|int|float|bool|resource|\Traversable|null $input The content
*
* @return self The current Process instance
*
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/ProcessBuilder.php
Expand Up @@ -167,7 +167,7 @@ public function addEnvironmentVariables(array $variables)
/**
* Sets the input of the process.
*
* @param resource|scalar|\Traversable|null $input The input content
* @param resource|string|int|float|bool|\Traversable|null $input The input content
*
* @return $this
*
Expand Down
Expand Up @@ -27,7 +27,7 @@ interface EncoderInterface
* @param string $format Format name
* @param array $context Options that normalizers/encoders have access to
*
* @return scalar
* @return string|int|float|bool
*
* @throws UnexpectedValueException
*/
Expand Down
Expand Up @@ -27,12 +27,12 @@ interface DenormalizableInterface
* It is important to understand that the denormalize() call should denormalize
* recursively all child objects of the implementor.
*
* @param DenormalizerInterface $denormalizer The denormalizer is given so that you
* can use it to denormalize objects contained within this object
* @param array|scalar $data The data from which to re-create the object
* @param string|null $format The format is optionally given to be able to denormalize differently
* based on different input formats
* @param array $context Options for denormalizing
* @param DenormalizerInterface $denormalizer The denormalizer is given so that you
* can use it to denormalize objects contained within this object
* @param array|string|int|float|bool $data The data from which to re-create the object
* @param string|null $format The format is optionally given to be able to denormalize
* differently based on different input formats
* @param array $context Options for denormalizing
*
* @return object
*/
Expand Down
Expand Up @@ -33,7 +33,7 @@ interface NormalizableInterface
* based on different output formats
* @param array $context Options for normalizing this object
*
* @return array|scalar
* @return array|string|int|float|bool
*/
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array());
}
Expand Up @@ -29,7 +29,7 @@ interface NormalizerInterface
* @param string $format Format the normalization result will be encoded as
* @param array $context Context options for the normalizer
*
* @return array|scalar
* @return array|string|int|float|bool
*
* @throws InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer
* @throws CircularReferenceException Occurs when the normalizer detects a circular reference when no circular
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/VarDumper/Cloner/Data.php
Expand Up @@ -63,7 +63,7 @@ public function getType()
/**
* @param bool $recursive Whether values should be resolved recursively or not
*
* @return scalar|array|null|Data[] A native representation of the original value
* @return string|int|float|bool|array|null|Data[] A native representation of the original value
*/
public function getValue($recursive = false)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/VarDumper/Cloner/DumperInterface.php
Expand Up @@ -21,9 +21,9 @@ interface DumperInterface
/**
* Dumps a scalar value.
*
* @param Cursor $cursor The Cursor position in the dump
* @param string $type The PHP type of the value being dumped
* @param scalar $value The scalar value being dumped
* @param Cursor $cursor The Cursor position in the dump
* @param string $type The PHP type of the value being dumped
* @param string|int|float|bool $value The scalar value being dumped
*/
public function dumpScalar(Cursor $cursor, $type, $value);

Expand Down

0 comments on commit 6108a21

Please sign in to comment.