original_string: public function countBy($callback = null)
      {
          if (is_null($callback)) {
              $callback = function ($value) {
                  return $value;
              };
          }
  
          return new static($this->groupBy($callback)->map(function ($value) {
              return $value->count();
          }));
      }
code: public function countBy($callback = null)
      {
          if (is_null($callback)) {
              $callback = function ($value) {
                  return $value;
              };
          }
  
          return new static($this->groupBy($callback)->map(function ($value) {
              return $value->count();
          }));
      }
code_tokens: public function countBy ( $ callback = null ) { if ( is_null ( $ callback ) ) { $ callback = function ( $ value ) { return $ value ; } ; } return new static ( $ this -> groupBy ( $ callback ) -> map ( function ( $ value ) { return $ value -> count ( ) ; } ) ) ; }
docstring: Count the number of items in the collection using a given truth test.
  
  @param  callable|null  $callback
  @return static
docstring_tokens: Count the number of items in the collection using a given truth test .