original_string: public function validate($data) {
          if (empty($data)) {
              return true;
          }
  
          $scss = new core_scss();
          try {
              $scss->compile($data);
          } catch (Leafo\ScssPhp\Exception\ParserException $e) {
              return get_string('scssinvalid', 'admin', $e->getMessage());
          } catch (Leafo\ScssPhp\Exception\CompilerException $e) {
              // Silently ignore this - it could be a scss variable defined from somewhere
              // else which we are not examining here.
              return true;
          }
  
          return true;
      }
code: public function validate($data) {
          if (empty($data)) {
              return true;
          }
  
          $scss = new core_scss();
          try {
              $scss->compile($data);
          } catch (Leafo\ScssPhp\Exception\ParserException $e) {
              return get_string('scssinvalid', 'admin', $e->getMessage());
          } catch (Leafo\ScssPhp\Exception\CompilerException $e) {
              // Silently ignore this - it could be a scss variable defined from somewhere
              // else which we are not examining here.
              return true;
          }
  
          return true;
      }
code_tokens: public function validate ( $ data ) { if ( empty ( $ data ) ) { return true ; } $ scss = new core_scss ( ) ; try { $ scss -> compile ( $ data ) ; } catch ( Leafo \ ScssPhp \ Exception \ ParserException $ e ) { return get_string ( 'scssinvalid' , 'admin' , $ e -> getMessage ( ) ) ; } catch ( Leafo \ ScssPhp \ Exception \ CompilerException $ e ) { // Silently ignore this - it could be a scss variable defined from somewhere // else which we are not examining here. return true ; } return true ; }
docstring: Validate the contents of the SCSS to ensure its parsable. Does not
  attempt to detect undefined scss variables.
  
  @param string $data The scss code from text field.
  @return mixed bool true for success or string:error on failure.
docstring_tokens: Validate the contents of the SCSS to ensure its parsable . Does not attempt to detect undefined scss variables .