@throws \Exception

@return JWKSetSourceInterface[]
326149
private function getJWKSetSources(): array
    {
        if (null !== $this->jwkset_sources) {
            return $this->jwkset_sources;
        }

        // load bundled adapter factories
        $tempContainer = new ContainerBuilder();
        $tempContainer->registerForAutoconfiguration(JWKSetSourceInterface::class)->addTag('jose.jwkset_source');
        $loader = new YamlFileLoader($tempContainer, new FileLocator(__DIR__.'/../../../Resources/config'));
        $loader->load('jwkset_sources.yml');

        $services = $tempContainer->findTaggedServiceIds('jose.jwkset_source');
        $jwkset_sources = [];
        foreach (\array_keys($services) as $id) {
            $factory = $tempContainer->get($id);
            if (!$factory instanceof JWKSetSourceInterface) {
                throw new \InvalidArgumentException();
            }
            $jwkset_sources[\str_replace('-', '_', $factory->getKeySet())] = $factory;
        }

        return $this->jwkset_sources = $jwkset_sources;
    }
1246663
protected function getAuthorizationHeader()
    {
        if (empty($this->apiKeyHeader) || empty($this->apiKey)) {
            throw new \Exception('API key is not set.');
        }

        return [$this->apiKeyHeader => $this->apiKey];
    }
453786
public function main()
	{
		$result = array();

		if( !isset( $this->_file ) && count( $this->_filesets ) == 0 ) {
			throw new BuildException( "Missing either a nested fileset or attribute 'file' set" );
		}

		if( !isset( $this->_optfile ) || ( $string = file_get_contents( $this->_optfile ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to open optfile "%1$s"', $this->_optfile ) );
		}

		if( ( $options = unserialize( $string ) ) === false ) {
			throw new BuildException( sprintf( 'Unable to unserialize content of file "%1$s"', $this->_optfile ) );
		}

		if( $this->_file instanceof PhingFile )
		{
			$this->_extract( $this->_file->getPath(), $options );
		}
		else // process filesets
		{
			$project = $this->getProject();

			foreach( $this->_filesets as $fs )
			{
				$files = $fs->getDirectoryScanner( $project )->getIncludedFiles();
				$dir = $fs->getDir( $this->project )->getPath();

				foreach( $files as $file ) {
					$this->_extract( $dir . DIRECTORY_SEPARATOR . $file, $options );
				}
			}
		}

		$len = strlen( $this->_keyprefix );

		foreach( $options as $key => $values )
		{
			if( strncmp( $key, $this->_keyprefix, $len ) !== 0 ) {
				unset( $options[$key] );
			} else if( strpos( $key, 'unknown' ) !== false ) {
				unset( $options[$key] );
			} else if( !isset( $values['short'] ) && $key[0] !== "\n" ) {
				$this->log( 'No doc: ' . $key );
			}
		}

		ksort( $options );
		$this->log( 'Number of config options for ' . $this->_keyprefix . ': ' . count( $options ) );

		$this->_createWikiPages( $options );
	}
106197
public function locateSources(): array
    {
        if (!$this->container->has(ClassesInterface::class)) {
            return [];
        }

        /**
         * @var ClassesInterface $classes
         */
        $classes = $this->container->get(ClassesInterface::class);

        $result = [];
        foreach ($classes->getClasses(RecordSource::class) as $class) {
            $source = $class['name'];
            if ($class['abstract'] || empty($source::RECORD)) {
                continue;
            }

            $result[$source::RECORD] = $source;
        }

        return $result;
    }
153394
public function getData(): array
    {
        return [
            $this->serverOriginScheme,
            $this->serverOriginHost,
            $this->serverOriginPort,
            $this->isPreFlightCanBeCached,
            $this->preFlightCacheMaxAge,
            $this->isForceAddMethods,
            $this->isForceAddHeaders,
            $this->isUseCredentials,
            $this->areAllOriginsAllowed,
            $this->allowedOrigins,
            $this->areAllMethodsAllowed,
            $this->allowedLcMethods,
            $this->allowedMethodsList,
            $this->areAllHeadersAllowed,
            $this->allowedLcHeaders,
            $this->allowedHeadersList,
            $this->exposedHeadersList,
            $this->isCheckHost,
        ];
    }
767126
public function getJsonData() : array
    {
        $return = [];

        foreach (Hooks::getValidHooks() as $hook => $value) {
            $return[$hook] = $this->hooks[$hook]->getJsonData();
        }

        return $return;
    }
217692
public function getConnectionsFromResource() : Array
	{	
		$baseDir = dirname(__DIR__);
		$configLocation = $baseDir . '/config.php';
	
		if (!file_exists($configLocation) && class_exists(Config::class)) {
			$resourceConfig = Config::get('database');
		}else{
			$resourceConfig = include $configLocation;
		}

		if (gettype($resourceConfig) !== 'array') {
			throw new Exception('Invalid configuration type.');
		}
		
		return $resourceConfig;
	}
23603
public static function settings(): array
    {
        $filename = static::filename();
        if (!static::checkFileExist($filename)) {
            throw new \Exception($filename . ' dosnt exists. Please create this file.');
        }
        $settings = YamlManipulator::getFileContents($filename);
        if (!isset($settings['settings'])) {
            throw new \Exception('The settigns files is not valid, all parameters must be under settings array.');
        }
        return (array)$settings['settings'];
    }
1359592
public function build(): SetScriptSourceRequest
	{
		$instance = new SetScriptSourceRequest();
		if ($this->scriptId === null) {
			throw new BuilderException('Property [scriptId] is required.');
		}
		$instance->scriptId = $this->scriptId;
		if ($this->scriptSource === null) {
			throw new BuilderException('Property [scriptSource] is required.');
		}
		$instance->scriptSource = $this->scriptSource;
		$instance->dryRun = $this->dryRun;
		return $instance;
	}
276039
public function toAssoc(): array
    {
        $assoc = object_get_properties($this, $this instanceof DynamicEntity);

        /** @var Event\ToAssoc $event */
        $event = $this->dispatchEvent(new Event\ToAssoc($this, $assoc));
        $updatedAssoc = $event->getPayload();

        return $updatedAssoc;
    }
46304
public function load()
    {
        if (!empty($this->_statements)) {
            return;
        }

        foreach ($this->data as $type=>$item) {
            if (!is_array($item)) {
                $item = array( $item );
            }
            $use_statements = Config::get('use-statements');
            $adapter_name = isset($use_statements[$type]) ? $use_statements[$type] : null;
            if (!empty($adapter_name)) {
                $cls_name = 'AssetsManager\Package\PresetAdapter\\'.$adapter_name;
                if (@class_exists($cls_name)) {
                    $interfaces = class_implements($cls_name);
                    $config_interface = Config::getInternal('assets-preset-adapter-interface');
                    if (in_array($config_interface, $interfaces)) {
                        if (!isset($this->_statements[$type])) {
                            $this->_statements[$type] = array();
                        }
                        foreach ($item as $item_ctt) {
                            if (!is_array($item_ctt)) {
                                $item_ctt = array( $item_ctt );
                            }
                            $statement = new $cls_name($item_ctt, $this);
                            $statement->parse();
                            $this->_statements[$type][] = $statement;
                        }
                    } else {
                        throw new \DomainException(
                            sprintf('Preset statement class "%s" must implement interface "%s"!',
                                $cls_name, $config_interface)
                        );
                    }
                } else {
                    throw new \DomainException(
                        sprintf('Preset statement class "%s" not found!', $cls_name)
                    );
                }
            } else {
                throw new \LogicException(
                    sprintf('Unknown preset statement type "%s" in preset "%s"!', $type, $this->getName())
                );
            }
        }
    }
511295
protected function getResourceMethodConfiguration(): array
    {
        return [
            ResourceMethodEnum::GET_ALL_FOR_TASK => RequestPathFormatEnum::DEPENDENCIES_FOR_TASK,
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::DEPENDENCIES_BY_ID,
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::DEPENDENCIES_BY_IDS,
            ResourceMethodEnum::CREATE_FOR_TASK => RequestPathFormatEnum::DEPENDENCIES_FOR_TASK,
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::DEPENDENCIES_BY_ID,
            ResourceMethodEnum::DELETE => RequestPathFormatEnum::DEPENDENCIES_BY_ID,
        ];
    }
1076427
protected function getResourceMethodConfiguration(): array
    {
        return [
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::CONTACTS,
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::CONTACTS_BY_ID,
            ResourceMethodEnum::GET_BY_IDS => RequestPathFormatEnum::CONTACTS_BY_ID,
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::CONTACTS_BY_ID,
        ];
    }
446273
public function toArray()
    {
        $array = [
            "type"   => $this->getType(),
            "source" => $this->getSource()->toArray(),
        ];

        if (!empty($this->getSharedFields())) {
            $array['sharedFields'] = $this->getSharedFields();
        }

        if (!empty($this->getCommonFields())) {
            $array['commonFields'] = $this->getCommonFields();
        }

        return $array;
    }
594740
private function getSymfonyCompatibleGettersAndSetters()
    {

        return array();

        if( !$this->symfonyFormGetters ) {
            return array();
        }

        // build output
        $output = explode( "\n", <<<PHP
/**
* Symfony2 compatible getters and setters.
* These are __not__ to be used by Bond code. These have be depreciated.
*/
// /*
PHP
        );

        $output = array_merge(
            $output,
            $this->symfonyFormGetters,
            array(''),
            $this->symfonyFormSetters,
            array('/**/')
        );

        return $output;

    }
714954
public function toArray(): array
    {
        $return = [];
        foreach ($this as $row) {
            if (is_array($row)) {
                $return[] = $row;
            } elseif (method_exists($row, 'toArray')) {
                $return[] = $row->toArray();
            } elseif (method_exists($row, 'getArrayCopy')) {
                $return[] = $row->getArrayCopy();
            } else {
                throw new Exception\RuntimeException(
                    __METHOD__ . ': Rows as part of this DataSource, with type ' . gettype($row) . ' cannot be cast to an array'
                );
            }
        }

        return $return;
    }
479876
protected function getArrayInternal()
    {
        try {
            return $this->yaml->setResource($this->resource)->getArray();
        } catch (\Exception $e) {
            throw new ConfigException($e->getMessage());
        }
    }