Skip to content

Commit 732aed7

Browse files
committed
require nette 2.2 && php5.4
1 parent 9743ffe commit 732aed7

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=5.3.2",
14-
"nette/nette": "~2.1@dev"
13+
"php": ">=5.4",
14+
"nette/utils": "~2.2",
15+
"nette/forms": "~2.2",
16+
"nette/application": "~2.2"
1517
},
1618
"autoload": {
1719
"psr-4": {

src/Form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
*/
77
class Form extends \Nette\Application\UI\Form implements IFormWithMapper
88
{
9+
910
use TFormWithMapper;
1011
}

src/FormFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
namespace Librette\Forms;
33

4+
use Nette;
45
use Nette\Forms\IFormRenderer;
56
use Nette\Localization\ITranslator;
6-
use Nette;
77

88
/**
99
* @author David Matejka

src/TFormWithMapper.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,26 @@
44
use Nette\Application\UI\Presenter;
55
use Nette\ComponentModel\IComponent;
66

7+
/**
8+
* @author David Matejka
9+
*/
710
trait TFormWithMapper
811
{
912

1013
/** @var array of callbacks invoked before onSuccess callback */
11-
public $onBeforeSuccess = array();
14+
public $onBeforeSuccess = [];
1215

1316
/** @var array of callbacks invoked after onSuccess callback */
14-
public $onAfterSuccess = array();
17+
public $onAfterSuccess = [];
1518

1619
/** @var array of callbacks invoked right before mapper loads data */
17-
public $onLoad = array();
20+
public $onLoad = [];
1821

1922
/** @var array of callbacks invoked right after mapper loads data */
20-
public $onAfterLoad = array();
23+
public $onAfterLoad = [];
2124

2225
/** @var array of callbacks invoked when form is attached to presenter */
23-
public $onAttached = array();
26+
public $onAttached = [];
2427

2528
/** @var IMapper */
2629
protected $mapper;
@@ -29,7 +32,7 @@ trait TFormWithMapper
2932
public function fireEvents()
3033
{
3134
$originalOnSuccess = $this->onSuccess;
32-
$this->onSuccess = array();
35+
$this->onSuccess = [];
3336
$this->onSuccess[] = function () use ($originalOnSuccess) {
3437
$events = [];
3538
$events[] = $this->onBeforeSuccess;

0 commit comments

Comments
 (0)