Create inner source node element

@param string $type MIME-type
@param string $src Path to audio file
@return \Krystal\Form\NodeElement
978229
final protected function createSourceElement($type, $src)
    {
        // Tag attributes
        $attrs = array(
            'src' => $src,
            'type' => $type
        );

        $node = new NodeElement();

        return $node->openTag('source')
                    ->addAttributes($attrs)
                    ->finalize(true);
    }
1105688
public function setSource($src, $path = null)
    {
        $this->_prepared = false;
        $this->_functionName = null;
        $this->_codeFile = null;
        $this->_source = new PHPTAL_StringSource($src, $path);
        $this->_path = $this->_source->getRealPath();
        $this->_context->_docType = null;
        $this->_context->_xmlDeclaration = null;
        return $this;
    }
1187134
private static function createTypeElement(\DOMDocument $document, $parentElement = null, $type)
    {
        if ($parentElement->parentNode === null) {
            $typeElement = $document->createElementNS(
                'https://github.com/RhubarbPHP/Rhubarb/blob/master/docs/simple-xml-transcoder.md',
                self::XMLNS . ':' . $type
            );
            $parentElement->appendChild($typeElement);
        } else {
            $parentElement->setAttribute(self::XMLNS . ':' . self::ATTR_TYPE, $type);
            $typeElement = $parentElement;
        }

        return $typeElement;
    }
300494
public function createNodeAssignment(CreateStruct $createStruct, $parentNodeId, $type = self::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP)
    {
        try {
            return $this->innerGateway->createNodeAssignment($createStruct, $parentNodeId, $type);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1317406
public static function fromSourceWithClone( $src, $clone )
	{
		$result = new BufferedNodeIterator();
		$result->src = $clone ? $src->CloneInstance() : $src;
		$result->buffer = array();
		return $result;
	}
1100094
protected function imageCreateFrom($type, $src, $func = null)
    {
        $func = strtolower('imageCreateFrom'.$type);

        return (is_callable($func)) ? $func($src) : null;
    }
333595
public static function addSectionMediaElement($src, $type, PHPWord_Section_MemoryImage $memoryImage = null) {
		$mediaId = md5($src);
		$key = ($type == 'image') ? 'images' : 'embeddings';
		
		if(!array_key_exists($mediaId, self::$_sectionMedia[$key])) {
			$cImg = self::countSectionMediaElements('images');
			$cObj = self::countSectionMediaElements('embeddings');
			$rID = self::countSectionMediaElements() + 7;
			
			$media = array();
			
			if($type == 'image') {
				$cImg++;
				$inf = pathinfo($src);
				$isMemImage = (substr(strtolower($inf['extension']), 0, 3) == 'php' && $type == 'image') ? true : false;
				
				if($isMemImage) {
					$ext = $memoryImage->getImageExtension();
					$media['isMemImage'] = true;
					$media['createfunction'] = $memoryImage->getImageCreateFunction();
					$media['imagefunction'] = $memoryImage->getImageFunction();
				} else {
					$ext = $inf['extension'];
					if($ext == 'jpeg') { // Office crashes when adding a jpEg Image, so rename to jpg
						$ext = 'jpg';
					}
				}
				
				$folder = 'media';
				$file = $type.$cImg.'.'.strtolower($ext);
			} elseif($type == 'oleObject') {
				$cObj++;
				$folder = 'embedding';
				$file = $type.$cObj.'.bin';
			}
			
			$media['source'] = $src;
			$media['target'] = "$folder/section_$file";
			$media['type'] = $type;
			$media['rID'] = $rID;
			
			self::$_sectionMedia[$key][$mediaId] = $media;
			
			if($type == 'oleObject') {
				return array($rID, ++self::$_objectId);
			} else {
				return $rID;
			}
		} else {
			if($type == 'oleObject') {
				$rID = self::$_sectionMedia[$key][$mediaId]['rID'];
				return array($rID, ++self::$_objectId);
			} else {
				return self::$_sectionMedia[$key][$mediaId]['rID'];
			}
		}
	}
1257679
public static HtmlTree SCRIPT(String src) {
        HtmlTree htmltree = HtmlTree.SCRIPT();
        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
        return htmltree;
    }
88833
public function newTargetCreateStruct(string $type): TargetCreateStruct
    {
        $struct = new TargetCreateStruct();
        $struct->type = $type;

        return $struct;
    }
280808
function create_node( $s ){
		if( isset($this->node_classes[$s]) ){
			// custom node class
			$class = $this->node_classes[$s];
		}	
		else {
			// vanilla flavour node
			$class = $this->default_node_class;
		}
		return new $class( $s );
	}
1012526
public function setFile($src, $type = 'text/javascript', array $params = [], $prepend = false, $conditional = '')
    {
        //pobieranie timestampu
        $ts = $this->_getLocationTimestamp($src);
        return $this->headScript(array_merge($params, ['type' => $type, 'src' => $ts > 0 ? $this->_getPublicSrc($src) : $src, 'ts' => $ts]), $prepend, $conditional);
    }
325345
protected function createContent($type)
    {
        if ($type == 'json') {
            $this->headers['content_type'] = 'application/json; charset=UTF-8';

            return json_encode(['url' => $this->ch, 'status' => 'ok']);
        } elseif ($type == 'xml') {
            $this->headers['content_type'] = 'text/xml; charset=UTF-8';

            return '<?xml version="1.0" encoding="UTF-8"?><result><url>'.$this->ch.'</url><status>ok</status></result>';
        }

        return 'ok';
    }
896212
protected function buildCreative($type)
    {
        // check type
        $creativeClassName = $this->buildCreativeClassName($type);
        if (!class_exists($creativeClassName)) {
            throw new \Exception('Wrong creative specified: ' . var_export($creativeClassName, true));
        }

        // get container
        if (!$this->creativesDomElement) {
            // get creatives tag
            $this->creativesDomElement = $this->adDomElement->getElementsByTagName('Creatives')->item(0);
            if (!$this->creativesDomElement) {
                $this->creativesDomElement = $this->adDomElement->ownerDocument->createElement('Creatives');
                $this->getDomElement()->appendChild($this->creativesDomElement);
            }
        }

        // Creative dom element: <Creative></Creative>
        $creativeDomElement = $this->creativesDomElement->ownerDocument->createElement('Creative');
        $this->creativesDomElement->appendChild($creativeDomElement);

        // Creative type dom element: <Creative><Linear></Linear></Creative>
        $creativeTypeDomElement = $this->adDomElement->ownerDocument->createElement($type);
        $creativeDomElement->appendChild($creativeTypeDomElement);

        // object
        $creative = new $creativeClassName($creativeDomElement);
        $this->creatives[] = $creative;

        return $creative;
    }
1310814
protected function buildMedia(string $type, $files, array $attributes): string
	{
		$sources = '';

		foreach((array) $files as $file)
		{
			$sources .= $this->tag('source', ['src' => $file]);
		}

		return $this->tag($type, $attributes, $sources);
	}
1078092
public function set_source(string $src){
    $this->source = is_file($src) ? file_get_contents($src) : $src;
    $this->parsed = [];
    return $this;
  }
956586
public DOMSource createDOMSource(DocumentSource src)
    {
        try
        {
            Constructor<? extends DOMSource> constr = getDOMSourceClass().getConstructor(DocumentSource.class);
            return constr.newInstance(src);
        } catch (Exception e) {
            log.warn("BoxFactory: Warning: could not create the DOMSource instance: " + e.getMessage());
            return null;
        }
    }
1363967
public static function create(string $path, string $type):int
    {
        try {
            switch ($type) {
                case "directory":
                    if (!is_dir($path)) {
                        mkdir($path);
                    }
                    break;
                case "file":
                    if (!is_file($path)) {
                        touch($path);
                    }
                    break;
            }
        } catch (\Exception $exception) {
            throw new \Exception("Server Error : Cannot create $type element => ".$exception);
        }

        return (1);
    }