Constructor
@param DocumentOrderNodeIterator $src
767029
private function AssignFrom( $src )
	{
		$this->index = $src->index;
		$this->itemSet = $src->itemSet;
		$this->lastNode = $src->lastNode;
		$this->allowSameElementRepeat = $src->allowSameElementRepeat;
	}
128511
protected function checkConstructorAndDestructor(File $phpcsFile, int $stackPtr): void
    {
        $docBlockEndIndex = $this->findRelatedDocBlock($phpcsFile, $stackPtr);
        if ($docBlockEndIndex) {
            return;
        }

        $methodSignature = $this->getMethodSignature($phpcsFile, $stackPtr);
        $arguments = count($methodSignature);
        if (!$arguments) {
            return;
        }

        $phpcsFile->addError('Missing doc block for method', $stackPtr, 'ConstructDesctructMissingDocBlock');
    }
1173218
private function linkSubdirectories($src, $to)
	{
		if (is_dir($src))
		{
			$dirHandle = opendir($src);

			while (false !== ($element = readdir($dirHandle)))
			{
				if (substr($element, 0, 1) != '.')
				{
					if (is_dir($src . "/" . $element))
					{
						$this->symlink($src . "/" . $element, $to . '/' . $element);
					}
				}
			}
		}
	}
1167111
public static function copyDir($src, $dst)
    {
        if (is_link($src)) {
            symlink(readlink($src), $dst);
        } elseif (is_dir($src)) {
            if (is_dir($dst) === false) {
                mkdir($dst, 0775, true);
            }
            // copy files recursive
            foreach (scandir($src) as $file) {
                if ($file != '.' && $file != '..') {
                    FileSystem::copyDir("$src/$file", "$dst/$file");
                }
            }

        } elseif (is_file($src)) {
            copy($src, $dst);
        } else {
            // do nothing, we didn't have a directory to copy
        }
    }
500296
public function load($src = null, $dir = null)
    {
        if (isset($src)) {
            $this->setSource($src, $dir);
        }

        $this->loadImageDetails();

        if ($this->fileType === IMG_WEBP) {
            $this->image = imagecreatefromwebp($this->pathToImage);
        } else {
            $imageAsString = file_get_contents($this->pathToImage);
            $this->image = imagecreatefromstring($imageAsString);
        }
        if ($this->image === false) {
            throw new Exception("Could not load image.");
        }

        /* Removed v0.7.7
        if (image_type_to_mime_type($this->fileType) == 'image/png') {
            $type = $this->getPngType();
            $hasFewColors = imagecolorstotal($this->image);

            if ($type == self::PNG_RGB_PALETTE || ($hasFewColors > 0 && $hasFewColors <= 256)) {
                if ($this->verbose) {
                    $this->log("Handle this image as a palette image.");
                }
                $this->palette = true;
            }
        }
        */

        if ($this->verbose) {
            $this->log("### Image successfully loaded from file.");
            $this->log(" imageistruecolor() : " . (imageistruecolor($this->image) ? 'true' : 'false'));
            $this->log(" imagecolorstotal() : " . imagecolorstotal($this->image));
            $this->log(" Number of colors in image = " . $this->colorsTotal($this->image));
            $index = imagecolortransparent($this->image);
            $this->log(" Detected transparent color = " . ($index >= 0 ? implode(", ", imagecolorsforindex($this->image, $index)) : "NONE") . " at index = $index");
        }

        return $this;
    }
1174450
private function processClass(\ArrayIterator $iterator, ResourceRecord $resourceRecord): void
    {
        if (Classes::isValid(strtoupper($iterator->current()))) {
            $resourceRecord->setClass(strtoupper($iterator->current()));
            $iterator->next();
        }
    }
1078092
public function set_source(string $src){
    $this->source = is_file($src) ? file_get_contents($src) : $src;
    $this->parsed = [];
    return $this;
  }
304640
public static function rcopy($src, $dest)
    {

        // If the src is not a directory do a simple file copy
        if (!is_dir($src)) {
            copy($src, $dest);
            return true;
        }

        // If the destination directory does not exist create it
        if (!is_dir($dest)) {
            static::create($dest);
        }

        // Open the source directory to read in files
        $i = new \DirectoryIterator($src);
        /** @var \DirectoryIterator $f */
        foreach ($i as $f) {
            if ($f->isFile()) {
                copy($f->getRealPath(), "{$dest}/" . $f->getFilename());
            } else {
                if (!$f->isDot() && $f->isDir()) {
                    static::rcopy($f->getRealPath(), "{$dest}/{$f}");
                }
            }
        }
        return true;
    }
470864
protected function _setIterator($iterator)
    {
        if ($iterator !== null && !($iterator instanceof Iterator)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Invalid iterator'),
                null,
                null,
                $iterator
            );
        }

        $this->iterator = $iterator;
    }
936674
private function __copyDir($src, $dst, &$files = null)
    {
        $dir = opendir($src);
        @mkdir($dst);
        while (false !== ($file = readdir($dir))) {
            if (('.' != $file) && ('..' != $file)) {
                if (is_dir($src.'/'.$file)) {
                    $this->__copyDir($src.'/'.$file, $dst.'/'.$file, $files);
                } else {
                    copy($src.'/'.$file, $dst.'/'.$file);
                    if (\is_array($files)) {
                        $files[] = $dst.'/'.$file;
                    }
                }
            }
        }
        closedir($dir);
    }
999601
public static function fromBaseIter( $baseIter, $allowSameElementRepeat = false )
	{
		$result = new DocumentOrderNodeIterator();
		$result->allowSameElementRepeat = $allowSameElementRepeat;
		$result->fromDocumentOrderNodeIteratorParts( $baseIter );
		return $result;
	}
38539
protected static function copyRecursive( $src, $dest )
	{
		self::createDirectory( $dest );

		$iterator = new \RecursiveIteratorIterator(
			new \RecursiveDirectoryIterator( $src, \RecursiveDirectoryIterator::SKIP_DOTS ),
			\RecursiveIteratorIterator::SELF_FIRST
		);

		foreach( $iterator as $item )
		{
			$target = $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName();

			if( $item->isDir() === false )
			{
				if( copy( $item, $target ) === false ) {
					throw new \RuntimeException( sprintf( 'Unable to copy file "%1$s"', $item ) );
				}
			}
			else
			{
				self::createDirectory( $target );
			}
		}
	}
276338
public static function FromSequenceType( $src )
	{
		$result = new SequenceType();

		$result->TypeCode = $src->TypeCode;
		$result->NameTest = $src->NameTest;
		$result->Cardinality = $src->Cardinality;
		$result->SchemaType = $src->SchemaType;
		$result->SchemaElement = $src->SchemaElement;
		$result->SchemaAttribute = $src->SchemaAttribute;
		$result->Nillable = $src->Nillable;
		$result->IsNode = $src->IsNode;
		$result->ItemType = $src->ItemType;

		return result;
	}
578645
public function process($src, OperationInterface $operation)
    {
        $field = $operation->getField();
        $order = $operation->getOrder();
        $src->order .= "ORDER BY $field $order";
        return $src;
    }
774308
private function executeReorders($documents)
    {
        foreach ($documents as $oid => $list) {
            if (!$this->contains($oid)) {
                continue;
            }
            foreach ($list as $value) {
                list($parent, $src, $target, $before) = $value;
                $parentNode = $this->session->getNode($this->getDocumentId($parent));

                // check for src and target ...
                $dest = $target;
                if ($parentNode->hasNode($src) && $parentNode->hasNode($target)) {
                    // there is no orderAfter, so we need to find the child after target to use it in orderBefore
                    if (!$before) {
                        $dest = null;
                        $found = false;
                        foreach ($parentNode->getNodes() as $name => $child) {
                            if ($name === $target) {
                                $found = true;
                            } elseif ($found) {
                                $dest = $name;
                                break;
                            }
                        }
                    }

                    $parentNode->orderBefore($src, $dest);
                    $class = $this->dm->getClassMetadata(get_class($parent));
                    foreach ($class->childrenMappings as $fieldName) {
                        if ($parent instanceof Proxy && $parent->__isInitialized()) {
                            $children = $class->reflFields[$fieldName]->getValue($parent);
                            $children->refresh();
                        }
                    }
                }
            }
        }
    }
737224
protected function assertOrder(File $phpCsFile, array $docBlockParams): void
    {
        foreach ($docBlockParams as $docBlockParam) {
            if (strpos($docBlockParam['type'], '$') !== false) {
                continue;
            }

            $docBlockParamTypes = explode('|', $docBlockParam['type']);
            if (count($docBlockParamTypes) === 1) {
                continue;
            }

            $unique = array_unique($docBlockParamTypes);
            if (count($docBlockParamTypes) !== count($unique)) {
                $phpCsFile->addError('Duplicate type in `' . $docBlockParam['type'] . '`', $docBlockParam['index'], 'Duplicate');
                continue;
            }
            $expectedOrder = $this->getExpectedOrder($docBlockParamTypes);
            if ($expectedOrder === $docBlockParamTypes) {
                continue;
            }

            $fix = $phpCsFile->addFixableError('`null` and falsey values should be the last element', $docBlockParam['index'], 'WrongOrder');
            if (!$fix) {
                continue;
            }

            $phpCsFile->fixer->beginChangeset();

            $content = implode('|', $expectedOrder) . $docBlockParam['appendix'];
            $phpCsFile->fixer->replaceToken($docBlockParam['index'], $content);

            $phpCsFile->fixer->endChangeset();
        }
    }
679332
protected function _parseRoute($src) {
        $file = SRC_PATH . $src . '/' . SRC_CONFIG_ROUTE;

        if ($xml = simplexml_load_file($file)) {
            $values = $xml->xpath('//route');

            /** @var SimpleXMLElement[] $value */
            foreach ($values as $value) {
                foreach ($this->_routeAttribute as $attribute) {
                    $attributeType = $attribute['name'];

                    if (is_object($value[$attributeType])) {
                        $data[$attributeType] = $value[$attributeType]->__toString();
                    }
                    else {
                        $data[$attributeType] = '';
                    }
                }

                /** @var array $data */
                /** @var SimpleXMLElement $value */
                $data = $this->_parseParent($value, $data, $this->_routeAttribute);

                if (empty($data['logged']) || $data['logged'] == '') {
                    $data['logged'] = '*';
                }

                if (empty($data['access']) || $data['access'] == '') {
                    $data['access'] = '*';
                }

                if (empty($data['method']) || $data['method'] == '') {
                    $data['method'] = '*';
                }

                $this->config['route']['' . $src . '']['' . $data['name'] . ''] = $data;
            }
        }
        else {
            throw new MissingConfigException('can\'t open file "' . $file . '"');
        }
    }