Creates a line

@param array $settings = []

@return GD
170163
public function line(Array $settings = []) : GD
    {
        $x1   = $settings['x1']    ?? $this->x1    ?? 0;
        $y1   = $settings['y1']    ?? $this->y1    ?? 0;
        $x2   = $settings['x2']    ?? $this->x2    ?? 0;
        $y2   = $settings['y2']    ?? $this->y2    ?? 0;
        $rgb  = $settings['color'] ?? $this->color ?? '0|0|0';
        $type = $settings['type']  ?? $this->type  ?? 'solid';
        
        if( $type === 'solid' )
        {
            imageline($this->canvas, $x1, $y1, $x2, $y2, $this->allocate($rgb));
        }
        elseif( $type === 'dashed' )
        {
            imagedashedline($this->canvas, $x1, $y1, $x2, $y2, $this->allocate($rgb));
        }

        $this->defaultRevolvingVariables();

        return $this;
    }
391283
protected function buildUnion(
        /*# string */ $prefix,
        array $settings
    )/*# : string */ {
        $clause = &$this->getClause('UNION');
        $flat = $this->flatSettings($settings);

        $res = '';
        foreach ($clause as $idx => $field) {
            $parts = [];
            $prefix = $idx ? $field[1] : '';
            $parts[] = $this->quoteItem($field[0], $flat);
            $res .= $this->joinClause($prefix, '', $parts, $settings);
        }
        return ltrim($res);
    }
619772
public function line($line = '', $params = null)
    {
        if (empty($params)) {
            return parent::line($line);
        }

        //  We have some parameters, sub 'em in or the unicorns will die.
        $line = parent::line($line);

        if ($line !== false) {

            if (is_array($params)) {

                $line = vsprintf($line, $params);

            } else {

                $line = sprintf($line, $params);
            }
        }

        return $line;
    }
945145
protected function buildJoinTable(array $cls, array $settings)/*# : string */
    {
        $table = $cls[2];
        $alias = $cls[3];
        return $this->quoteItem($table, $settings) . $this->quoteAlias($alias, $settings);
    }
1239947
public function createFrom(String $source, Array $settings = [])
    {
        $type = $this->mime->type($source, 1);

        switch( $type )
        {
            case 'gd2p'   : $return = imagecreatefromgd2part
            (
                $source,
                $settings['x']      ?? NULL,
                $settings['y']      ?? NULL,
                $settings['width']  ?? NULL,
                $settings['height'] ?? NULL
            ); 
            break;

            default: 
                $function = 'imagecreatefrom' . ($type ?? 'jpeg');
                $return   = $function($source);
        }

        return $return;
    }
246662
public static function getInstance(array $settings = []): DIInterface
    {
        if (! self::$instance) {
            self::$instance = new DI($settings);
        }
        
        return self::$instance;
    }
407002
public function checkSettings($settings)
    {
        assert('is_array($settings)');

        if (!is_array($settings) || empty($settings)) {
            $errors = array('invalid_syntax');
        } else {
            $errors = array();
            if (!$this->_spValidationOnly) {
                $idpErrors = $this->checkIdPSettings($settings);
                $errors = array_merge($idpErrors, $errors);
            }
            $spErrors = $this->checkSPSettings($settings);
            $errors = array_merge($spErrors, $errors);

            $compressErrors = $this->checkCompressionSettings($settings);
            $errors = array_merge($compressErrors, $errors);
        }

        return $errors;
    }
1363700
public function settings(array $settings = null)
    {
        if ($settings) {
            $this->_settings = array_merge($this->_settings, $settings);
        }
        return $this->_settings;
    }
191238
public function polygon(Array $settings = []) : GD
    {
        $points     = $settings['points']     ?? $this->points     ?? 0;
        $pointCount = $settings['pointCount'] ?? $this->pointCount ?? (ceil(count($this->points ?? $points) / 2));
        $color      = $settings['color']      ?? $this->color      ?? '0|0|0';
        $style      = $settings['type']       ?? $this->type       ?? NULL;

        if( $style === NULL )
        {
            imagepolygon($this->canvas, $points, $pointCount, $this->allocate($color));
        }
        else
        {
            imagefilledpolygon($this->canvas, $points, $pointCount, $this->allocate($color));
        }

        $this->defaultRevolvingVariables();

        return $this;
    }
84526
private function getIndent(array $lines)
    {
        $detector = new IndentationDetector(
            LineCollection::createFromArray($lines)
        );

        return str_repeat(' ', $detector->getFirstLineIndentation());
    }
724415
public function resolve(array $settings = [])
    {
        return new XmlDriver(
            Arr::get($settings, 'paths'),
            Arr::get($settings, 'extension', XmlDriver::DEFAULT_FILE_EXTENSION)
        );
    }
340785
public function create(String $path = NULL) : String
    {
        if( isset($this->sets['filePath']) )
        {
            $path = $this->sets['filePath'];
        }

        # It keeps the used filters belonging to the GD class.
        # [5.7.8]added
        $this->sets['filters'] = $this->filters;

        $settings = $this->sets;
        
        $this->sets = [];

        return $this->image->thumb($path, $settings);
    }
835354
protected function buildPageSettings($settings)
    {
        if (empty($settings)) {
            return $settings;
        }

        $output = [];
        foreach ($settings as $setting) {
            $output[$setting->setting_key] = $setting->setting_value;
        }

        return $output;
    }
330580
public function createSection($settings = null) {
		$sectionCount = $this->_countSections() + 1;
		
		$section = new PHPWord_Section($sectionCount, $settings);
		$this->_sectionCollection[] = $section;
		return $section;
	}
935974
public function addSettings( $settings )
    {
        $this->settings = ArrayUtils::merge(
            $this->settings,
            ArrayUtils::iteratorToArray( $settings )
        );

        return $this;
    }
260837
public function create($start = NULL, Array $settings = []) : String
    {
        # The configuration arrays are merge.
        $settings = array_merge($this->config, $this->settings, $settings);

        # If the configuration is present, it is rearranged.
        if( ! empty($settings) )
        {
            $this->settings($settings);
        }

        # Gets information about which recording to start the paging process.
        $startRowNumber = $this->getStartRowNumber($start);

        # If the limit is set to 0, 1 is accepted.
        $this->limit = $this->limit === 0 ? 1 : $this->limit;
        
        # Generate pagination bar.
        if( $this->isPaginationBar() )
        {
            return $this->isBasicPaginationBar() ? $this->createBasicPaginationBar($startRowNumber) : $this->createAdvancedPaginationBar($startRowNumber);
        }

        return false;
    }
997525
private function applyFilters(array $settings): void
    {
        $data = $this->getSource();
        $data = array_filter(
            $data,
            function ($row) use ($settings) {
                foreach ($settings as $column => $filters) {
                    foreach ($filters as $filter => $value) {
                        // switch statement for filter
                        switch ($filter) {
                            case Grid\Grid::FILTER_EQ:
                                if ($row[$column] != $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_NE:
                                if ($row[$column] == $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GT:
                                if ($row[$column] <= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_GE:
                                if ($row[$column] < $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LT:
                                if ($row[$column] >= $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LE:
                                if ($row[$column] > $value) {
                                    return false;
                                }
                                break;
                            case Grid\Grid::FILTER_LIKE:
                                if (!preg_match('/' . $value . '/', $row[$column])) {
                                    return false;
                                }
                                break;
                        }
                    }
                }
                return true;
            }
        );
        $this->setSource($data);
    }