@@ -17,8 +17,6 @@ |
||
| 17 | 17 | namespace IPub\Forms\Forms; |
| 18 | 18 | |
| 19 | 19 | use Doctrine\ORM; |
| 20 | - |
|
| 21 | -use Nette; |
|
| 22 | 20 | use Nette\Forms; |
| 23 | 21 | |
| 24 | 22 | class Container extends Forms\Container |
@@ -17,8 +17,6 @@ |
||
| 17 | 17 | namespace IPub\Forms\Forms; |
| 18 | 18 | |
| 19 | 19 | use Doctrine\ORM; |
| 20 | - |
|
| 21 | -use Nette; |
|
| 22 | 20 | use Nette\Application; |
| 23 | 21 | use Nette\ComponentModel; |
| 24 | 22 | |
@@ -188,7 +188,7 @@ |
||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
| 191 | - * @param Nette\Forms\Controls\BaseControl|Nette\Forms\Container $formElement |
|
| 191 | + * @param Nette\ComponentModel\Component $formElement |
|
| 192 | 192 | * |
| 193 | 193 | * @return array|\ArrayIterator |
| 194 | 194 | * |
@@ -17,10 +17,8 @@ |
||
| 17 | 17 | namespace IPub\Forms\Forms; |
| 18 | 18 | |
| 19 | 19 | use Doctrine\ORM; |
| 20 | - |
|
| 21 | 20 | use Nette; |
| 22 | 21 | use Nette\Forms; |
| 23 | - |
|
| 24 | 22 | use IPub; |
| 25 | 23 | use IPub\Forms\Exceptions; |
| 26 | 24 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | } else { |
| 114 | - $methodName = 'get' . ucfirst($name); |
|
| 114 | + $methodName = 'get'.ucfirst($name); |
|
| 115 | 115 | |
| 116 | 116 | if (method_exists($entity, $methodName) && $value = call_user_func([$entity, $methodName])) { |
| 117 | 117 | if (is_object($value) && $this->isEntity($value)) { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | } else { |
| 144 | - $methodName = 'get' . ucfirst($name); |
|
| 144 | + $methodName = 'get'.ucfirst($name); |
|
| 145 | 145 | |
| 146 | 146 | if (method_exists($entity, $methodName) && $value = call_user_func([$entity, $methodName])) { |
| 147 | 147 | if (is_object($value) && $this->isEntity($value)) { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | private function getMetadata($entity) |
| 172 | 172 | { |
| 173 | 173 | if (!$this->isEntity($entity)) { |
| 174 | - throw new Exceptions\InvalidArgumentException('Expected object, ' . gettype($entity) . ' given.'); |
|
| 174 | + throw new Exceptions\InvalidArgumentException('Expected object, '.gettype($entity).' given.'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $this->entityManager->getClassMetadata(get_class($entity)); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | return [$formElement]; |
| 204 | 204 | |
| 205 | 205 | } else { |
| 206 | - throw new Exceptions\InvalidArgumentException('Expected Nette\Forms\Container or Nette\Forms\IControl, but ' . get_class($formElement) . ' given'); |
|
| 206 | + throw new Exceptions\InvalidArgumentException('Expected Nette\Forms\Container or Nette\Forms\IControl, but '.get_class($formElement).' given'); |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -15,10 +15,7 @@ |
||
| 15 | 15 | namespace IPub\Forms\Forms; |
| 16 | 16 | |
| 17 | 17 | use Nette; |
| 18 | -use Nette\Utils; |
|
| 19 | - |
|
| 20 | 18 | use IPub\Forms; |
| 21 | -use IPub\Forms\Processors; |
|
| 22 | 19 | |
| 23 | 20 | trait TForm |
| 24 | 21 | { |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | protected function addExtension(string $name, string $class) |
| 35 | 35 | { |
| 36 | - Nette\Forms\Container::extensionMethod($name, function (Nette\Forms\Container $container, $name, $label = NULL) use ($class) { |
|
| 36 | + Nette\Forms\Container::extensionMethod($name, function(Nette\Forms\Container $container, $name, $label = NULL) use ($class) { |
|
| 37 | 37 | return $container[$name] = new $class($label); |
| 38 | 38 | }); |
| 39 | 39 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | . '->%1.raw) echo $_label' |
| 65 | 65 | . ($node->tokenizer->isNext() ? '->addAttributes($attributes)' : '->addAttributes($attributes)'), |
| 66 | 66 | $name, |
| 67 | - $words ? ('getLabelPart(' . implode(', ', array_map([$writer, 'formatWord'], $words)) . ')') : 'getLabel()' |
|
| 67 | + $words ? ('getLabelPart('.implode(', ', array_map([$writer, 'formatWord'], $words)).')') : 'getLabel()' |
|
| 68 | 68 | ); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | public function macroLabelEnd(MacroNode $node, PhpWriter $writer) |
| 81 | 81 | { |
| 82 | 82 | if ($node->content != NULL) { |
| 83 | - $node->openingCode = rtrim($node->openingCode, '?> ') . '->startTag() ?>'; |
|
| 83 | + $node->openingCode = rtrim($node->openingCode, '?> ').'->startTag() ?>'; |
|
| 84 | 84 | return $writer->write('if ($_label) echo $_label->endTag()'); |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | public static function register(Nette\Configurator $config, string $extensionName = 'extendedForms') |
| 59 | 59 | { |
| 60 | - $config->onCompile[] = function (Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
| 60 | + $config->onCompile[] = function(Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
| 61 | 61 | $compiler->addExtension($extensionName, new FormsExtension()); |
| 62 | 62 | }; |
| 63 | 63 | } |