/**
* Gets values for the autocompleter.
*
- * @return null|iterable
+ * @return iterable|null
*/
public function getAutocompleterValues()
{
/**
* Sets values for the autocompleter.
*
- * @param null|iterable $values
+ * @param iterable|null $values
*
* @return $this
*
*/
public function setAutocompleterValues($values)
{
- if (is_array($values)) {
+ if (\is_array($values)) {
$values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
}
- if (null !== $values && !is_array($values) && !$values instanceof \Traversable) {
+ if (null !== $values && !\is_array($values) && !$values instanceof \Traversable) {
throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.');
}
/**
* Sets a validator for the question.
*
- * @param null|callable $validator
+ * @param callable|null $validator
*
* @return $this
*/
/**
* Gets the validator for the question.
*
- * @return null|callable
+ * @return callable|null
*/
public function getValidator()
{
*
* Null means an unlimited number of attempts.
*
- * @param null|int $attempts
+ * @param int|null $attempts
*
* @return $this
*
*
* Null means an unlimited number of attempts.
*
- * @return null|int
+ * @return int|null
*/
public function getMaxAttempts()
{
protected function isAssoc($array)
{
- return (bool) count(array_filter(array_keys($array), 'is_string'));
+ return (bool) \count(array_filter(array_keys($array), 'is_string'));
}
}