Skip to content

Commit 6108a21

Browse files
minor symfony#25585 Add type string to docblock for Process::setInput() (icanhazstring)
This PR was submitted for the 3.4 branch but it was squashed and merged into the 3.3 branch instead (closes symfony#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()
2 parents 840a3d8 + e3de68f commit 6108a21

File tree

10 files changed

+19
-17
lines changed

10 files changed

+19
-17
lines changed

src/Symfony/Component/Process/InputStream.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
class InputStream implements \IteratorAggregate
2222
{
23+
/** @var null|callable */
2324
private $onEmpty = null;
2425
private $input = array();
2526
private $open = true;
@@ -35,7 +36,8 @@ public function onEmpty(callable $onEmpty = null)
3536
/**
3637
* Appends an input to the write buffer.
3738
*
38-
* @param resource|scalar|\Traversable|null The input to append as stream resource, scalar or \Traversable
39+
* @param resource|string|int|float|bool|\Traversable|null The input to append as scalar,
40+
* stream resource or \Traversable
3941
*/
4042
public function write($input)
4143
{

src/Symfony/Component/Process/Pipes/AbstractPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class AbstractPipes implements PipesInterface
2727
private $blocked = true;
2828

2929
/**
30-
* @param resource|scalar|\Iterator|null $input
30+
* @param resource|string|int|float|bool|\Iterator|null $input
3131
*/
3232
public function __construct($input)
3333
{

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ public function getInput()
11581158
*
11591159
* This content will be passed to the underlying process standard input.
11601160
*
1161-
* @param resource|scalar|\Traversable|null $input The content
1161+
* @param string|int|float|bool|resource|\Traversable|null $input The content
11621162
*
11631163
* @return self The current Process instance
11641164
*

src/Symfony/Component/Process/ProcessBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function addEnvironmentVariables(array $variables)
167167
/**
168168
* Sets the input of the process.
169169
*
170-
* @param resource|scalar|\Traversable|null $input The input content
170+
* @param resource|string|int|float|bool|\Traversable|null $input The input content
171171
*
172172
* @return $this
173173
*

src/Symfony/Component/Serializer/Encoder/EncoderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface EncoderInterface
2727
* @param string $format Format name
2828
* @param array $context Options that normalizers/encoders have access to
2929
*
30-
* @return scalar
30+
* @return string|int|float|bool
3131
*
3232
* @throws UnexpectedValueException
3333
*/

src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ interface DenormalizableInterface
2727
* It is important to understand that the denormalize() call should denormalize
2828
* recursively all child objects of the implementor.
2929
*
30-
* @param DenormalizerInterface $denormalizer The denormalizer is given so that you
31-
* can use it to denormalize objects contained within this object
32-
* @param array|scalar $data The data from which to re-create the object
33-
* @param string|null $format The format is optionally given to be able to denormalize differently
34-
* based on different input formats
35-
* @param array $context Options for denormalizing
30+
* @param DenormalizerInterface $denormalizer The denormalizer is given so that you
31+
* can use it to denormalize objects contained within this object
32+
* @param array|string|int|float|bool $data The data from which to re-create the object
33+
* @param string|null $format The format is optionally given to be able to denormalize
34+
* differently based on different input formats
35+
* @param array $context Options for denormalizing
3636
*
3737
* @return object
3838
*/

src/Symfony/Component/Serializer/Normalizer/NormalizableInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface NormalizableInterface
3333
* based on different output formats
3434
* @param array $context Options for normalizing this object
3535
*
36-
* @return array|scalar
36+
* @return array|string|int|float|bool
3737
*/
3838
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array());
3939
}

src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface NormalizerInterface
2929
* @param string $format Format the normalization result will be encoded as
3030
* @param array $context Context options for the normalizer
3131
*
32-
* @return array|scalar
32+
* @return array|string|int|float|bool
3333
*
3434
* @throws InvalidArgumentException Occurs when the object given is not an attempted type for the normalizer
3535
* @throws CircularReferenceException Occurs when the normalizer detects a circular reference when no circular

src/Symfony/Component/VarDumper/Cloner/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getType()
6363
/**
6464
* @param bool $recursive Whether values should be resolved recursively or not
6565
*
66-
* @return scalar|array|null|Data[] A native representation of the original value
66+
* @return string|int|float|bool|array|null|Data[] A native representation of the original value
6767
*/
6868
public function getValue($recursive = false)
6969
{

src/Symfony/Component/VarDumper/Cloner/DumperInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ interface DumperInterface
2121
/**
2222
* Dumps a scalar value.
2323
*
24-
* @param Cursor $cursor The Cursor position in the dump
25-
* @param string $type The PHP type of the value being dumped
26-
* @param scalar $value The scalar value being dumped
24+
* @param Cursor $cursor The Cursor position in the dump
25+
* @param string $type The PHP type of the value being dumped
26+
* @param string|int|float|bool $value The scalar value being dumped
2727
*/
2828
public function dumpScalar(Cursor $cursor, $type, $value);
2929

0 commit comments

Comments
 (0)