original_string: public function getMethodRequiredArgCount($class, string $method): int
      {
          $instance = new \ReflectionMethod($class, $method);
          $count = 0;
          // calculate method defined arguments count
          foreach ($instance->getParameters() as $arg) {
              if (!$arg->isOptional()) {
                  $count++;
              }
          }
  
          return $count;
      }
code: public function getMethodRequiredArgCount($class, string $method): int
      {
          $instance = new \ReflectionMethod($class, $method);
          $count = 0;
          // calculate method defined arguments count
          foreach ($instance->getParameters() as $arg) {
              if (!$arg->isOptional()) {
                  $count++;
              }
          }
  
          return $count;
      }
code_tokens: public function getMethodRequiredArgCount ( $ class , string $ method ) : int { $ instance = new \ ReflectionMethod ( $ class , $ method ) ; $ count = 0 ; // calculate method defined arguments count foreach ( $ instance -> getParameters ( ) as $ arg ) { if ( ! $ arg -> isOptional ( ) ) { $ count ++ ; } } return $ count ; }
docstring: Get method required arguments count
  @param $class
  @param string $method
  @return int
docstring_tokens: Get method required arguments count