Finish drawing by block

@return CuiUtility Self instance
423151
public function finishDrawingByBlock ( ) {
        $canvasHeight = $this->_canvasSize[1];
        echo str_repeat("\n", $canvasHeight);
        $this->_cursor->moveHome()
            ->move(0, $canvasHeight);
        return $this;
    }
1099740
public function withoutOverlapping()
    {
        return $this->then(function() {
            $this->_mutex->release($this->mutexName());
        })->skip(function() {
            return !$this->_mutex->acquire($this->mutexName());
        });
    }
124534
public function drawLine()
    {
        for ($i = 1; $i <= $this->lineNum; $i++) {
            $lineColor = imagecolorallocate($this->img, random_int(150, 250), random_int(150, 250), random_int(150, 250));
            //($this->img,起点坐标x.y，终点坐标x.y，颜色)
            imageline(
                $this->img, random_int(0, $this->width), random_int(0, $this->height),
                random_int(0, $this->width), random_int(0, $this->height), $lineColor
            );
        }

        return $this;
    }
13884
public function captureEnd()
    {
        $capture = array_pop($this->capture);
        array_unshift($capture['args'], ob_get_clean());
        call_user_func_array(
            [$this, $capture['func']],
            $capture['args']
        );
        return $this;
    }
118710
public function end()
    {
        if (null !== $this->currentGroup) {
            $this->currentGroup = null;
        } elseif (null !== $this->currentTab) {
            $this->currentTab = null;
        } else {
            throw new \RuntimeException('No open tabs or groups, you cannot use end()');
        }

        return $this;
    }
311578
private function blockFinished()
    {
        $transformedText = $this->transformedTextStack->pop();
        $this->blockTypeStack->pop();
        $this->blockAttributesStack->pop();

        return $transformedText;
    }
1084584
public function finaliseBuild(): self
    {
        $this->dataTransferObjectsForAllEntitiesAction->run();
        $this->entityFormatter->run();
        $this->copyPhpstormMeta->run();

        return $this;
    }
886754
public function endblock()
    {
        $name = $this->getBlockQueue()->pop();

        // If this block name not exists on parent level, we just echo inner content.
        if (!empty($this->block[$name])) {
            ob_get_clean();

            echo $this->block[$name];

            return;
        }

        // Get the layout contents.
        echo $this->block[$name] = ob_get_clean();
    }
1237622
public function finish($image_style = self::IMG_FORMAT_PNG, $quality = 100) {
        $drawer = null;

        $im = $this->im;
        if ($this->rotateDegree > 0.0) {
            if (function_exists('imagerotate')) {
                $im = imagerotate($this->im, 360 - $this->rotateDegree, $this->color->allocate($this->im));
            } else {
                throw new CINDrawException('The method imagerotate doesn\'t exist on your server. Do not use any rotation.');
            }
        }

        if ($image_style === self::IMG_FORMAT_PNG) {
            $drawer = new CINDrawPNG($im);
            $drawer->setFilename($this->filename);
            $drawer->setDPI($this->dpi);
        } elseif ($image_style === self::IMG_FORMAT_JPEG) {
            $drawer = new CINDrawJPG($im);
            $drawer->setFilename($this->filename);
            $drawer->setDPI($this->dpi);
            $drawer->setQuality($quality);
        } elseif ($image_style === self::IMG_FORMAT_GIF) {
            // Some PHP versions have a bug if passing 2nd argument as null.
            if ($this->filename === null || $this->filename === '') {
                imagegif($im);
            } else {
                imagegif($im, $this->filename);
            }
        } elseif ($image_style === self::IMG_FORMAT_WBMP) {
            imagewbmp($im, $this->filename);
        }

        if ($drawer !== null) {
            $drawer->draw();
        }
    }
1353417
public function draw()
    {
        $canvas = $this->resource;

        if ($canvas) {
            foreach ($this->elementList as $element) {
                if ($element instanceof Image) {
                    $this->drawImage($element, $canvas);
                }

                if ($element instanceof Text) {
                    $this->drawText($element, $canvas);
                }
            }

            $this->resource = $canvas;
        } else {
            throw new \Exception(''
            . 'Image or Figure class is not assigned. '
            . 'E.g. "new Canvas($image_or_figure)"'
            . '');
        }

        return $this;
    }
1320140
public function end()
    {
        $definition = $this->definitions[$this->context];

        $this->context = $this->definitions[$this->context]['parent'];

        $this->definitions[$this->context]['children'][] = $definition;

        return $this;
    }
676209
private function complete()
    {
        if ($this->complete) {
            $message = "Iterator has already been completed";

            if (isset($this->resolutionTrace)) {
                $trace = formatStacktrace($this->resolutionTrace);
                $message .= ". Previous completion trace:\n\n{$trace}\n\n";
            } else {
                // @codeCoverageIgnoreStart
                $message .= ", define environment variable AMP_DEBUG or const AMP_DEBUG = true and enable assertions "
                    . "for a stacktrace of the previous resolution.";
                // @codeCoverageIgnoreEnd
            }

            throw new \Error($message);
        }

        \assert((function () {
            $env = \getenv("AMP_DEBUG") ?: "0";
            if (($env !== "0" && $env !== "false") || (\defined("AMP_DEBUG") && \AMP_DEBUG)) {
                $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS);
                \array_shift($trace); // remove current closure
                $this->resolutionTrace = $trace;
            }

            return true;
        })());

        $this->complete = new Success(false);

        if ($this->waiting !== null) {
            $waiting = $this->waiting;
            $this->waiting = null;
            $waiting->resolve($this->complete);
        }
    }
857603
public function end()
    {
        // Already ended, skip
        if ($this->ended === true) {
            return;
        }

        if (function_exists('fastcgi_finish_request')) {
            fastcgi_finish_request();
        }

        $this->ended = true;

        $this->completeContext();
        $this->completeResponse();

        // We really want to avoid throwing exceptions there
        try {
            $this->log();
        } catch (Exception $e) {
            error_log($e->getMessage());
        }
    }
796856
public function proceed()
    {
        if (isset($this->advices[$this->current])) {
            $currentInterceptor = $this->advices[$this->current++];

            return $currentInterceptor->invoke($this);
        }

        // Fill the closure only once if it's empty
        if ($this->closureToCall === null) {
            $this->closureToCall    = $this->reflectionMethod->getClosure($this->instance);
            $this->previousInstance = $this->instance;
        }

        // Rebind the closure if instance was changed since last time
        if ($this->previousInstance !== $this->instance) {
            $this->closureToCall    = $this->closureToCall->bindTo($this->instance, $this->reflectionMethod->class);
            $this->previousInstance = $this->instance;
        }

        return ($this->closureToCall)(...$this->arguments);
    }
800912
public function end()
    {
        if ($this->parent) {
            $this->parent->addCriterion($this);
            return $this->parent->end();
        }
        return $this->slave;
    }
791723
public function removeProcessed()
    {
        if ( $this->hasAttribute( 'action' ) )
        {
            unset( $this->attributes['action'] );
        }

        if ( $this->getBlockCount() > 0 )
        {
            foreach ( $this->attributes['blocks'] as $index => $block )
            {
                if ( $block->toBeRemoved() )
                {
                    $this->removeBlock( $index );
                }
                else
                {
                    $block->removeProcessed();
                }
            }
        }

        return $this;
    }
1250164
public function boxDraw($horizontalStartPosition, $verticalStartPosition, $lineThickness,
                            $horizontalEndPosition, $verticalEndPosition)
    {
        $command = new Command\Image\BoxDrawCommand($horizontalStartPosition, $verticalStartPosition, $lineThickness,
            $horizontalEndPosition, $verticalEndPosition);
        $this->getComposite()->addCommand($command);
        return $this;
    }