@return ?array

@psalm-suppress MixedAssignment
@psalm-suppress MixedTypeCoercion
193800
public function getCachedFileClassReferences()
    {
        $cache_directory = $this->config->getCacheDirectory();

        if (!$cache_directory) {
            return null;
        }

        $reference_cache_location = $cache_directory . DIRECTORY_SEPARATOR . self::FILE_CLASS_REFERENCE_CACHE_NAME;

        if (!is_readable($reference_cache_location)) {
            return null;
        }

        $reference_cache = unserialize((string) file_get_contents($reference_cache_location));

        if (!is_array($reference_cache)) {
            throw new \UnexpectedValueException('The reference cache must be an array');
        }

        return $reference_cache;
    }
618343
public function toArray()
    {
        return array(
            'name' => $this->_name,
            'type' => $this->_datatype,
            'length' => $this->_length,
            'notnull' => $this->_notnull,
            'default' => $this->_default,
            'autoincrement' => $this->_autoIncrement,
            'comment' => $this->_comment,
        );
    }
1192003
public function toArray()
    {
        return [
            'required'      => $this->isRequired(),
            'hidden'        => $this->isHidden(),
            'persistent'    => $this->isPersistent(),
            'whenReplicate' => $this->getWhenReplicate()->toArray(),
            'whenPatch'     => $this->getWhenPatch()->toArray(),
        ];
    }
104875
public function get(): array
    {
        $result = [];

        $filter = $this->jory->getFilter();
        if ($filter !== null) {
            $result[$this->keyRepository->get('flt')] = $this->getFilterArray($filter);
        }
        $sorts = $this->jory->getSorts();
        if (!empty($sorts)) {
            $result[$this->keyRepository->get('srt')] = $this->getSortsArray($sorts);
        }
        $relations = $this->jory->getRelations();
        if (!empty($relations)) {
            $result[$this->keyRepository->get('rlt')] = $this->getRelationsArray($relations);
        }
        if ($this->jory->getOffset() !== null) {
            $result[$this->keyRepository->get('ofs')] = $this->jory->getOffset();
        }
        if ($this->jory->getLimit() !== null) {
            $result[$this->keyRepository->get('lmt')] = $this->jory->getLimit();
        }
        if ($this->jory->getFields() !== null) {
            $result[$this->keyRepository->get('fld')] = $this->jory->getFields();
        }

        return $result;
    }
251964
public function getValues()
    {
        $values = $this->entity->getValues();
        $result = [];
        if ($values) {
            foreach ($values as $value) {
                $result[] = new OperatorValue($value, $this->locale);
            }

            return $result;
        }

        return;
    }
737605
public function locateSchemas(): array
    {
        if (!$this->container->has(ClassesInterface::class)) {
            return [];
        }

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

        $schemas = [];
        foreach ($classes->getClasses(RecordEntity::class) as $class) {
            if ($class['abstract']) {
                continue;
            }

            $schemas[] = $this->container->get(FactoryInterface::class)->make(
                RecordSchema::class,
                ['reflection' => new ReflectionEntity($class['name']),]
            );
        }

        return $schemas;
    }
1339728
protected function getChecked()
    {
        $return = [];

        $class = $this->compileEntity();
        $res = $class::getList([
            'select' => ['*'],
        ])->fetchAll();

        foreach ($res as $key => $value) {
            $return[$value['UF_MIGRATION_NAME']] = $value;
        }

        return $return;
    }
891563
public static function toArray()
    {
        $class = get_called_class();
        if (!array_key_exists($class, self::$cache)) {
            $reflection          = new \ReflectionClass($class);
            self::$cache[$class] = $reflection->getConstants();
        }

        return self::$cache[$class];
    }
417542
private static function _getCharMap(): array
    {
        // Keep local copy
        static $map = [];

        if (empty($map)) {
            // This will replace accented chars with non-accented chars
            foreach (StringHelper::asciiCharMap() as $asciiChar => $charsArray) {
                foreach ($charsArray as $char) {
                    $map[$char] = $asciiChar;
                }
            }

            // Replace punctuation with a space
            foreach (self::_getPunctuation() as $value) {
                $map[$value] = ' ';
            }
        }

        // Return the char map
        return $map;
    }
421688
protected function getAttributesDictionnary() : array
    {
        // Get attributes that belongs to the embedded object
        $embeddedAttributeKeys = $this->getEmbeddedObjectAttributes();

        $attributesMap = [];

        // Build a dictionary for corresponding object attributes => parent attributes
        foreach ($embeddedAttributeKeys as $key) {
            $attributesMap[$key] = $this->getParentAttributeKey($key);
        }

        return $attributesMap;
    }
605408
public function getInvocations(): array
    {
        if (empty($this->invocations)) {
            $this->locateInvocations($this->getTokens());
        }

        return $this->invocations;
    }
19032
final public static function getValues(): array
    {
        if (isset(self::$cache[static::class])) {
            return self::$cache[static::class];
        }

        $rc = new \ReflectionClass(static::class);

        return self::$cache[static::class] = $rc->getConstants();
    }
406640
public function getFields(): array
    {
        $fields = $this->reflection->getSchema();

        foreach ($fields as $field => $type) {
            if ($this->isAggregation($type)) {
                unset($fields[$field]);
            }
        }

        return $fields;
    }
432370
public function asArray($mixed): ?array
    {
        $data = $this->_simpleXml($mixed);
        return $data ? $this->_asArray($data) : null;
    }
583503
public function getEmbeddableProperties(): array
    {
        if (null !== $this->embeddableProperties) {
            return $this->embeddableProperties;
        }
        $traits = $this->reflectionClass->getTraits();
        $return = [];
        foreach ($traits as $traitName => $traitReflection) {
            if (\ts\stringContains($traitName, '\\Entity\\Embeddable\\Traits')) {
                $property                     = $traitReflection->getProperties()[0]->getName();
                $embeddableObjectInterfaceFqn = $this->getTypesFromVarComment(
                    $property,
                    $this->getReflectionHelper()->getTraitProvidingProperty($traitReflection, $property)
                )[0];
                $embeddableObject             = $this->getNamespaceHelper()
                                                     ->getEmbeddableObjectFqnFromEmbeddableObjectInterfaceFqn(
                                                         $embeddableObjectInterfaceFqn
                                                     );
                $return[$property]            = $embeddableObject;
            }
        }

        return $return;
    }
1138428
private function all(): array
    {
        $fields = static::$_fields;

        $data = [];
        foreach ($fields as $f) {
            if (isset($this->$f) and !is_null($this->$f)) {
                $data[$f] = $this->$f;
            }
        }

        return $data;
    }
711262
private function toArray()
    {
        $data = [];

        $reflection = new ReflectionClass($this);

        foreach ($reflection->getProperties() as $property) {
            $property->setAccessible(true);
            $data[$property->getName()] = $property->getValue($this);
        }

        return $data;
    }