Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Aug 22, 2017
1 parent ccf3aff commit 7c8616b
Show file tree
Hide file tree
Showing 3 changed files with 467 additions and 441 deletions.
16 changes: 10 additions & 6 deletions app/components/TeamForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public function __construct(array $countries, CategoryData $categories, $parent,
$this->countries = $countries;
$this->categories = $categories;

$minMembers = $this->getPresenter()->context->parameters['entries']['minMembers'];
/** @var BasePresenter $presenter */
$presenter = $this->getPresenter();
$minMembers = $presenter->context->parameters['entries']['minMembers'];

$this->setTranslator($parent->translator);
$renderer = new \Nextras\Forms\Rendering\Bs3FormRenderer();
Expand All @@ -48,7 +50,7 @@ public function __construct(array $countries, CategoryData $categories, $parent,
/** @var \Kdyby\Translation\Translator $translator */
$translator = $this->getTranslator();

$fields = $this->getPresenter()->context->parameters['entries']['fields']['team'];
$fields = $presenter->context->parameters['entries']['fields']['team'];
$this->addCustomFields($fields, $this);

$this->addTextArea('message', 'messages.team.message.label');
Expand All @@ -58,7 +60,7 @@ public function __construct(array $countries, CategoryData $categories, $parent,
$this->addSubmit('add', 'messages.team.action.add')->setValidationScope(false)->onClick[] = Callback::closure($this, 'addMemberClicked');
$this->addSubmit('remove', 'messages.team.action.remove')->setValidationScope(false)->onClick[] = Callback::closure($this, 'removeMemberClicked');

$fields = $this->getPresenter()->context->parameters['entries']['fields']['person'];
$fields = $presenter->context->parameters['entries']['fields']['person'];
$i = 0;
$this->addDynamic('persons', function(Container $container) use (&$i, $fields, $translator) {
++$i;
Expand All @@ -77,15 +79,17 @@ public function __construct(array $countries, CategoryData $categories, $parent,

if ($i === 1) {
$container['email']->setRequired()->addRule(Form::EMAIL);
$container->currentGroup->setOption('description', 'messages.team.person.isContact');
$group->setOption('description', 'messages.team.person.isContact');
}
}, $minMembers, true);
}

public function onRender() {
/** @var BasePresenter $presenter */
$presenter = $this->getPresenter();
$count = iterator_count($this['persons']->getContainers());
$minMembers = $this->getPresenter()->context->parameters['entries']['minMembers'];
$maxMembers = $this->getPresenter()->context->parameters['entries']['maxMembers'];
$minMembers = $presenter->context->parameters['entries']['minMembers'];
$maxMembers = $presenter->context->parameters['entries']['maxMembers'];

if ($count >= $maxMembers) {
$this['add']->setDisabled();
Expand Down
27 changes: 13 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,34 @@
"repositories": [
],
"require": {
"php": ">= 5.6",
"php": ">= 7.0",
"nette/application": "~2.4",
"nette/bootstrap": "~2.4",
"nette/caching": "~2.5",
"nette/component-model": "~2.3",
"nette/database": "~2.4",
"nette/deprecated": "~2.3",
"nette/di": "~2.4",
"nette/finder": "~2.4",
"nette/forms": "~2.4",
"nette/http": "~2.4",
"nette/mail": "~2.4",
"nette/neon": "~2.4",
"nette/php-generator": "~2.4",
"nette/reflection": "~2.4",
"nette/robot-loader": "~2.4",
"nette/robot-loader": "~3.0",
"nette/safe-stream": "~2.3",
"nette/security": "~2.4",
"nette/tokenizer": "~2.2",
"nette/utils": "~2.4",
"latte/latte": "~2.4",
"tracy/tracy": "~2.4",
"nextras/forms": "dev-master",
"nextras/forms": "~2.0",
"kdyby/forms-replicator": "dev-master",
"kdyby/translation": "dev-master",
"nextras/orm": "@dev",
"kdyby/translation": "~2.4",
"nextras/orm": "~2.2",
"pelago/emogrifier": "^1.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.3",
"jakub-onderka/php-parallel-lint": "^0.9.2",
"nette/tester": "dev-master",
"phpstan/phpstan": "^0.7.0",
"phpstan/phpstan-nette": "^0.7.0"
"nette/tester": "^2.0.0",
"phpstan/phpstan": "^0.8.0",
"phpstan/phpstan-nette": "^0.8.0"
},
"autoload": {
"classmap": ["app/"]
Expand All @@ -55,5 +49,10 @@
"cs": "vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=utils/php_cs.php",
"lint": "vendor/bin/parallel-lint app/ tests/ www/",
"phpstan": "vendor/bin/phpstan analyse --configuration=utils/phpstan.neon --level=7 app/ tests/ www/"
},
"config": {
"platform": {
"php": "7.0.22"
}
}
}
Loading

0 comments on commit 7c8616b

Please sign in to comment.