Declares the forbidden array structure.

@return void
480549
protected function setUp(): void
    {
        parent::setUp();

        $this->invalidStructure = [
            T_ARRAY => [T_OPEN_PARENTHESIS, T_CLOSE_PARENTHESIS],
            T_OPEN_SHORT_ARRAY => [T_CLOSE_SHORT_ARRAY]
        ];
    }
863976
private static function _initialize() 
    {
        for ($i=self::SINGULAR; $i <= self::IRREGULAR; $i++) {
            if (!array_key_exists($i, self::$_inflections)) {
                self::$_inflections[$i] = array();
            }
        }
    }
900734
protected function normalizeDirArray()
    {
        if (!isset($this->dir['iterate'])) {
            $this->dir['iterate'] = self::DEFAULT_ITERATE;
        }
        if (!isset($this->dir['path'])) {
            $this->dir['path'] = self::DEFAULT_PATH;
        }
        if (!isset($this->dir['recursive'])) {
            $this->dir['recursive'] = self::DEFAULT_RECURSIVE;
        }
    }
1156900
public function warnf()
    {
        $args = func_get_args();
        $format = array_shift($args);
        $this->warn(vsprintf($format, $args));
    }
916991
function assign($array)
    {
        if (!is_array($array) && !($array instanceof \Traversable)) {
            throw new \InvalidArgumentException('$array must be array or Traversable.');
        }

        foreach ($array as $key => $value) {
            $this->storage[$key] = $value;
        }
    }
480581
private function _initLanguageArrays()
    {
        $this->_scanningProject();

        $languageSources = LanguageSource::find()->all();

        foreach ($languageSources as $languageSource) {
            if (isset($this->_languageElements[$languageSource->category][$languageSource->message])) {
                unset($this->_languageElements[$languageSource->category][$languageSource->message]);
            } else {
                $this->_removableLanguageSourceIds[$languageSource->id] = $languageSource->id;
            }
        }
    }
404880
public function setList($array)
    {
        $listString = '';
        foreach ($array as $key => $value) {
            $listString .= CPS_Term($value, $key);
        }
        $this->setParam('list', $listString);
    }
20468
public function push(/* variadic arguments allowed */)
    {
        if (func_num_args()) {
            $args = array_merge([&$this->elements], func_get_args());
            call_user_func_array('array_push', $args);
        }

        return $this;
    }
641489
protected function filterElements(array &$elements): void
    {
        if (!empty($elements['storage_key'])) {
            $this->_storage['storage_key'] = trim($elements['storage_key']);
        }
        if (!empty($elements['storage_timestamp'])) {
            $this->_storage['storage_timestamp'] = (int)$elements['storage_timestamp'];
        }

        unset ($elements['storage_key'], $elements['storage_timestamp'], $elements['_post_entries_save']);
    }
366867
private function declareStructure()
    {
        $up = $this->method('up')->setAccess(MethodDeclaration::ACCESS_PUBLIC);
        $down = $this->method('down')->setAccess(MethodDeclaration::ACCESS_PUBLIC);

        $up->setComment('Create tables, add columns or insert data here');
        $down->setComment('Drop created, columns and etc here');
    }
463533
public function index() {
        if ($this->overrideAction('index')) {
            return;
        }

        $this->paginate = array_merge(array(
            'limit' => 25,
            'order' => array($this->Model->alias . '.' . $this->Model->displayField => 'ASC'),
            'contain' => array_keys($this->Model->belongsTo)
        ), $this->Model->admin['paginate']);

        $this->AdminToolbar->setBelongsToData($this->Model);

        // Filters
        if (!empty($this->request->params['named'])) {
            $this->paginate['conditions'] = $this->AdminToolbar->parseFilterConditions($this->Model, $this->request->params['named']);
        }

        // Batch delete
        if ($this->request->is('post')) {
            if (!$this->Model->admin['batchProcess']) {
                throw new ForbiddenException(__d('admin', 'Batch Access Protected'));
            }

            $action = $this->request->data[$this->Model->alias]['batch_action'];
            $items = $this->request->data[$this->Model->alias]['items'];
            $processed = array();

            foreach ($items as $id) {
                if (!$id) {
                    continue;
                }

                if ($action === 'delete_item') {
                    if ($this->Model->delete($id, true)) {
                        $processed[] = $id;
                    }
                } else {
                    if (call_user_func(array($this->Model, $action), $id)) {
                        $processed[] = $id;
                    }
                }
            }

            $count = count($processed);

            if ($count > 0) {
                $this->AdminToolbar->logAction(ActionLog::BATCH_DELETE, $this->Model, '', sprintf('Processed IDs: %s', implode(', ', $processed)));
                $this->AdminToolbar->setFlashMessage(__d('admin', '%s %s have been processed', array($count, mb_strtolower($this->Model->pluralName))));

                $this->request->data[$this->Model->alias] = array();
            }
        }

        $this->set('results', $this->paginate($this->Model));
        $this->overrideView('index');
    }
543455
private function doDestruct()
    {
        if ($this->initializer && null === $this->info['error']) {
            ($this->initializer)($this);
            $this->initializer = null;
            $this->checkStatusCode();
        }
    }
472731
private function checkAndRegisterDisallowedTagsError(): void
    {
        $disallowedTags = $this->getDisallowedTags();
        $tags = $this->getAllTags();

        foreach ($tags as $tagPos => $tag) {
            $tagContent = $tag['content'];

            if (in_array(substr($tagContent, 1), $disallowedTags)) {
                $this->file->addError(
                    self::MESSAGE_TAG_NOT_ALLOWED,
                    $tagPos,
                    static::CODE_TAG_NOT_ALLOWED,
                    [$tagContent]
                );
            }
        }
    }
110868
public static function push(&$array)
    {
        $params = func_get_arg();

        for ($i = 1; $i < static::count($params); $i++) {
            array_push($array, $params[$i]);
        }
    }
203029
public function SetNotRequired()
    {
        $unsetIndices = array();
        foreach($this->validators as $index=>$validator)
        {
            if ($validator instanceof Validation\Required)
                $unsetIndices[] = $index;
        }
        foreach($unsetIndices as $index)
        {
            unset($this->validators[$index]);
        }
    }
869257
private function initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                if (self::CONTAINS_KEY === $param->getType()) {
                    $cont = new Contains();
                    $cont->setValue($param->getValue());
                    $this->contains[] = $cont;
                } elseif (self::NEGATE_KEY === $param->getType()) {
                    $this->setNegate(Project::toBoolean($param->getValue()));
                }
            }
        }
    }
702921
public function getAllowedValues()
    {
        $inArrayFilters = $this->getRequirements()->filter(
            function($value) {
                return $value instanceof InArray;
            }
        );

        if (count($inArrayFilters) > 0) {
            return $inArrayFilters->first()->getValues();
        }
        return [];
    }