original_string: public function setWhitelist($whitelist)
      {
          if (is_array($whitelist)) {
              $this->whitelist = array_map('strval', $whitelist);
          } elseif ($whitelist instanceof \ArrayObject && true) {
              $this->whitelist = array_map('strval', $whitelist->getArrayCopy());
          } elseif (is_string($whitelist)) {
              $this->whitelist = [];
              for ($i = 0; $i < strlen($whitelist); $i++) {
                  $this->whitelist[] = $whitelist[$i];
              }
          } else {
              throw new \Exception('Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.');
          }
      }
code: public function setWhitelist($whitelist)
      {
          if (is_array($whitelist)) {
              $this->whitelist = array_map('strval', $whitelist);
          } elseif ($whitelist instanceof \ArrayObject && true) {
              $this->whitelist = array_map('strval', $whitelist->getArrayCopy());
          } elseif (is_string($whitelist)) {
              $this->whitelist = [];
              for ($i = 0; $i < strlen($whitelist); $i++) {
                  $this->whitelist[] = $whitelist[$i];
              }
          } else {
              throw new \Exception('Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.');
          }
      }
code_tokens: public function setWhitelist ( $ whitelist ) { if ( is_array ( $ whitelist ) ) { $ this -> whitelist = array_map ( 'strval' , $ whitelist ) ; } elseif ( $ whitelist instanceof \ ArrayObject && true ) { $ this -> whitelist = array_map ( 'strval' , $ whitelist -> getArrayCopy ( ) ) ; } elseif ( is_string ( $ whitelist ) ) { $ this -> whitelist = [ ] ; for ( $ i = 0 ; $ i < strlen ( $ whitelist ) ; $ i ++ ) { $ this -> whitelist [ ] = $ whitelist [ $ i ] ; } } else { throw new \ Exception ( 'Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.' ) ; } }
docstring: Set the whitelist of characters which are allowed for this field.
  This can either be an array or a string.
  
  @param array|\ArrayObject|string $whitelist
  @throws \Exception
docstring_tokens: Set the whitelist of characters which are allowed for this field . This can either be an array or a string .