# wpdatatables/6.5.1.7/lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php

wpDataTables – WordPress Data Table, Dynamic Tables &amp; Table Charts Plugin, version 6.5.1.7. 66 lines.

- Page: https://pluginprobe.com/plugins/wpdatatables/6.5.1.7/code/lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php
- Raw: https://pluginprobe.com/plugins/wpdatatables/6.5.1.7/raw/lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php
- Modified: 2024-02-20T08:53:02+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpdatatables/6.5.1.7/code/lib/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php#L10-L20`.

```php
<?php

namespace PhpOffice\PhpSpreadsheet\RichText;

use PhpOffice\PhpSpreadsheet\Style\Font;

class Run extends TextElement implements ITextElement
{
    /**
     * Font.
     *
     * @var ?Font
     */
    private $font;

    /**
     * Create a new Run instance.
     *
     * @param string $text Text
     */
    public function __construct($text = '')
    {
        parent::__construct($text);
        // Initialise variables
        $this->font = new Font();
    }

    /**
     * Get font.
     *
     * @return null|\PhpOffice\PhpSpreadsheet\Style\Font
     */
    public function getFont()
    {
        return $this->font;
    }

    /**
     * Set font.
     *
     * @param Font $font Font
     *
     * @return $this
     */
    public function setFont(?Font $font = null)
    {
        $this->font = $font;

        return $this;
    }

    /**
     * Get hash code.
     *
     * @return string Hash code
     */
    public function getHashCode()
    {
        return md5(
            $this->getText() .
            (($this->font === null) ? '' : $this->font->getHashCode()) .
            __CLASS__
        );
    }
}

```
