Mixgray

@param string|resource $source
@param array           $settings = []

@return GD
508471
public function mixGray($source, Array $settings = []) : GD
    {
        $this->mix($source, $settings, 'imagecopymergegray');

        return $this;
    }
294658
public function injectSettings(array $settings)
    {
        if (isset($settings['security']['authentication']['authenticationStrategy'])) {
            $authenticationStrategyName = $settings['security']['authentication']['authenticationStrategy'];
            switch ($authenticationStrategyName) {
                case 'allTokens':
                    $this->authenticationStrategy = self::AUTHENTICATE_ALL_TOKENS;
                    break;
                case 'oneToken':
                    $this->authenticationStrategy = self::AUTHENTICATE_ONE_TOKEN;
                    break;
                case 'atLeastOneToken':
                    $this->authenticationStrategy = self::AUTHENTICATE_AT_LEAST_ONE_TOKEN;
                    break;
                case 'anyToken':
                    $this->authenticationStrategy = self::AUTHENTICATE_ANY_TOKEN;
                    break;
                default:
                    throw new Exception('Invalid setting "' . $authenticationStrategyName . '" for security.authentication.authenticationStrategy', 1291043022);
            }
        }

        if (isset($settings['security']['csrf']['csrfStrategy'])) {
            $csrfStrategyName = $settings['security']['csrf']['csrfStrategy'];
            switch ($csrfStrategyName) {
                case 'onePerRequest':
                    $this->csrfProtectionStrategy = self::CSRF_ONE_PER_REQUEST;
                    break;
                case 'onePerSession':
                    $this->csrfProtectionStrategy = self::CSRF_ONE_PER_SESSION;
                    break;
                case 'onePerUri':
                    $this->csrfProtectionStrategy = self::CSRF_ONE_PER_URI;
                    break;
                default:
                    throw new Exception('Invalid setting "' . $csrfStrategyName . '" for security.csrf.csrfStrategy', 1291043024);
            }
        }
    }
323940
public function applyToMenuSource(\Gems_Menu_ParameterSource $source)
    {
        $source->setRespondentTrackId($this->_respTrackId);
        $source->offsetSet(
                'gr2t_active',
                (isset($this->_respTrackData['gr2t_active']) ? $this->_respTrackData['gr2t_active'] : 0)
                );
        $source->offsetSet('can_edit', $this->hasSuccesCode() ? 1 : 0);
        $source->offsetSet('track_can_be_created', 0);

        $this->getRespondent()->applyToMenuSource($source);
        $this->getTrackEngine()->applyToMenuSource($source);

        return $this;
    }
1289932
protected function buildSet(
        /*# string */ $prefix,
        array $settings
    )/*# : array */ {
        if ($this instanceof UpdateStatementInterface) {
            return $this->buildUpdateSet($prefix, $settings);
        } else {
            return $this->buildInsertSet($prefix, $settings);
        }
    }
44811
public function merge( $source ) {
		if ( $source instanceof self ) {
			$source = $source->to_array();
		}

		if ( ! is_array( $source ) ) {
			throw new InvalidArgumentException( 'Combine must be a Dictionary or an array' );
		}

		return new static( $this->get_key_type(), $this->get_value_type(), array_merge( $this->storage, $source ) );
	}
816221
protected function buildCol(
        /*# string */ $prefix,
        array $settings
    )/*# : string */ {
        $clause = &$this->getClause('COL');
        if ($this instanceof SelectStatementInterface && empty($clause)) {
            $clauseParts = ['*'];
        } else {
            $clauseParts = [];
        }
        return $this->buildClause('COL', $prefix, $settings, $clauseParts);
    }
749937
public static function mergeWithDefaultSettings($settings)
    {
        if (empty($settings)) {
            return static::getDefaultSettings();
        }
        if (is_array($settings)) {
            return array_merge(static::getDefaultSettings(), $settings);
        }
        throw new Exception("Argument must be an array.");
    }
840483
protected function getCompiledLocalResourceRepositoryKey(ResourceSettings $settings) : string
    {
        return sprintf('compiled.%s.%s', $settings->theme->getKey(), $this->getAttributes($settings));
    }
455141
public function setS3Client($settings)
	{
		$storage = new S3StorageHelper;
		$storage->region = $settings['region'];
		$storage->bucket = $settings['bucket'];
		$storage->credentials = $settings['credentials'];
		$storage->defaultAcl = $settings['defaultAcl'];

		if(isset($settings['cdnHostname'])) {
			$storage->cdnHostname = $settings['cdnHostname'];
		}
		if(isset($settings['debug'])) {
			$storage->debug = $settings['debug'];
		}
		if(isset($settings['options'])) {
			$storage->options = $settings['options'];
		}
		$storage->init();

		return $storage;
	}
634104
public function create(array $settings = [])
    {
        $defaultDriver = $this->config->get('doctrine.cache.default', 'array');

        $configuration = $this->setup->createConfiguration(
            Arr::get($settings, 'dev', false),
            Arr::get($settings, 'proxies.path'),
            $this->cache->driver($defaultDriver)
        );

        $this->setMetadataDriver($settings, $configuration);

        $driver = $this->getConnectionDriver($settings);

        $connection = $this->connection->driver(
            $driver['driver'],
            $driver
        );

        if ($this->isMasterSlaveConfigured($driver)) {
            $this->hasValidMasterSlaveConfig($driver);
            $connection = (new MasterSlaveConnection($this->config, $connection))->resolve($driver);
        }

        $this->setNamingStrategy($settings, $configuration);
        $this->setCustomFunctions($configuration);
        $this->setCustomHydrationModes($configuration);
        $this->setCacheSettings($configuration);
        $this->configureProxies($settings, $configuration);
        $this->setCustomMappingDriverChain($settings, $configuration);
        $this->registerPaths($settings, $configuration);
        $this->setRepositoryFactory($settings, $configuration);

        $configuration->setDefaultRepositoryClassName(
            Arr::get($settings, 'repository', EntityRepository::class)
        );

        $configuration->setEntityListenerResolver($this->resolver);

        $manager = EntityManager::create(
            $connection,
            $configuration
        );

        $manager = $this->decorateManager($settings, $manager);

        $this->setLogger($manager, $configuration);
        $this->registerListeners($settings, $manager);
        $this->registerSubscribers($settings, $manager);
        $this->registerFilters($settings, $configuration, $manager);
        $this->registerMappingTypes($settings, $manager);

        return $manager;
    }
191238
public function polygon(Array $settings = []) : GD
    {
        $points     = $settings['points']     ?? $this->points     ?? 0;
        $pointCount = $settings['pointCount'] ?? $this->pointCount ?? (ceil(count($this->points ?? $points) / 2));
        $color      = $settings['color']      ?? $this->color      ?? '0|0|0';
        $style      = $settings['type']       ?? $this->type       ?? NULL;

        if( $style === NULL )
        {
            imagepolygon($this->canvas, $points, $pointCount, $this->allocate($color));
        }
        else
        {
            imagefilledpolygon($this->canvas, $points, $pointCount, $this->allocate($color));
        }

        $this->defaultRevolvingVariables();

        return $this;
    }
807235
protected function prepareResourceSettings(ResourceSettings $settings) : ?ResourceSettings
    {
        if ($settings->order === -1) {
            $settings->order = $this->order;
        }

        if ($settings->url !== null) {
            return $settings;
        }

        $settings->resourcePath = $this->getResourcePath($settings->filename, $settings->theme);
        $settings->exists       = is_file($settings->resourcePath);

        if ($settings->automin) {
            $settings->filename = $this->searchForMinifiedResource($settings);
        }

        if (!$settings->exists) {
            if ($settings->defaultFallback && !$this->themeIsDefault($settings->theme)) {
                $settings->theme = $this->getDefaultTheme();

                return $this->prepareResourceSettings($settings);
            }

            $this->missing($settings->filename, $settings->theme);

            return null;
        }

        $settings->mtime = filemtime($this->getResourcePath($settings->filename, $settings->theme));

        return $settings;
    }
1074617
protected function searchForMinifiedResource(ResourceSettings $settings, string $min = 'min') : string
    {
        if (strpos($settings->filename, ".{$min}.") !== false) {
            return $settings->filename;
        }

        $pathinfo = pathinfo($settings->resourcePath);

        $minResource = "{$pathinfo['filename']}.{$min}.{$pathinfo['extension']}";

        return $this->exists($minResource, $settings->theme) ? $minResource : $settings->filename;
    }
1090000
public function enqueue( $settings ) {
		$styles = $this->get_styles();

		if ( ! empty( $styles ) ) {
			$settings['styles'][] = [ 'css' => $styles ];
		}

		return $settings;
	}
639643
public function resample($source, Array $settings = [], $function = 'imagecopyresampled') : GD
    {
        if( is_file($file = $source) )
        {
            $source = $this->createFrom($source);
        }

        if( ! is_resource($source) )
        {
            throw new InvalidArgumentException(NULL, '[resource]');
        }

        $this->alignImageWatermark($file);

        $xt = $settings['xt'] ?? $this->target[0]    ?? 0;
        $yt = $settings['yt'] ?? $this->target[1]    ?? 0;
        $xs = $settings['xs'] ?? $this->source[0]    ?? 0;
        $ys = $settings['ys'] ?? $this->source[1]    ?? 0;
        $wt = $settings['wt'] ?? $this->width        ?? $this->targetWidth  ?? 0;
        $ht = $settings['ht'] ?? $this->height       ?? $this->targetHeight ?? 0;
        $ws = $settings['ws'] ?? $this->sourceWidth  ?? 0;
        $hs = $settings['hs'] ?? $this->sourceHeight ?? 0;

        $function($this->canvas, $source, $xt, $yt, $xs, $ys, $wt, $ht, $ws, $hs);

        $this->defaultRevolvingVariables();

        return $this;
    }
621157
protected function getCompiledLocalResourceRepositoryKey(ResourceSettings $settings) : string
    {
        return sprintf('compiled.%s.%s', $settings->theme->getKey(), $this->crc($settings->media));
    }
702566
public function make(array $rules, AppliesToResource $resource=null)
    {

        if (!$resource) {
            $validator = $this->firstNotNullResultOrFail('make', $rules, $resource);
            return $this->configureAndReturn($validator, $rules, $resource);
        }

        $resourceName = $resource->resourceName();

        if (!isset($this->resourceFactories[$resourceName])) {
            return $this->firstNotNullResultOrFail('make', $rules, $resource);
        }

        $validator = call_user_func($this->resourceFactories[$resourceName]);

        return $this->configureAndReturn($validator, $rules, $resource);

    }