Create a new TextRun

@return PHPWord_Section_TextRun
512486
public function createTextRun($styleParagraph = null) {
		$textRun = new PHPWord_Section_TextRun($styleParagraph);
		$this->_elementCollection[] = $textRun;
		return $textRun;
	}
149099
public function run()
    {
        $tag = ArrayHelper::remove($this->options, 'tag', 'div');
        $html[] = Html::beginTag($tag, $this->options);

        if (!$this->useNoUiSlider) {
            $html[] = $this->renderHtml5RangeInput();
        } else {
            $html[] = $this->renderNoUiSlider();
        }

        $html[] = Html::endTag($tag);
        return implode("\n", $html);
    }
390392
private function generateNewPart(): void
    {
        if ($this->buffer) {
            $this->closeFeed();
        }

        $this->bufferSize = 0;
        ++$this->bufferPart;

        if (!$this->folder->isWritable()) {
            throw new \RuntimeException(sprintf('Unable to write to folder: %s', $this->folder));
        }

        $this->buffer = fopen(sprintf('%s/feed_%05d.xml', $this->folder, $this->bufferPart), 'w');

        $this->bufferSize += fwrite($this->buffer, <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA Feeds//EN" "$this->dtd">
<gsafeed>
    <header>
        <datasource>$this->datasource</datasource>
        <feedtype>$this->feedtype</feedtype>
    </header>

    <group>

XML
        );
    }
63777
public function run()
    {

         $users = [
             ['user', 'user@gmail.com', 'user'],
             ['admin' ,'admin@gmail.com', 'admin'],
         ];

         foreach($users as $user){
             User::create([
                 'username' => $user[0],
                 'email' => $user[1],
                 'password' => \Hash::make($user[2])
             ]);
         }

    }
291493
private function _createSpecialWordTable()
    {
        // get l10n configuration for strings
        $config = $this->getConfiguration();

        // assume empty special word table
        $this->_specialWordTable = [];

        // iterate over predefined parts
        foreach ($this->_tags as $tag) {
            // create table
            $this->_specialWordTable[$tag] = $this->config->{$tag};
        }
    }
298599
public function buildIterator()
    {
        $qb = $this->em->createQueryBuilder();
        $qb->select('fs')
            ->from('KunstmaanFormBundle:FormSubmission', 'fs')
            ->innerJoin('fs.node', 'n', 'WITH', 'fs.node = n.id')
            ->andWhere('n.id = :node')
            // only export the requested language, bc headers aren't translated correctly
            ->andWhere('fs.lang = :lang')
            ->setParameter('node', $this->nodeTranslation->getNode()->getId())
            ->setParameter('lang', $this->nodeTranslation->getLang())
            ->addOrderBy('fs.created', 'DESC');
        $iterableResult = $qb->getQuery()->iterate();
        $isHeaderWritten = false;

        $collection = new ArrayCollection();
        $i = 0;
        foreach ($iterableResult as $row) {
            /* @var FormSubmission $submission */
            $submission = $row[0];

            // Write row data
            $data = [
                'id' => $submission->getId(),
                'date' => $submission->getCreated()->format('d/m/Y H:i:s'),
                'language' => $submission->getLang(),
            ];
            foreach ($submission->getFields() as $field) {
                if (!$isHeaderWritten) {
                    $this->addExportField($field->getFieldName(), $this->translator->trans($field->getLabel()));
                }
                $data[$field->getFieldName()] = $field->__toString();
            }
            $isHeaderWritten = true;
            $collection->add([$data]);

            if (($i % $this->batchSize) === 0) {
                $this->em->clear();
            }
            ++$i;
        }

        $this->iterator = $collection->getIterator();
    }
609809
public function create(
        $contentTypes,
        $limit,
        $titleWords,
        $timeRange,
        $language = LanguageInterface::LANGCODE_NOT_SPECIFIED
    ) {
        $nodes = [];
        $bundles = $this->drupalApi->getBundles();
        for ($i = 0; $i < $limit; $i++) {
            try {
                $contentType = $contentTypes[array_rand($contentTypes)];
                $node = $this->entityTypeManager->getStorage('node')->create(
                    [
                        'nid' => null,
                        'type' => $contentType,
                        'created' => REQUEST_TIME - mt_rand(0, $timeRange),
                        'uid' => $this->getUserID(),
                        'title' => $this->getRandom()->sentences(mt_rand(1, $titleWords), true),
                        'revision' => mt_rand(0, 1),
                        'status' => true,
                        'promote' => mt_rand(0, 1),
                        'langcode' => $language
                    ]
                );

                $this->generateFieldSampleData($node);
                $node->save();
                $nodes['success'][] = [
                    'nid' => $node->id(),
                    'node_type' => $bundles[$contentType],
                    'title' => $node->getTitle(),
                    'created' => $this->dateFormatter->format(
                        $node->getCreatedTime(),
                        'custom',
                        'Y-m-d h:i:s'
                    )
                ];
            } catch (\Exception $error) {
                $nodes['error'][] = $error->getMessage();
            }
        }

        return $nodes;
    }
1058924
public function run()
	{
		// if the control word has a previous text element
		if (null !== ($text = $this->getPreviousText())) {
			// if the last character in the text is the space character
			if (substr($text->getText(), -1, 1) == ' ') {
				// remove it
				$text->setText(substr($text->getText(), 0, -1));
			}
		}
		
		// if the control word has a next text element
		if (null !== ($text = $this->getNextText())) {
			// if the first character in the text is the space character
			if (substr($text->getText(), 0, 1) == ' ') {
				// remove it
				$text->setText(substr($text->getText(), 1));
			}
		}
		
		return;
	}
330580
public function createSection($settings = null) {
		$sectionCount = $this->_countSections() + 1;
		
		$section = new PHPWord_Section($sectionCount, $settings);
		$this->_sectionCollection[] = $section;
		return $section;
	}
1110759
public function run(): self
    {
        $this->displayComment();
        $this->launched = true;
        if ($this->onStart) {
            ($this->onStart)();
        }
        $this->execute();
        if ($this->onFinish) {
            ($this->onFinish)();
        }
        $this->doneIterationsCombined += $this->doneIterations;
        return $this;
    }
1184437
protected function generateWord()
	{
		$wordFile=dirname(__FILE__).'/words.txt';
		$words=preg_split("/[\s,]+/",file_get_contents($wordFile));
		do
		{
			$i=rand(0,count($words)-1);
			$word=$words[$i];
		} while(strlen($word)<5 || !ctype_alpha($word));
		return strtoupper($word);
	}
717339
public function addText($text, $styleFont = null, $styleParagraph = null) {
		$text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph);
		$this->_elementCollection[] = $text;
		return $text;
	}
876244
public function run()
	{
		// if the control word has a next text element
		if (null !== ($text = $this->getNextText())) {
			// upper-case the first letter in the text element
			$text->setText(ucfirst($text->getText()));
		}
		
		return;
	}
427958
private function create_course() {
        $this->log('createcourse', $this->shortname);
        $courserecord = array(
            'shortname' => $this->shortname,
            'fullname' => $this->fullname,
            'numsections' => self::$paramsections[$this->size],
            'startdate' => usergetmidnight(time())
        );
        if (strlen($this->summary) > 0) {
            $courserecord['summary'] = $this->summary;
            $courserecord['summary_format'] = $this->summaryformat;
        }

        return $this->generator->create_course($courserecord, array('createsections' => true));
    }
1362871
public static function create(string $text, string $locale = self::DEFAULT_LOCALE): self
    {
        return new self($text, $locale);
    }
1169662
public function create()
    {
        $extends = $this->viewExtends;
        $section = $this->viewSection;

        return view($this->viewNamespace . '.create', compact('extends', 'section'));
    }
193106
public function make() {
        global $DB, $CFG;

        raise_memory_limit(MEMORY_EXTRA);

        if ($this->progress && !CLI_SCRIPT) {
            echo html_writer::start_tag('ul');
        }

        $entirestart = microtime(true);

        // Create courses.
        $prevchdir = getcwd();
        chdir($CFG->dirroot);
        $ncourse = self::get_last_testcourse_id();
        foreach (self::$sitecourses as $coursesize => $ncourses) {
            for ($i = 1; $i <= $ncourses[$this->size]; $i++) {
                // Non language-dependant shortname.
                $ncourse++;
                $this->run_create_course(self::SHORTNAMEPREFIX . $ncourse, $coursesize);
            }
        }
        chdir($prevchdir);

        // Store last course id to return it (will be the bigger one).
        $lastcourseid = $DB->get_field('course', 'id', array('shortname' => self::SHORTNAMEPREFIX . $ncourse));

        // Log total time.
        $this->log('sitecompleted', round(microtime(true) - $entirestart, 1));

        if ($this->progress && !CLI_SCRIPT) {
            echo html_writer::end_tag('ul');
        }

        return $lastcourseid;
    }