original_string: public function autoload(array $autoloads, $provider, $options = [])
      {
          foreach ($autoloads as $name => $alias) {
              if (is_int($name)) {
                  $name = $alias;
              }
              if (empty($name)) {
                  throw new \InvalidArgumentException("Cannot not autoload empty service");
              }
              if (!empty($options['prefix'])) {
                  $alias = $options['prefix'] . ucfirst($alias);
              }
              $shared = true;
              if (isset($options['shared'])) {
                  if (is_array($options['shared'])) {
                      $shared = in_array($name, $options['shared']);
                  } else {
                      $shared = $options['shared'];
                  }
              } elseif (isset($options['instances'])) {
                  $shared = !in_array($name, $options['instances']);
              }
              $this->set($alias, function () use ($name, $provider) {
                  if (!is_object($provider)) {
                      $provider = $this->getShared($provider);
                  }
                  return $provider->provide($name, func_get_args());
              }, $shared);
          }
          return $this;
      }
code: public function autoload(array $autoloads, $provider, $options = [])
      {
          foreach ($autoloads as $name => $alias) {
              if (is_int($name)) {
                  $name = $alias;
              }
              if (empty($name)) {
                  throw new \InvalidArgumentException("Cannot not autoload empty service");
              }
              if (!empty($options['prefix'])) {
                  $alias = $options['prefix'] . ucfirst($alias);
              }
              $shared = true;
              if (isset($options['shared'])) {
                  if (is_array($options['shared'])) {
                      $shared = in_array($name, $options['shared']);
                  } else {
                      $shared = $options['shared'];
                  }
              } elseif (isset($options['instances'])) {
                  $shared = !in_array($name, $options['instances']);
              }
              $this->set($alias, function () use ($name, $provider) {
                  if (!is_object($provider)) {
                      $provider = $this->getShared($provider);
                  }
                  return $provider->provide($name, func_get_args());
              }, $shared);
          }
          return $this;
      }
code_tokens: public function autoload ( array $ autoloads , $ provider , $ options = [ ] ) { foreach ( $ autoloads as $ name => $ alias ) { if ( is_int ( $ name ) ) { $ name = $ alias ; } if ( empty ( $ name ) ) { throw new \ InvalidArgumentException ( "Cannot not autoload empty service" ) ; } if ( ! empty ( $ options [ 'prefix' ] ) ) { $ alias = $ options [ 'prefix' ] . ucfirst ( $ alias ) ; } $ shared = true ; if ( isset ( $ options [ 'shared' ] ) ) { if ( is_array ( $ options [ 'shared' ] ) ) { $ shared = in_array ( $ name , $ options [ 'shared' ] ) ; } else { $ shared = $ options [ 'shared' ] ; } } elseif ( isset ( $ options [ 'instances' ] ) ) { $ shared = ! in_array ( $ name , $ options [ 'instances' ] ) ; } $ this -> set ( $ alias , function ( ) use ( $ name , $ provider ) { if ( ! is_object ( $ provider ) ) { $ provider = $ this -> getShared ( $ provider ) ; } return $ provider -> provide ( $ name , func_get_args ( ) ) ; } , $ shared ) ; } return $ this ; }
docstring: mark autoload service definition from service provider
  
  @param array $autoloads name of service. service alias
  @param string|ServiceProvider $provider service provider
  @param array options: shared, instances, prefix
docstring_tokens: mark autoload service definition from service provider