Set up the bag with a proper array of SplFileInfo objects
@param array $splFileInfoObjects
@internal param $arrayOfSplFileInfoObjects
542182
protected function initialize(array $splFileInfoObjects = [])
    {
        if (!empty($splFileInfoObjects)) {
            foreach ($splFileInfoObjects as $object) {
                array_push($this->fileObjects, $this->createSplFileInfoObject($object));
            }
        }
    }
1335399
protected function setTarget(SplFileInfo $file)
    {
        // Page extension
        $ext = $file->getExtension();

        // Twig templates are HTML
        if (!$this->has('template') || $this->get('template') === 'none') {
            $targetExt = $ext;
        }
        else {
            $targetExt = 'html';
        }

        // Get clean source path
        $sourcePath = $this->getCleanPath($file->getRelativePathName());

        // Replace source extension with that of the template
        $this->target = substr($sourcePath, 0, -strlen($ext));
        $this->target .= $targetExt;
    }
422899
function attach(\SplObserver $observer)
    {
        if ($this->_observers == null)
        {
            $this->_observers = new \SplObjectStorage();
        }
        $this->_observers->attach($observer);
    }
39767
private function setDataArrayForObjectOrArray($objectOrArray)
    {
        if ($objectOrArray instanceof EntityInterface) {
            $this->getAttributesFromObjectAndSetDataArray($objectOrArray);
        }
        elseif (is_array($objectOrArray)) {
            $this->data[] = $objectOrArray;
        }
    }
684178
public function setChildren(array $children)
    {
        foreach ($children as $child) {
            $this->checkType(ObjectInFolderContainerInterface::class, $child);
        }

        $this->children = $children;
    }
688251
private function addBulkUpdateRecord($sObject, $objectType)
    {
        if (isset($this->bulkUpdateRecords[$objectType])
            && count($this->bulkUpdateRecords[$objectType]) == $this->bulkSaveLimit) {
            $this->flushUpdates($objectType);
        }

        $this->bulkUpdateRecords[$objectType][] = $sObject;
    }
606318
public function setFiles(array $files)
    {
        foreach($files as $file) {
            if (!$file instanceof File) {
                throw new ObjectNotAFileException($file . ' is not a file');
            }
        }

        $this->files = $files;
        return $this;
    }
568868
protected function createSplFileInfo(): \SplFileInfo
    {
        if (null !== $this->splFileInfo && $this->path === $this->splFileInfo->getRealPath()) {
            return $this->splFileInfo;
        }
        $this->splFileInfo = new \SplFileInfo($this->path);

        return $this->splFileInfo;
    }
1225436
protected function updateObjectArray($schemaName, $schemaObject)
    {
        foreach ($this->schemas[$this->schemaFolder][$schemaName]['objects'] as $name => $value) {
            if (array_key_exists('type', $value) && $value['type'] == $schemaObject['type']) {
                $this->schemas[$this->schemaFolder][$schemaName]['objects'][$name] = $schemaObject;
            }
        }
    }
492624
protected function normalizeFileInfo(SplFileInfo $file)
    {
        if (! $file->isLink()) {
            $normalized = [
                'type'      => $file->getType(),
                'path'      => $this->getFilePath($file),
                'timestamp' => $file->getMTime()
            ];

            if ($normalized['type'] === 'file') {
                $normalized['size'] = $file->getSize();
            }

            return $normalized;
        }
    }
996596
private function doClearFile(&$ok, \SplFileInfo $file, $prefix): void
    {
        $keys = [];

        if ($file->isFile()) {
            $key = $this->getFileKey($file);

            if (null !== $key && ('' === $prefix || 0 === strpos($key, $prefix))) {
                $keys[] = $key;
            }
        }

        $ok = ($file->isDir() || $this->deleteItems($keys) || !file_exists($file)) && $ok;
    }
812855
private function addExtension(
        array &$targets,
        string $target,
        string $extension,
        array $attributes
    ): void {
        if (!isset($targets[$target])) {
            $targets[$target] = new \SplPriorityQueue();
        }

        $priority = $attributes['priority'] ?? 0;
        $targets[$target]->insert(new Reference($extension), $priority);
    }
394934
public static function init($appDir, array $configFiles)
    {
        self::$loaders = [
            new JsonLoader(),
            new YamlLoader(),
            new PhpLoader()
        ];
        
        self::$appDir = $appDir;
        self::$configFiles = $configFiles;
    }
858352
public static function serialize(Serializer $serializer, SplFixedArray $splFixedArray)
    {
        $toArray = [
            Serializer::CLASS_IDENTIFIER_KEY => get_class($splFixedArray),
            Serializer::CLASS_PARENT_KEY => 'SplFixedArray',
            Serializer::SCALAR_VALUE => [],
        ];
        foreach ($splFixedArray->toArray() as $key => $field) {
            $toArray[Serializer::SCALAR_VALUE][$key] = $serializer->serialize($field);
        }

        return $toArray;
    }
968384
protected function setFieldResults(array $fieldResults)
    {
        foreach ($fieldResults as $fieldName => $validationResult) {
            $this->setFieldResult($fieldName, $validationResult);
        }
    }
236434
public function add(\SplFileInfo $file)
    {
        $content = new \Org_Heigl\FileFinder\Service\Tokenlist(file_get_contents($file->getPathname()));
        $classname = $content->getClassName();
        if (! $classname) {
            return;
        }

        $class = $content->getNamespace();
        $class[] = $classname;

        $key = str_replace('\\\\', '\\', '\\' . implode('\\', $class));

        $this->list[$key] = realpath($file->getPathname());
    }
1260222
public function getAllAnonymousInstancesList(SplObjectStorage $instances) {
		
		$anonymousInstances = new SplObjectStorage();
		
		foreach ($instances as $instance) {
			$anonymousInstances->addAll($this->getAnonymousAttachedInstances($instance));
		}
		
		return $anonymousInstances;
	}