original_string: private function formatScopes(array $scopes)
      {
          if (empty($scopes)) {
              return [null]; //use at least 1 null scope
          }
  
          array_walk(
              $scopes,
              function (&$scope) {
                  if (is_array($scope)) {
                      $scope = implode(' ', $scope);
                  }
              }
          );
  
          return $scopes;
      }
code: private function formatScopes(array $scopes)
      {
          if (empty($scopes)) {
              return [null]; //use at least 1 null scope
          }
  
          array_walk(
              $scopes,
              function (&$scope) {
                  if (is_array($scope)) {
                      $scope = implode(' ', $scope);
                  }
              }
          );
  
          return $scopes;
      }
code_tokens: private function formatScopes ( array $ scopes ) { if ( empty ( $ scopes ) ) { return [ null ] ; //use at least 1 null scope } array_walk ( $ scopes , function ( & $ scope ) { if ( is_array ( $ scope ) ) { $ scope = implode ( ' ' , $ scope ) ; } } ) ; return $ scopes ; }
docstring: Helper method to ensure given scopes are formatted properly.
  
  @param array $scopes Scopes required for authorization.
  
  @return array The formatted scopes array.
docstring_tokens: Helper method to ensure given scopes are formatted properly .