@param MMatchStrategy $strategy

@return RMatchStrategy
494296
protected static function convertPartialMatchStrategy($strategy)
  {
    /** @var RMatchStrategy $convertedStrategy */
    $convertedStrategy = null;
    if (!empty($strategy)) {
      $rules = $strategy->getRules();
      if (!empty($rules)) {
        $convertedStrategy = new RMatchStrategy();
        /** @var MPartialMatchRule $r */
        foreach ($rules as $r) {
          array_push($rules, Query::convertPartialMatchRule($r));
        }
        $strategy->setRules($rules);
      }
    }
    return $convertedStrategy;
  }
1056804
public function assignHavingAppliers(HavingClauseStrategy $strategy)
    {
        if ($this->havingAppliers) {
            $items = $strategy->getHaving();

            $strategy->clearHaving();

            foreach ($this->havingAppliers as $applier) {
                $clause = $this->connection()->having();

                call_user_func_array($applier, [$clause]);

                $strategy->havingConditions($clause);
            }

            if ($items) {
                $clause = $this->connection()->having();

                foreach ($items as $where) {
                    $clause->addHaving($where['logic'], $where['sql'], $where['params']);
                }

                $strategy->havingConditions($clause);
            }
        }

        return $this;
    }
190968
public static function create($strategyName): StrategyInterface
    {
        if ($strategyName instanceof StrategyInterface) {
            return $strategyName;
        }

        if (\is_callable($strategyName)) {
            return new CallbackStrategy($strategyName);
        }

        if (\is_string($strategyName)) {
            $requiredInterface = StrategyInterface::class;
            $predefinedStrategy = '\\Elastica\\Connection\\Strategy\\'.$strategyName;

            if (\class_exists($predefinedStrategy) && \class_implements($predefinedStrategy, $requiredInterface)) {
                return new $predefinedStrategy();
            }

            if (\class_exists($strategyName) && \class_implements($strategyName, $requiredInterface)) {
                return new $strategyName();
            }
        }

        throw new InvalidException('Can\'t create strategy instance by given argument');
    }
793764
@Override
	public <T extends Endpoint> Strategy<T> create() {
		return new XorShiftRandomStrategy<T>(broker, preferLocal);
	}
293064
protected function applyStrategies(\Jb\Bundle\TagCloudBundle\Model\TagCloud $tagCloud)
    {
        foreach ($this->strategies as $strategy) {
            $strategy->process($tagCloud);
        }
    }
458682
protected function getExportStrategyInstance($strategy)
    {
        /** @var ModelExportStrategyData $strategyData */
        $strategyData = array_get($this->getModelInformation()->export->strategies, $strategy);

        $instance = $this->getExportStrategyFactory()->make($strategyData->strategy);

        if ($strategyData) {
            $instance->setStrategyData($strategyData);
        }

        return $instance;
    }
380699
protected function resolveStrategyClass($strategy)
    {
        if ( ! str_contains($strategy, '.')) {
            $strategy = config('cms-models.strategies.list.sort-aliases.' . $strategy, $strategy);
        }

        if (class_exists($strategy) && is_a($strategy, SortStrategyInterface::class, true)) {
            return $strategy;
        }

        $strategy = $this->prefixStrategyNamespace($strategy);

        if (class_exists($strategy) && is_a($strategy, SortStrategyInterface::class, true)) {
            return $strategy;
        }

        return false;
    }
296466
protected static function getListStrategy($listType) {
    // get list strategies
    if (self::$listStrategies == null) {
      self::$listStrategies = ObjectFactory::getInstance('listStrategies');
    }

    $strategy = null;

    // search strategy
    if (isset(self::$listStrategies[$listType])) {
      $strategy = self::$listStrategies[$listType];
    }
    else {
      throw new ConfigurationException('No ListStrategy implementation registered for '.$listType);
    }
    return $strategy;
  }
674081
public function deleteStrategy()
    {
        if (null === $this->delete_strategy || false === $this->delete_strategy) {
            return false;
        }

        return $this->delete_strategy;
    }
484927
public function fetch($strategy)
    {
        $method = 'fetch'.Inflector::classify(strtolower($strategy));

        if (!method_exists($this->association, $method)) {
            throw new InvalidArgumentException('Fetch ['.$strategy.'] does not exist');
        }

        $this->{$method}();

        return $this;
    }
1213508
protected function _resolveStrategy($strategy)
    {
        $key = Security::salt();

        if (!$strategy) {
            $class = self::DEFAULT_STRATEGY;
            $strategy = new $class($key);
        }

        if (is_string($strategy) && class_exists($strategy)) {
            $strategy = new $strategy($key);
        }

        if (!($strategy instanceof StrategyInterface)) {
            throw new Exception('Invalid "strategy" configuration.');
        }

        return $strategy;
    }
280609
public EvictionConfigurationBuilder strategy(EvictionStrategy evictionStrategy) {
      memory().evictionStrategy(evictionStrategy);
      attributes.attribute(STRATEGY).set(evictionStrategy);
      return this;
   }
121667
public function setSaveStrategy($strategy)
    {
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
            throw new InvalidArgumentException($msg);
        }

        $this->_saveStrategy = $strategy;

        return $this;
    }
467977
public static function matchesStrategy($strategy, Release $release1, Release $release2 = null)
    {
        if (in_array($strategy, array(self::MATCH_MAJOR_DIFFERENCE, self::MATCH_MINOR_DIFFERENCE, self::MATCH_ALWAYS)) === false) {
            throw new InvalidArgumentException(sprintf('The match strategy "%s" is invalid.', $strategy));
        }

        if ($strategy === self::MATCH_ALWAYS) {
            return true;
        }

        $match = false;
        $versionCategoryDifference = self::getDifference($release1, $release2);
        if ($strategy === self::MATCH_MAJOR_DIFFERENCE && $versionCategoryDifference === self::MAJOR) {
            $match = true;
        } elseif ($strategy === self::MATCH_MINOR_DIFFERENCE && in_array($versionCategoryDifference, array(self::MAJOR, self::MINOR))) {
            $match = true;
        }

        return $match;
    }
1125012
public function assignFromAppliers(FromClauseStrategy $strategy)
    {
        if ($this->fromAppliers) {
            $items = $strategy->getFrom();

            $strategy->clearFrom();

            foreach ($this->fromAppliers as $applier) {
                $clause = $this->connection()->from();

                call_user_func_array($applier, [$clause]);

                foreach ($clause->getFrom() as $from) {
                    $strategy->addFrom($from['tableKey'], $from['table'], $from['alias'], $from['params']);
                }
            }

            foreach ($items as $from) {
                $strategy->addFrom($from['tableKey'], $from['table'], $from['alias'], $from['params']);
            }
        }

        return $this;
    }
81281
protected function executeStrategiesMethod($method)
    {
        $this->onStrategies(function (AbstractStrategy $strategy) use ($method) {
            return $strategy->$method();
        });

        return $this->passed();
    }
1279450
public function assignOrderByAppliers(OrderByClauseStrategy $strategy)
    {
        if ($this->orderByAppliers) {
            $items = $strategy->getOrderBy();

            $strategy->clearOrderBy();

            foreach ($this->orderByAppliers as $applier) {
                $clause = $this->connection()->orderBy();

                call_user_func_array($applier, [$clause]);

                foreach ($clause->getOrderBy() as $orderBy) {
                    $strategy->addOrderBy($orderBy['sql'], $orderBy['type'], $orderBy['params']);
                }
            }

            foreach ($items as $orderBy) {
                $strategy->addOrderBy($orderBy['sql'], $orderBy['type'], $orderBy['params']);
            }
        }

        return $this;
    }