Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to nette 3.0 #304

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- hhvm

matrix:
allow_failures:
- php: hhvm

before_install:
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then COVERAGE="-c `php -i | grep 'xdebug.ini'` --coverage coverage.xml --coverage-src=src/ "; else COVERAGE="" && if [ $TRAVIS_PHP_VERSION = '5.6' ]; then phpenv config-rm xdebug.ini; fi; fi
- if [ $TRAVIS_PHP_VERSION = '7.1' ]; then COVERAGE="-c `php -i | grep 'xdebug.ini'` --coverage coverage.xml --coverage-src=src/ "; else COVERAGE="" && if [ $TRAVIS_PHP_VERSION = '7.1' ]; then phpenv config-rm xdebug.ini; fi; fi
- composer global require hirak/prestissimo

install:
Expand All @@ -21,4 +20,4 @@ script:
- vendor/bin/tester -p php $COVERAGE tests/

after_script:
- if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.xml; fi
- if [ $TRAVIS_PHP_VERSION = '7.1' ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.xml; fi
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

Grido is an extension for [Nette Framework](http://nette.org/). Grido helps you with data listing, formatting, sorting, paging, filtering, editing, bulk actions and exporting them.
It doesn't matter which datasource you are using. For now, Grido works with [Nette Database](https://github.com/nette/database), [Dibi](https://github.com/dg/dibi), [Doctrine](https://github.com/doctrine/doctrine2) and ArraySource (raw PHP Arrays).
You can try it in [live demo](http://grido.bugyik.cz/example/)!

![Alt text](http://img.bugyik.cz/Grido.png "Sample")

Expand Down
2 changes: 1 addition & 1 deletion assets/dist/css/grido.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@charset "UTF-8";
/*!
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion assets/dist/css/grido.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/dist/js/grido.bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion assets/dist/js/grido.bundle.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/dist/js/grido.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion assets/dist/js/grido.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/grido.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion assets/sass/grido.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
35 changes: 20 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,32 @@
}
},
"scripts": {
"test": "./vendor/bin/tester --colors 1 -p php tests/",
"test": "./vendor/bin/tester --colors 1 -j 4 -c tests/php-unix.ini -p php tests/",
"syntax": "./vendor/bin/phpcs --standard=standards.xml --colors --encoding=utf-8 -sp src/",
"syntax-fix": "./vendor/bin/phpcbf --standard=standards.xml src/"
},
"require": {
"php": ">=5.6",
"nette/utils": "~2.4",
"nette/forms": "~2.2",
"latte/latte": "~2.3",
"nette/application": "~2.2",
"nette/component-model": "~2.2",
"php": ">=7.1",
"nette/utils": "^3.0",
"nette/forms": "^3.0",
"latte/latte": "^2.5",
"nette/application": "^3.0",
"nette/component-model": "^3.0",
"symfony/property-access": "~3.0"
},
"require-dev": {
"tracy/tracy": "~2.3",
"nette/bootstrap": "~2.3",
"nette/database": "~2.2",
"tracy/tracy": "^2.6",
"nette/bootstrap": "^3.0",
"nette/database": "^3.0",
"nette/tester": "~1.7.1",
"mockery/mockery": "~0.9.3",
"dibi/dibi": "~3.0.1",
"kdyby/doctrine": "~3.3.0",
"squizlabs/php_codesniffer": "~2.5"
}
"mockery/mockery": "^1.0",
"squizlabs/php_codesniffer": "~2.5",
"kdyby/annotations": "^3.0",
"kdyby/console": "dev-master",
"kdyby/doctrine": "dev-master",
"kdyby/events": "dev-master",
"dibi/dibi": "^4.0"
},
"minimum-stability": "dev",
"prefer-stable": true
}
2 changes: 1 addition & 1 deletion src/Components/Actions/Action.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Actions/Event.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Actions/Href.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down Expand Up @@ -30,7 +30,7 @@ class Href extends Action
/** @var array second param for method $presenter->link() */
protected $arguments = [];

/** @var callback for custom href attribute creating */
/** @var callable callback for custom href attribute creating */
protected $customHref;

/**
Expand All @@ -50,10 +50,10 @@ public function __construct($grid, $name, $label, $destination = NULL, array $ar

/**
* Sets callback for custom link creating.
* @param callback $callback
* @param callable $callback
* @return Href
*/
public function setCustomHref($callback)
public function setCustomHref(callable $callback)
{
$this->customHref = $callback;
return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Button.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Columns/Column.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Columns/Date.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Columns/Editable.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2014 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Columns/Email.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Columns/Link.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Columns/Number.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
10 changes: 5 additions & 5 deletions src/Components/Columns/Text.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand All @@ -24,14 +24,14 @@ class Text extends Editable
protected $truncate;

/**
* @param string $maxLen UTF-8 encoding
* @param int $maxLen UTF-8 encoding
* @param string $append UTF-8 encoding
* @return Column
*/
public function setTruncate($maxLen, $append = "\xE2\x80\xA6")
public function setTruncate(int $maxLen, string $append = "\xE2\x80\xA6")
{
$this->truncate = function($string) use ($maxLen, $append) {
return \Nette\Utils\Strings::truncate($string, $maxLen, $append);
$this->truncate = function(?string $string) use ($maxLen, $append): string {
return $string !== null ? \Nette\Utils\Strings::truncate($string, $maxLen, $append) : '';
};

return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Component.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Container.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down Expand Up @@ -382,10 +382,10 @@ public function addActionEvent($name, $label, $onClick = NULL)

/**
* @param array $operations
* @param callback $onSubmit - callback after operation submit
* @param callable $onSubmit - callback after operation submit
* @return Operation
*/
public function setOperation(array $operations, $onSubmit)
public function setOperation(array $operations, callable $onSubmit)
{
return new Operation($this, $operations, $onSubmit);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Export.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down Expand Up @@ -163,7 +163,7 @@ public function handleExport()
* @param \Nette\Http\IResponse $httpResponse
* @return void
*/
public function send(\Nette\Http\IRequest $httpRequest, \Nette\Http\IResponse $httpResponse)
public function send(\Nette\Http\IRequest $httpRequest, \Nette\Http\IResponse $httpResponse): void
{
$encoding = 'utf-8';
$label = $this->label
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Check.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Condition.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Custom.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Date.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/DateRange.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Filter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Number.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Filters/Select.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file is part of the Grido (http://grido.bugyik.cz)
* This file is part of the Grido (https://github.com/o5/grido)
*
* Copyright (c) 2011 Petr Bugyík (http://petr.bugyik.cz)
*
Expand Down
Loading