@param array $children

@throws \Exception

@return array
176235
private function loadPublicPEM(array $children)
    {
        Assertion::isInstanceOf($children[0], Sequence::class, 'Unsupported key type');

        $sub = $children[0]->getChildren();
        Assertion::isInstanceOf($sub[0], ObjectIdentifier::class, 'Unsupported key type');
        Assertion::eq('1.2.840.10045.2.1', $sub[0]->getContent(), 'Unsupported key type');

        Assertion::isInstanceOf($sub[1], ObjectIdentifier::class, 'Unsupported key type');
        Assertion::isInstanceOf($children[1], BitString::class, 'Unable to load the key');

        $bits = $children[1]->getContent();
        $bits_length = mb_strlen($bits, '8bit');

        Assertion::eq('04', mb_substr($bits, 0, 2, '8bit'), 'Unsupported key type');

        $this->values['kty'] = 'EC';
        $this->values['crv'] = $this->getCurve($sub[1]->getContent());
        $this->values['x'] = Base64Url::encode(hex2bin(mb_substr($bits, 2, ($bits_length - 2) / 2, '8bit')));
        $this->values['y'] = Base64Url::encode(hex2bin(mb_substr($bits, ($bits_length - 2) / 2 + 2, ($bits_length - 2) / 2, '8bit')));
    }
784408
public function findAdminHierarchiesByParentsAndChildren(array $parents, array $children)
    {
        if (count($parents) === 0 || count($children) === 0) {
            throw new \InvalidArgumentException('Array argument cannot be empty');
        }

        $parentIndex = 0;
        $eol = PHP_EOL;
        $parentsTest = '(';

        foreach ($parents as $parent) {
            $parentsTest .= $parentIndex > 0 ? '    OR ' : '    ';
            $parentsTest .= "p.id = {$parent}{$eol}";
            $parentIndex++;
        }
        $parentsTest .= "){$eol}";

        $childrenIndex = 0;
        $childrenTest = '(';

        foreach ($children as $child) {
            $childrenTest .= $childrenIndex > 0 ? '    OR ' : '    ';
            $childrenTest .= "t.id = {$child}{$eol}";
            $childrenIndex++;
        }
        $childrenTest .= "){$eol}";

        $dql = "
            SELECT h
            FROM Claroline\CoreBundle\Entity\Workspace\WorkspaceTagHierarchy h
            JOIN h.parent p
            JOIN h.tag t
            WHERE h.user IS NULL
            AND h.level > 0
            AND {$parentsTest}
            AND {$childrenTest}
        ";
        $query = $this->_em->createQuery($dql);

        return $query->getResult();
    }
643883
private function buildChildrenErrors(array $childrenErrors, $msg)
    {
        if (!empty($childrenErrors)) {
            $msg .= PHP_EOL.'- children:';

            foreach ($childrenErrors as $child => $errors) {
                $msg .= sprintf('%s  - %s', PHP_EOL, $child);
                $msg .= sprintf('%s    - errors:', PHP_EOL);

                foreach ($errors as $error) {
                    $msg .= sprintf('%s      - %s', PHP_EOL, $error);
                }
            }
        }

        return $msg;
    }
734699
private static function _gatherChildren(PolicyNode ...$nodes): array
    {
        $children = array();
        foreach ($nodes as $node) {
            $children = array_merge($children, $node->children());
        }
        return $children;
    }
1324204
protected function getElementByTagInChildren(array $children, $tagName)
    {
        $elements = array();

        foreach ($children as $child) {
            if ($child instanceof BBcodeElementNode) {
                if ($tagName === $child->getTagName()) {
                    $elements[] = $child;
                }
                array_merge($elements, $this->getElementByTagInChildren($child->getChildren(), $tagName));
            }
        }

        return $elements;
    }
81419
public function getChildrenUpdaters(): array {
        $key = get_class($this);
        if(!array_key_exists($key, self::$childrenUpdaters)) {
            return [];
        }
        return self::$childrenUpdaters[$key];
    }
669078
public function removeChildren ()
  {
    $children       = $this->children;
    $this->children = [];
    if ($children)
      self::detachAll ($children);
    return $children;
  }
410537
public static function getChildByArray(array $keys, array $values, $default = null) {
		switch (count($keys)) {
			case 0:
				return $values;
			case 1:
				return array_key_exists($keys[0], $values) ? $values[$keys[0]] : $default;
			case 2:
				return isset($values[$keys[0]][$keys[1]]) ? $values[$keys[0]][$keys[1]] : $default;
			case 3:
				return isset($values[$keys[0]][$keys[1]][$keys[2]]) ? $values[$keys[0]][$keys[1]][$keys[2]] : $default;
			case 4:
				return isset($values[$keys[0]][$keys[1]][$keys[2]][$keys[3]]) ? $values[$keys[0]][$keys[1]][$keys[2]][$keys[3]] : $default;
			default:
				return isset($values[$keys[0]]) ? self::getChildByArray(array_slice($keys, 1), $values[$keys[0]], $default) : $default;
		}
	}
1312784
public function setChildren(array $children)
    {
        if (count(array_filter($children, function($v) {
            return !$v instanceof MenuItemInterface;
        })) > 0) {
            throw new InvalidChildTypeException('Child items has to implement ' . MenuItemInterface::class);
        }

        $this->children = $children;
    }
875471
public function children()
    {
        $result = [];
        foreach ($this->children as $childGroup) {
            $result = array_merge($result, $childGroup);
        }

        return $result;
    }
45780
public function removeChildren(\Coral\ContentBundle\Entity\Node $children)
    {
        $this->children->removeElement($children);
    }
98369
public function addChildren($children, $mapper = null)
    {
        if (is_null($children)) {
            return $this;
        }

        $children = $this->parseChildren($children, $mapper);

        $element = clone $this;

        $element->children = $element->children->merge($children);

        return $element;
    }
382428
public function getChildren()
    {
		if (!$this->_children)
		{
			if ($this->getParam('iterator')) {
				$this->_children = $this->getParam('iterator');
			}
			else {
				try {
					$this->_children = $this->getCatalog()->getMaterials();
                    if ($this->getParam('order')) {
                        $this->_children->orderBy($this->getParam('order'), $this->getParam('sort'));
                    }
                    $this->_children->orderBy('id', 'ASC', true);
					if ($this->getParam('subfolders') || $this->getParam('subsections')) {
						$this->_children->subfolders();
					}
					if ($this->getParam('filter')) {
						list($filter) = explode(';',$this->getParam('filter'));
						eval('$this->_children->'.$filter.';');
					}
				}
				catch (\Exception $e) {
					return [];
				}					
			}
			if ($this->getParam('limit')) $this->_children->setItemCountPerPage($this->getParam('limit')); 
			if ($this->getParam('where')) $this->_children->where($this->getParam('where')); 
			$this->_children->setCurrentPageNumber( $this->getPage() ); 			
		}
		return $this->_children;
    }
587857
public function generateTree($items)
    {
        foreach ($items->reverse()->all() as $index => $item) {
            $parent = $this->findParent($items, $item);

            if (isset($parent)) {
                $parent->setChild($item);

                $items->forget($index);
            }
        }

        return $items;
    }
162150
public function getChildren()
    {
        $children = array_map(function(ColumnInterface $column) {
            return $column->getHeader();
        }, $this->columns);

        return $children;
    }
148757
protected function mapModelDataToElementCollection(ElementCollection $children)
    {
        foreach ($children->all() as $child) {
            $this->mapModelDataToElement($child);
        }
    }
1307306
public function setChildNodes(array $childNodes)
    {
        /** @var $rootNode RootNode */
        $rootNode = $this->objectManager->get(\TYPO3\Fluid\Core\Parser\SyntaxTree\RootNode::class);
        foreach ($childNodes as $childNode) {
            $rootNode->addChildNode($childNode);
        }
        $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext);
    }