original_string: protected function collectRenderingObstacles($parameters, $requirements = true)
      {
          if ( ! is_array($parameters)) {
              return ['Parameters should be an array'];
          }
          if (true === $requirements) {
              $requirements = $this->getRequiredParameters();
          }
          $obstacles = [];
          foreach ($requirements as $requiredParameterName) {
              if (empty($parameters[$requiredParameterName])) {
                  $obstacles[] = "Parameter '".$requiredParameterName."' is required";
              }
          }
          return $obstacles;
      }
code: protected function collectRenderingObstacles($parameters, $requirements = true)
      {
          if ( ! is_array($parameters)) {
              return ['Parameters should be an array'];
          }
          if (true === $requirements) {
              $requirements = $this->getRequiredParameters();
          }
          $obstacles = [];
          foreach ($requirements as $requiredParameterName) {
              if (empty($parameters[$requiredParameterName])) {
                  $obstacles[] = "Parameter '".$requiredParameterName."' is required";
              }
          }
          return $obstacles;
      }
code_tokens: protected function collectRenderingObstacles ( $ parameters , $ requirements = true ) { if ( ! is_array ( $ parameters ) ) { return [ 'Parameters should be an array' ] ; } if ( true === $ requirements ) { $ requirements = $ this -> getRequiredParameters ( ) ; } $ obstacles = [ ] ; foreach ( $ requirements as $ requiredParameterName ) { if ( empty ( $ parameters [ $ requiredParameterName ] ) ) { $ obstacles [ ] = "Parameter '" . $ requiredParameterName . "' is required" ; } } return $ obstacles ; }
docstring: Returns an array of possible problems for rendering widget or of some widget rendering functionality
  
  @param $parameters
  @param bool|array $requirements - required parameter names or true for getting them from getRequiredParameters()
  @return array
docstring_tokens: Returns an array of possible problems for rendering widget or of some widget rendering functionality