From bfc03dd38650d4cb420e599ff88376823846c802 Mon Sep 17 00:00:00 2001 From: DaviMenezes Date: Thu, 19 Dec 2019 19:05:29 -0300 Subject: [PATCH] improvements in build component + refactorings --- src/Collection.php | 8 +++++--- src/Corda.php | 3 ++- src/Http/Request.php | 2 ++ src/Service/Layout/Form/Field/Facade/FormField.php | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Collection.php b/src/Collection.php index fa044b2..77ef9a7 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -2,6 +2,7 @@ namespace Dvi\Support; +use Dvi\Corda\Support\Corda; use Dvi\Corda\Support\Corda as str; use Tightenco\Collect\Support\Collection as SupportCollection; @@ -14,13 +15,14 @@ * @copyright Copyright (c) 2018. (davimenezes.dev@gmail.com) * @see https://github.com/DaviMenezes * @see https://t.me/davimenezes + * @method Corda first(callable $callback = null, $default = null) */ class Collection extends SupportCollection { /** * @param $value * @param null $glue - * @return Corda + * @return str */ public function implode($value, $glue = null) { @@ -30,7 +32,7 @@ public function implode($value, $glue = null) /** * @param $key * @param null $default - * @return Corda|mixed + * @return str|mixed */ public function get($key, $default = null) { @@ -41,7 +43,7 @@ public function get($key, $default = null) return $result; } - /**@return Corda*/ + /**@return str*/ public function route() { $this->map(function ($item, $key) use (&$url) { diff --git a/src/Corda.php b/src/Corda.php index b29d49b..f5a3af3 100644 --- a/src/Corda.php +++ b/src/Corda.php @@ -14,6 +14,7 @@ * @copyright Copyright (c) 2018. (davimenezes.dev@gmail.com) * @see https://github.com/DaviMenezes * @see https://t.me/davimenezes + * @method Corda first($n) */ class Corda extends Stringy { @@ -34,7 +35,7 @@ public function lines() /**@return Collection*/ public function split($pattern, $limit = null) { - return collect(parent::split($pattern, $limit)); + return \collection(parent::split($pattern, $limit)); } public function lastStr(string $separator) diff --git a/src/Http/Request.php b/src/Http/Request.php index c8205ad..5d56b37 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -26,7 +26,9 @@ */ class Request { + /**@var self*/ protected static $request; + /**@var self*/ private static $instance; private function __construct() diff --git a/src/Service/Layout/Form/Field/Facade/FormField.php b/src/Service/Layout/Form/Field/Facade/FormField.php index bd5110d..b5bbd7b 100644 --- a/src/Service/Layout/Form/Field/Facade/FormField.php +++ b/src/Service/Layout/Form/Field/Facade/FormField.php @@ -23,7 +23,8 @@ class FormField public function __construct(TField $field, $label = null) { $this->field = $field; - $field->setId($field->getName()); + $this->field->setId($field->getName()); + $this->field->setProperty('id', $field->getName()); if ($label) { $this->setLabel($label);