Prepare strategies before the hydrator is used

@throws \InvalidArgumentException
@return void
13303
protected function prepareStrategies()
    {
        $associations = $this->metadata->getAssociationNames();

        foreach ($associations as $association) {
            if ($this->metadata->isCollectionValuedAssociation($association)) {
                // Add a strategy if the association has none set by user
                if (! $this->hasStrategy($association)) {
                    if ($this->byValue) {
                        $strategyClassName = $this->getDefaultByValueStrategy();
                    } else {
                        $strategyClassName = $this->getDefaultByReferenceStrategy();
                    }

                    $this->addStrategy($association, new $strategyClassName());
                }

                $strategy = $this->getStrategy($association);

                if (! $strategy instanceof Strategy\AbstractCollectionStrategy) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'Strategies used for collections valued associations must inherit from '
                            . 'Strategy\AbstractCollectionStrategy, %s given',
                            get_class($strategy)
                        )
                    );
                }

                $strategy->setCollectionName($association)
                         ->setClassMetadata($this->metadata);
            }
        }
    }
65609
function prepare()
    {
        $this->query = null;
        $this->count = null;
        $this->items = null;
    }
259278
protected function prepareForPresentation()
    {
        if ($this->prepared) {
            return;
        }

        if ($this->isMenuCached()) {
            list($layout, $permissionsIndex) = $this->retrieveMenuFromCache();
        } else {
            list($layout, $permissionsIndex) = $this->interpretMenuData();
        }

        if ( ! $this->ignorePermission && ! $this->auth->admin()) {
            $layout = $this->permissionsFilter->filterLayout($layout, $this->auth->user(), $permissionsIndex);
        }

        $this->menuLayout           = new Collection($layout->layout());
        $this->alternativePresences = new Collection($layout->alternative());

        $this->prepared = true;
    }
1022884
protected function prepare()
    {
        //Force passice mode if not specified
        $this->addOption('passive', true);

        //To make call on different files, we must retrieve the root and apply commands to the path
        $tmp = clone $this->getUrl();
        $tmp->path('');
        $this->addOption('url', $tmp->toString());
    }
1323605
private function prepareToRendering() {
		$this->tm()->confirmed() ? $this->prepare() : $this->prepareUnconfirmed();
		if ($this->isTest()) {
			$this->si('Mode', __($this->testModeLabel()));
		}
		$this->prepareDic();
		$this->dic()->sort();
	}
472398
public function init()
    {

        // initialize the prepared statements
        $this->productDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_DATETIMES));
    }
920094
protected function prepareForValidation(): void
    {
        $data = $this->all();

        // Set abilities
        if (! empty($data['abilities'])) {
            if ($this->user($this->route('guard'))->can('grant', \Cortex\Auth\Models\Ability::class)) {
                $abilities = array_map('intval', $this->get('abilities', []));
                $data['abilities'] = $this->user($this->route('guard'))->isA('superadmin') ? $abilities
                    : $this->user($this->route('guard'))->getAbilities()->pluck('id')->intersect($abilities)->toArray();
            } else {
                unset($data['abilities']);
            }
        }

        $this->replace($data);
    }
39860
protected function prepare()
    {
        $this->register('require', function($context, $path) {
            $context->requireAsset($path);
        });

        $this->register('depend_on', function($context, $path) {
            $context->dependOn($path);
        });

        $this->register('require_tree', function($context, $path) {
            $context->requireTree($path);
        });

        $this->body = $this->getData();

        if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {
            $this->header = $matches[0];
            $this->body = substr($this->getData(), strlen($matches[0])) ?: '';
        }

        $this->processed = array();
    }
345819
public function prepare()
    {    
        if (!empty($this->module->templateTransCat)) {
            $this->tcModule = $this->module->tcModule;
            $this->tcModels = $this->module->tcModels;
            
            $id = Inflector::camel2id(basename($this->className()));
            $this->tc = str_replace('*', "/model-{$id}", $this->module->templateTransCat);
        }
        if (!empty($this->module->params['pageSize'])) {
            $this->pageSize = $this->module->params['pageSize'];
        }
    }
837221
protected function prepareForValidation(): void
    {
        $data = $this->all();

        $data['domain'] = $this->getHost();

        $this->replace($data);
    }
966494
protected function prepare()
    {
        $this->initPurifier($this->config->getPurifierCacheLocation());

        $this->oldText = $this->purifyHtml($this->oldText);
        $this->newText = $this->purifyHtml($this->newText);
    }
1044635
protected function initialize()
    {
        if ($this->initialized) {
            return;
        }

        if (! is_object($this->prototype)) {
            $this->prototype = new ArrayObject;
        }

        if (! $this->hydrator instanceof HydratorInterface) {
            $this->hydrator = new ArraySerializable;
        }

        $this->initialized = true;
    }
1368064
protected function prepare() {
		$cf = $this->cf(); /** @var CF $cf */
		$this->siID();
		$this->si($this->cardNumberLabel(), $cf->label());
		$cf->c()->owner() ? $this->siEx('Cardholder', $cf->c()->owner()) : null;
		$this->siEx(['Card Expiration' => $cf->exp(), 'Card Country' => $cf->country()]);
	}
209748
protected function prepareForValidation(): void
    {
        $data = $this->all();

        $guardian = $this->route('guardian') ?? app('cortex.auth.guardian');

        if ($guardian->exists && empty($data['password'])) {
            unset($data['password'], $data['password_confirmation']);
        }

        $this->replace($data);
    }
655509
public function init()
    {

        // initialize the prepared statements
        $this->categoryDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_DATETIMES));
        $this->categoryDatetimesByPkAndStoreIdStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CATEGORY_DATETIMES_BY_PK_AND_STORE_ID));
    }
426562
public function prepare()
    {
        $this->taskFileSystemStack()
             ->mkdir($this->getDistDir())
             ->mkdir($this->getTargetDir())
             ->mkdir($this->getReportsDir())
             ->run();
    }
383600
protected function initialize()
    {
        if ($this->isInitialized) {
            return;
        }
        if (!$this->dbAdapter instanceof Adapter) {
            throw new \Exception('No db adapter present');
        }
        if (!$this->hydrator instanceof HydratorInterface) {
            $this->hydrator = new ClassMethods;
        }
        if (!is_object($this->entityPrototype)) {
            throw new \Exception('No entity prototype set');
        }

        $this->isInitialized = true;
    }