original_string: public function addCasters(array $casters)
      {
          foreach ($casters as $type => $callback) {
              $closure = &$this->casters[$type][];
              $closure = $callback instanceof \Closure ? $callback : static function (...$args) use ($callback, &$closure) {
                  return ($closure = \Closure::fromCallable($callback))(...$args);
              };
          }
      }
code: public function addCasters(array $casters)
      {
          foreach ($casters as $type => $callback) {
              $closure = &$this->casters[$type][];
              $closure = $callback instanceof \Closure ? $callback : static function (...$args) use ($callback, &$closure) {
                  return ($closure = \Closure::fromCallable($callback))(...$args);
              };
          }
      }
code_tokens: public function addCasters ( array $ casters ) { foreach ( $ casters as $ type => $ callback ) { $ closure = & $ this -> casters [ $ type ] [ ] ; $ closure = $ callback instanceof \ Closure ? $ callback : static function ( ... $ args ) use ( $ callback , & $ closure ) { return ( $ closure = \ Closure :: fromCallable ( $ callback ) ) ( ... $ args ) ; } ; } }
docstring: Adds casters for resources and objects.
  
  Maps resources or objects types to a callback.
  Types are in the key, with a callable caster for value.
  Resource types are to be prefixed with a `:`,
  see e.g. static::$defaultCasters.
  
  @param callable[] $casters A map of casters
docstring_tokens: Adds casters for resources and objects .