@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -include __DIR__."/vendor/autoload.php"; |
|
| 2 | +include __DIR__ . "/vendor/autoload.php"; |
|
| 3 | 3 | |
| 4 | 4 | use Enjoys\Forms\Form; |
| 5 | 5 | use Enjoys\Forms\Renderer\Renderer; |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | $form->textarea('about', 'Коротко о себе'); |
| 38 | 38 | $form->submit('submit_btn', 'Отправить анкету'); |
| 39 | 39 | |
| 40 | -if(!$form->isSubmitted()){ |
|
| 40 | +if (!$form->isSubmitted()) { |
|
| 41 | 41 | $renderer = new Renderer($form); |
| 42 | 42 | echo $renderer->display(); |
| 43 | -}else{ |
|
| 43 | +} else { |
|
| 44 | 44 | _var_dump($_GET); |
| 45 | 45 | } |
@@ -40,6 +40,6 @@ |
||
| 40 | 40 | if(!$form->isSubmitted()){ |
| 41 | 41 | $renderer = new Renderer($form); |
| 42 | 42 | echo $renderer->display(); |
| 43 | -}else{ |
|
| 43 | +} else{ |
|
| 44 | 44 | _var_dump($_GET); |
| 45 | 45 | } |
@@ -184,7 +184,7 @@ |
||
| 184 | 184 | */ |
| 185 | 185 | public function addClass($class, string $namespace = 'general') |
| 186 | 186 | { |
| 187 | - if(is_array($class)){ |
|
| 187 | + if (is_array($class)) { |
|
| 188 | 188 | foreach ($class as $_class) { |
| 189 | 189 | $this->addClass($_class, $namespace); |
| 190 | 190 | } |
@@ -232,11 +232,11 @@ |
||
| 232 | 232 | return $this->name; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - /** |
|
| 236 | - * Установка аттрибута формы name |
|
| 237 | - * @param string|null $name |
|
| 238 | - * @return \self |
|
| 239 | - */ |
|
| 235 | + /** |
|
| 236 | + * Установка аттрибута формы name |
|
| 237 | + * @param string|null $name |
|
| 238 | + * @return \self |
|
| 239 | + */ |
|
| 240 | 240 | protected function setName(?string $name = null): self |
| 241 | 241 | { |
| 242 | 242 | $this->name = $name; |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | { |
| 51 | 51 | parent::__construct($name, $title); |
| 52 | 52 | $this->setAttribute('list', $this->getAttribute('id')); |
| 53 | - $this->removeAttribute('id'); |
|
| 53 | + $this->removeAttribute('id'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function baseHtml(): ?string |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | */ |
| 104 | 104 | public function getForm() |
| 105 | 105 | { |
| 106 | - return $this->form;// ?? new Form(); |
|
| 106 | + return $this->form; // ?? new Form(); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | private function check($value, Element $element) |
| 79 | 79 | { |
| 80 | 80 | foreach ($this->getParams() as $rule => $ruleOpts) { |
| 81 | - // $method = 'unknown'; |
|
| 81 | + // $method = 'unknown'; |
|
| 82 | 82 | if (is_int($rule) && is_string($ruleOpts)) { |
| 83 | 83 | $rule = $ruleOpts; |
| 84 | 84 | $ruleOpts = null; |