src/Drupal/Component/Utility/Random.php
public function object($size = 4) {
    $object = new \stdClass();
    for ($i = 0; $i < $size; $i++) {
      $random_key = $this->name();
      $random_value = $this->string();
      $object->{$random_key} = $random_value;
    }
    return $object;
  }
public function object($size = 4) {
    $object = new \stdClass();
    for ($i = 0; $i < $size; $i++) {
      $random_key = $this->name();
      $random_value = $this->string();
      $object->{$random_key} = $random_value;
    }
    return $object;
  }
public function object ( $ size = 4 ) { $ object = new \ stdClass ( ) ; for ( $ i = 0 ; $ i < $ size ; $ i ++ ) { $ random_key = $ this -> name ( ) ; $ random_value = $ this -> string ( ) ; $ object -> { $ random_key } = $ random_value ; } return $ object ; }
Generates a random PHP object.

@param int $size
The number of random keys to add to the object.

@return \stdClass
The generated object, with the specified number of random keys. Each key
has a random string value.
Generates a random PHP object .