original_string: protected function registerCalculator()
      {
          $this->app->singleton(TextSizeCalculatorInterface::class, function () {
              $path = __DIR__.'/../resources/fonts/DejaVuSans.ttf';
  
              return new GDTextSizeCalculator(realpath($path) ?: $path);
          });
  
          $this->app->singleton('badger.calculator', TextSizeCalculatorInterface::class);
      }
code: protected function registerCalculator()
      {
          $this->app->singleton(TextSizeCalculatorInterface::class, function () {
              $path = __DIR__.'/../resources/fonts/DejaVuSans.ttf';
  
              return new GDTextSizeCalculator(realpath($path) ?: $path);
          });
  
          $this->app->singleton('badger.calculator', TextSizeCalculatorInterface::class);
      }
code_tokens: protected function registerCalculator ( ) { $ this -> app -> singleton ( TextSizeCalculatorInterface :: class , function ( ) { $ path = __DIR__ . '/../resources/fonts/DejaVuSans.ttf' ; return new GDTextSizeCalculator ( realpath ( $ path ) ? : $ path ) ; } ) ; $ this -> app -> singleton ( 'badger.calculator' , TextSizeCalculatorInterface :: class ) ; }
docstring: Register the calculator class.
  
  @return void
docstring_tokens: Register the calculator class .