diff --git a/src/Forms/Element/AbstractElement.php b/src/Forms/Element/AbstractElement.php index 75d09da7..92d56cef 100644 --- a/src/Forms/Element/AbstractElement.php +++ b/src/Forms/Element/AbstractElement.php @@ -10,9 +10,12 @@ namespace Phalcon\Forms\Element; use InvalidArgumentException; +use Phalcon\Di\DiInterface; +use Phalcon\Di\Di; use Phalcon\Filter\Validation\ValidatorInterface; use Phalcon\Forms\Form; use Phalcon\Forms\Exception; +use Phalcon\Html\Escaper; use Phalcon\Html\TagFactory; use Phalcon\Messages\MessageInterface; use Phalcon\Messages\Messages; diff --git a/src/Support/Helper/Str/Camelize.php b/src/Support/Helper/Str/Camelize.php index 316cb999..4b92b174 100644 --- a/src/Support/Helper/Str/Camelize.php +++ b/src/Support/Helper/Str/Camelize.php @@ -10,19 +10,20 @@ namespace Phalcon\Support\Helper\Str; /** - * Converts strings to camelize style + * Converts strings to upperCamelCase or lowerCamelCase */ -class Camelize +class Camelize extends \Phalcon\Support\Helper\Str\PascalCase { /** * @param string $text * @param string|null $delimiters + * @param bool $lowerFirst * * @return string */ - public function __invoke(string $text, string $delimiters = null): string + public function __invoke(string $text, string $delimiters = null, bool $lowerFirst = false): string { } } diff --git a/src/Support/Helper/Str/KebabCase.php b/src/Support/Helper/Str/KebabCase.php new file mode 100644 index 00000000..e7fd1179 --- /dev/null +++ b/src/Support/Helper/Str/KebabCase.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Support\Helper\Str; + +/** + * Converts strings to kebab-case style + */ +class KebabCase extends \Phalcon\Support\Helper\Str\PascalCase +{ + + + /** + * @param string $text + * @param string|null $delimiters + * + * @return string + */ + public function __invoke(string $text, string $delimiters = null): string + { + } +} diff --git a/src/Support/Helper/Str/PascalCase.php b/src/Support/Helper/Str/PascalCase.php new file mode 100644 index 00000000..024beeb8 --- /dev/null +++ b/src/Support/Helper/Str/PascalCase.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Support\Helper\Str; + +/** + * Converts strings to PascalCase style + */ +class PascalCase +{ + + + /** + * @param string $text + * @param string|null $delimiters + * + * @return string + */ + public function __invoke(string $text, string $delimiters = null): string + { + } + + /** + * @param string $text + * @param string|null $delimiters + * + * @return array + */ + protected function processArray(string $text, string $delimiters = null): array + { + } +} diff --git a/src/Support/Helper/Str/SnakeCase.php b/src/Support/Helper/Str/SnakeCase.php new file mode 100644 index 00000000..194c68c6 --- /dev/null +++ b/src/Support/Helper/Str/SnakeCase.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Support\Helper\Str; + +/** + * Converts strings to snake_case style + */ +class SnakeCase extends \Phalcon\Support\Helper\Str\PascalCase +{ + + + /** + * @param string $text + * @param string|null $delimiters + * + * @return string + */ + public function __invoke(string $text, string $delimiters = null): string + { + } +} diff --git a/src/Support/HelperFactory.php b/src/Support/HelperFactory.php index b1d69765..a0a5e086 100644 --- a/src/Support/HelperFactory.php +++ b/src/Support/HelperFactory.php @@ -39,6 +39,7 @@ * @method string decode(string $data, bool $associative = false, int $depth = 512, int $options = 0) * @method string encode($data, int $options = 0, int $depth = 512) * @method bool between(int $value, int $start, int $end) + * @method string camelize(string $text, string $delimiters = null, bool $lowerFirst = false) * @method string concat(string $delimiter, string $first, string $second, string ...$arguments) * @method int countVowels(string $text) * @method string decapitalize(string $text, bool $upperRest = false, string $encoding = 'UTF-8') @@ -55,14 +56,18 @@ * @method bool isLower(string $text, string $encoding = 'UTF-8') * @method bool isPalindrome(string $text) * @method bool isUpper(string $text, string $encoding = 'UTF-8') + * @method string kebabCase(string $text, string $delimiters = null) * @method int len(string $text, string $encoding = 'UTF-8') * @method string lower(string $text, string $encoding = 'UTF-8') + * @method string pascalCase(string $text, string $delimiters = null) * @method string prefix($text, string $prefix) * @method string random(int $type = 0, int $length = 8) * @method string reduceSlashes(string $text) * @method bool startsWith(string $haystack, string $needle, bool $ignoreCase = true) + * @method string snakeCase(string $text, string $delimiters = null) * @method string suffix($text, string $suffix) * @method string ucwords(string $text, string $encoding = 'UTF-8') + * @method string uncamelize(string $text, string $delimiters = '_') * @method string underscore(string $text) * @method string upper(string $text, string $encoding = 'UTF-8') */