original_string: private function fail()
      {
          $args = func_get_args();
  
          $format = array_shift($args);
  
          $regex = '/\{\{(?P<positive>[^{}]*)\|(?<negative>[^{}]*)\}\}/';
          preg_match_all($regex, $format, $matches);
  
          $replacements = $this->negative ? $matches['negative'] : $matches['positive'];
  
          foreach ($matches[0] as $i => $match) {
              $format = str_replace($match, $replacements[$i], $format);
          }
  
          $format = preg_replace('/\s+/', ' ', $format);
  
          foreach ($args as &$arg) {
              if (is_array($arg)) {
                  $arg = 'Array';
                  continue;
              }
  
              if (is_object($arg)) {
                  $arg = 'Object of type "'.get_class($arg).'"';
                  continue;
              }
  
              if ($arg === true) {
                  $arg = 'TRUE';
                  continue;
              }
  
              if ($arg === false) {
                  $arg = 'FALSE';
                  continue;
              }
  
              if ($arg === null) {
                  $arg = 'NULL';
                  continue;
              }
  
              if (is_string($arg)) {
                  $arg = '"'.$arg.'"';
                  continue;
              }
          }
  
          array_unshift($args, $format);
          $msg = (new ReflectionFunction('sprintf'))->invokeArgs($args);
  
          throw new AssertionFailureException($msg);
      }
code: private function fail()
      {
          $args = func_get_args();
  
          $format = array_shift($args);
  
          $regex = '/\{\{(?P<positive>[^{}]*)\|(?<negative>[^{}]*)\}\}/';
          preg_match_all($regex, $format, $matches);
  
          $replacements = $this->negative ? $matches['negative'] : $matches['positive'];
  
          foreach ($matches[0] as $i => $match) {
              $format = str_replace($match, $replacements[$i], $format);
          }
  
          $format = preg_replace('/\s+/', ' ', $format);
  
          foreach ($args as &$arg) {
              if (is_array($arg)) {
                  $arg = 'Array';
                  continue;
              }
  
              if (is_object($arg)) {
                  $arg = 'Object of type "'.get_class($arg).'"';
                  continue;
              }
  
              if ($arg === true) {
                  $arg = 'TRUE';
                  continue;
              }
  
              if ($arg === false) {
                  $arg = 'FALSE';
                  continue;
              }
  
              if ($arg === null) {
                  $arg = 'NULL';
                  continue;
              }
  
              if (is_string($arg)) {
                  $arg = '"'.$arg.'"';
                  continue;
              }
          }
  
          array_unshift($args, $format);
          $msg = (new ReflectionFunction('sprintf'))->invokeArgs($args);
  
          throw new AssertionFailureException($msg);
      }
code_tokens: private function fail ( ) { $ args = func_get_args ( ) ; $ format = array_shift ( $ args ) ; $ regex = '/\{\{(?P<positive>[^{}]*)\|(?<negative>[^{}]*)\}\}/' ; preg_match_all ( $ regex , $ format , $ matches ) ; $ replacements = $ this -> negative ? $ matches [ 'negative' ] : $ matches [ 'positive' ] ; foreach ( $ matches [ 0 ] as $ i => $ match ) { $ format = str_replace ( $ match , $ replacements [ $ i ] , $ format ) ; } $ format = preg_replace ( '/\s+/' , ' ' , $ format ) ; foreach ( $ args as & $ arg ) { if ( is_array ( $ arg ) ) { $ arg = 'Array' ; continue ; } if ( is_object ( $ arg ) ) { $ arg = 'Object of type "' . get_class ( $ arg ) . '"' ; continue ; } if ( $ arg === true ) { $ arg = 'TRUE' ; continue ; } if ( $ arg === false ) { $ arg = 'FALSE' ; continue ; } if ( $ arg === null ) { $ arg = 'NULL' ; continue ; } if ( is_string ( $ arg ) ) { $ arg = '"' . $ arg . '"' ; continue ; } } array_unshift ( $ args , $ format ) ; $ msg = ( new ReflectionFunction ( 'sprintf' ) ) -> invokeArgs ( $ args ) ; throw new AssertionFailureException ( $ msg ) ; }
docstring: Convert arguments into a string-safe exception message,
  then throw an assertion failure.
  
  @throws AssertionFailureException
docstring_tokens: Convert arguments into a string - safe exception message then throw an assertion failure .