Encode a circle.

@param string       $type    The circle type.
@param CircleMarker $circle  The circle object.
@param Encoder      $builder The builder.

@return array
556152
private function doCircleEncode($type, CircleMarker $circle, Encoder $builder)
    {
        return sprintf(
            '%s = L.%s(%s);',
            $builder->encodeReference($circle),
            $type,
            $builder->encodeArguments(array($circle->getLatLng(), $circle, $circle->getOptions()))
        );
    }
196584
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->addModelTransformer(new CallbackTransformer(
            function ($original) {
                $tree = $this->blockService->getTree($original);

                return json_encode($tree);
            },
            function ($submitted) {
                $array = json_decode($submitted, true);

                $stripped = $this->stripMetadata($array);

                return trim(json_encode($stripped));
            }
        ));
    }
842026
public static function create($type, ClassMetadataBuilder $builder)
    {
        if (isset(static::$map[$type])) {
            return new static::$map[$type]($builder);
        }

        throw new InvalidArgumentException("Inheritance type [{$type}] does not exist. SINGLE_TABLE and JOINED are support");
    }
1049238
public function writeString($data, $type = null)
    {
        if (!isset($type)) {
            $type = $this->_guessType($data);
        }
        return $this->_encodeValue($data, $this->_parseTypeString($type));
    }
732118
public function encodePopup(Popup $popup, Encoder $encoder)
    {
        $source = $popup->getSource();
        $buffer = sprintf(
            '%s = L.popup(%s%s);',
            $encoder->encodeReference($popup),
            $encoder->encodeArray($popup->getOptions()),
            $source ? (', ' . $encoder->encodeReference($source)) : ''
        );

        $buffer .= $this->encodeMethodCalls($popup->getMethodCalls(), $encoder);

        return $buffer;
    }
48233
public function encode(string $data, int $type = Protocol::TYPE_TEXT, bool $masked = false)
    {
        $this->frames = [];

        $frame = $this->getFrame();
        array_push($this->frames, $frame);

        $frame->encode($data, $type, $masked);

        return $this;
    }
112491
public static function encode(String $string, String $type = 'quotes', String $encoding = 'utf-8') : String
    {
        return htmlspecialchars(trim($string), Helper::toConstant($type, 'ENT_'), $encoding);
    }
460234
public function jsonEncode($object, UriBuilder $uriBuilder, $metaDataProcessorGroup = NULL) {

		return json_encode($this->process($object, $uriBuilder, $metaDataProcessorGroup));

	}
991584
public static function encode($value, string $type = null): string
    {
        return self::run(self::ENCODER, $value, $type);
    }
550003
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('x', NumberType::class, array())
            ->add('y', NumberType::class, array())
            ->add('width', NumberType::class, array())
            ->add('height', NumberType::class, array())
            ->add('rotate', NumberType::class, array())
            ->add('scaleX', NumberType::class, array())
            ->add('scaleY', NumberType::class, array())
        ;
    }
249517
protected function encodeWithOffset($type, $solidityType, $encoded, $offset)
    {
        if ($solidityType->isDynamicArray($type)) {
            $nestedName = $solidityType->nestedName($type);
            $nestedStaticPartLength = $solidityType->staticPartLength($type);
            $result = $encoded[0];

            if ($solidityType->isDynamicArray($nestedName)) {
                $previousLength = 2;

                for ($i=0; $i<count($encoded); $i++) {
                    if (isset($encoded[$i - 1])) {
                        $previousLength += abs($encoded[$i - 1][0]);
                    }
                    $result .= IntegerFormatter::format($offset + $i * $nestedStaticPartLength + $previousLength * 32);
                }
            }
            for ($i=0; $i<count($encoded); $i++) {
                // $bn = Utils::toBn($result);
                // $divided = $bn->divide(Utils::toBn(2));

                // if (is_array($divided)) {
                //     $additionalOffset = (int) $divided[0]->toString();
                // } else {
                //     $additionalOffset = 0;
                // }
                $additionalOffset = floor(mb_strlen($result) / 2);
                $result .= $this->encodeWithOffset($nestedName, $solidityType, $encoded[$i], $offset + $additionalOffset);
            }
            return mb_substr($result, 64);
        } elseif ($solidityType->isStaticArray($type)) {
            $nestedName = $solidityType->nestedName($type);
            $nestedStaticPartLength = $solidityType->staticPartLength($type);
            $result = '';

            if ($solidityType->isDynamicArray($nestedName)) {
                $previousLength = 0;

                for ($i=0; $i<count($encoded); $i++) {
                    if (isset($encoded[$i - 1])) {
                        $previousLength += abs($encoded[$i - 1])[0];
                    }
                    $result .= IntegerFormatter::format($offset + $i * $nestedStaticPartLength + $previousLength * 32);
                }
            }
            for ($i=0; $i<count($encoded); $i++) {
                // $bn = Utils::toBn($result);
                // $divided = $bn->divide(Utils::toBn(2));

                // if (is_array($divided)) {
                //     $additionalOffset = (int) $divided[0]->toString();
                // } else {
                //     $additionalOffset = 0;
                // }
                $additionalOffset = floor(mb_strlen($result) / 2);
                $result .= $this->encodeWithOffset($nestedName, $solidityType, $encoded[$i], $offset + $additionalOffset);
            }
            return $result;
        }
        return $encoded;
    }
592914
protected function encodeTime(AbstractTimeType $type, string $format)
    {
        $this->validateTimeType($type);

        return parent::encodeTime($type, $format);
    }
592781
public function apply($builder)
    {
        $values = $this->getValues();
        if (empty($values)) {
            return $builder;
        }
        $builder->whereIn('type_id', $values);
    }
881129
protected function getTokenPattern(int $type): string
    {
        $patternMap = [
            Token::TYPE_SLASH => '/',
            Token::TYPE_ESCAPED => '~(0|1)',
            Token::TYPE_UNESCAPED => '[^/~]',
            Token::TYPE_ERROR_INVALID_ESCAPE => '~',
        ];
        if (!isset($patternMap[$type])) {
            throw new DomainException("Unknown token type: {$type}");
        }
        $pattern = $patternMap[$type];
        return "#{$pattern}#uA";
    }
981447
protected function paginateBuilder(Builder $builder, EncodingParametersInterface $parameters)
    {
        $pageSize   = $this->getPageSize($parameters);
        $pageNumber = $this->getPageNumber($parameters);
        $paginator  = $builder->paginate($pageSize, ['*'], 'page', $pageNumber);

        /** @var IlluminateRequest $request */
        $request = $this->getContainer()->make(IlluminateRequest::class);
        $url     = $request->url();
        $query   = $request->query();

        $pagedData  = $this->getFactory()->createPagingStrategy()->createPagedData($paginator, $url, true, $query);

        return $pagedData;
    }
456078
protected function compileMethodDefinitions(ClassBuilder $builder, StreamWriter $writer)
    {

        foreach ($builder->getMethods() as $method) {
            /* @var MethodBuilder $method */

            $writer->indent()->writeLine('/**');

            $comments = $method->getComments();
            if (count($comments)) {
                foreach ($comments as $comment) {
                    $comment = trim(ltrim($comment, '>'));
                    $writer->indent()->write(' * ')->writeLine($comment);
                }
                $writer->indent()->write(' * ')->writeLine();
            }

            $arguments = $method->getArguments();
            $argumentTypeMaxLen = 0;
            if (count($arguments)) {
                foreach ($arguments as $argument) {
                    $argumentTypeMaxLen = max($argumentTypeMaxLen, strlen($argument[1]));
                }
            }

            foreach ($arguments as $argument) {
                $writer->indent()
                    ->write(' * @param ' . sprintf('%-' . $argumentTypeMaxLen . 's', $argument[1]))
                    ->writeLine(' $' . $argument[0]);
            }

            if ($method->getType()) {
                $writer->indent()->writeLine(' *');
                $writer->indent()->writeLine(' * @return ' . $method->getType());
            }

            $writer->indent()->writeLine(' */');

            $writer->indent()
                ->write($method->getVisibility())
                ->write(' function ')
                ->write($method->getName())
                ->write('(');

            $args = array();
            foreach ($arguments as $argument) {
                $type = $this->getType($argument[1]);
                $item = '';
                if ($type['hint']) {
                    $item .= $type['name'] . ' ';
                }
                $item .= '$'.$argument[0];
                $args[] = $item;
            }

            if (count($args)) {
                $writer->write(implode(', ', $args));
            }

            $writer->writeLine(')')
                ->indent()->writeLine('{')
                ->indent()->indent()->writeLine()
                ->indent()->writeLine('}')->writeLine();
        }
    }
1325318
protected function _codeNode($type = null, $coverable = false)
    {
        $body = $this->_states['body'];
        if ($body === '') {
            return;
        }

        $node = new NodeDef($body, $type ?: $this->_codeType());
        return $this->_contextualize($node, $coverable);
    }