Returns the first extension by the given vendor and name.

@param string $vendor
@param string $name
@return ExtensionContract|null
501469
public function findByVendorAndName(string $vendor, string $name)
    {
        $fullName = $vendor . '/' . $name;

        return $this->first(function(ExtensionContract $extension) use($fullName) {
                    return $extension->getPackage()->getName() === $fullName;
                });
    }
798615
public function selectIssuerByKeyword($name)
    {
        if (!isset($this->_paymentMethodsArray))
            throw new Exception("No data loaded");
        foreach ($this->_paymentMethodsArray as $paymentMethod) {
            foreach ($paymentMethod["Issuers"] as $issuer) {
                if ($issuer["IssuerKeyword"] == strtoupper($name)) {
                    $this->_methodData = $paymentMethod;
                    $this->_issuerData = $issuer;
                    break;
                }
            }
        }
        return $this;
    }
950617
protected function getExtension($vendor, $package = null)
    {
        $name = (is_null($package) ? $vendor : implode('/', [$vendor, $package]));

        return new Fluent(['name' => $name, 'uid' => $name]);
    }
682132
public function getProviderGatewayByName($name)
    {
        foreach ($this->providerGateways as $provider) {
            if ($provider->getName() === $name) {
                return $provider;
            }
        }

        return null;
    }
1353864
public function getExtension($name)
    {
        if ($this->hasExtension($name)) {
            return $this->_extensions[$name];
        }

        throw new HandlerNotFoundException(get_class($this).": No extension named \"$name\" found");
    }
509329
private function resolveSrc($vendor)
    {
        $src = null;

        /** @var $packages \Composer\Package\CompletePackage[] */
        $packages = $this->repository->getPackages();
        foreach ($packages as $package) {
            if ($vendor == $package->getName()) {
                $autoload = $package->getAutoload();
                $src = current($autoload['psr-0']);

                break;
            }
        }

        if (null === $src) {
            throw new \InvalidArgumentException(sprintf('Vendor "%s" not found', $vendor));
        }

        return $src;
    }
1332389
public String mapTo(Vendor vendor)
    {
        String[] m = getMapping(vendor);
        return m == null ? null : m[VENDOR_MAP_RAW];
    }
185826
protected function getPathFromExtensionName(string $name): array
    {
        $extension = $this->app->make('orchestra.extension');
        $finder = $this->app->make('orchestra.extension.finder');

        if ($name === 'app') {
            $basePath = $sourcePath = $this->app->basePath();
        } else {
            $basePath = $finder->resolveExtensionPath(rtrim($extension->option($name, 'path'), '/'));
            $sourcePath = $finder->resolveExtensionPath(rtrim($extension->option($name, 'source-path'), '/'));
        }

        return [$basePath, $sourcePath];
    }
397365
public function getExtra($name, $default = null)
    {
        return array_key_exists($name, $this->extra) ? $this->extra[$name] : $default;
    }
907458
public function package(string $name): void
    {
        $files = $this->app->make('files');

        if (\method_exists($this->app, 'vendorPath')) {
            $vendorPath = \rtrim($this->app->vendorPath(), '/');
        } else {
            $basePath = \rtrim($this->app->basePath(), '/');
            $vendorPath = "{$basePath}/vendor";
        }

        $paths = [
            "{$vendorPath}/{$name}/resources/database/migrations/",
            "{$vendorPath}/{$name}/database/migrations/",
            "{$vendorPath}/{$name}/migrations/",
        ];

        foreach ($paths as $path) {
            if ($files->isDirectory($path)) {
                $this->run($path);
            }
        }
    }
671123
public function getFunction(string $name): ?FunctionModelInterface
    {
        $functions = $this->functions->filter(function (FunctionModelInterface $function) use ($name) {
            return $function->getName() === $name;
        });
        if ($functions->isEmpty()) {
            return null;
        }
        return $functions->first();
    }
1002158
public function setVendor(\HarvestCloud\CoreBundle\Entity\Profile $vendor = null)
    {
        $this->vendor = $vendor;

        return $this;
    }
1129240
public function getExtension($name)
    {
        if (isset($this->extensions[$name])) {
            return $this->extensions[$name];
        }

        if (isset($this->extensionsByNs[$name])) {
            return $this->extensionsByNs[$name];
        }

        throw new LogicException(sprintf('Container extension "%s" is not registered', $name));
    }
873205
public static function getHandlerByName($name)
    {
        return isset(self::$namedRoutes[$name]) ? self::$namedRoutes[$name][1] : null;
    }
524548
public function extend($name, ExtensionInterface $extension)
    {
        $this->getExtensions()->put($name, $extension);

        $extension->set($this);

        return $extension;
    }
68561
public function first($name)
    {
        if ($this->hasValue($name)) {
            return $this->getValue($name);
        }

        foreach ($this->getStructures() as $childStructure) {
            if ($result = $childStructure->first($name)) {
                return $result;
            }
        }

        return null;
    }
33813
protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
  {
    foreach ($paths as $path => $names) {
      if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
        return $path;
      }
    }

    return false;
  }