diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..71e9844 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: php +php: + - 5.3 + +script: + - php code-checker/src/code-checker.php + +before_script: + - travis_retry composer create-project nette/code-checker code-checker ~2.5 --no-interaction + +sudo: false + +cache: + directories: + - $HOME/.composer/cache diff --git a/CD-collection/app/bootstrap.php b/CD-collection/app/bootstrap.php index f2e9527..9565943 100644 --- a/CD-collection/app/bootstrap.php +++ b/CD-collection/app/bootstrap.php @@ -1,7 +1,7 @@ setDebugMode(TRUE); $configurator->enableDebugger(__DIR__ . '/../log'); // Enable RobotLoader - this will load all classes automatically diff --git a/CD-collection/app/config.neon b/CD-collection/app/config.neon index e1db780..4320380 100644 --- a/CD-collection/app/config.neon +++ b/CD-collection/app/config.neon @@ -1,6 +1,6 @@ # # SECURITY WARNING: it is CRITICAL that this file & directory are NOT accessible directly via a web browser! -# http://nette.org/security-warning +# https://nette.org/security-warning # php: date.timezone: Europe/Prague @@ -10,8 +10,8 @@ nette: mapping: *: App\*Module\Presenters\*Presenter - database: - dsn: "sqlite:%appDir%/model/demo.db3" +database: + dsn: "sqlite:%appDir%/model/demo.db3" services: - App\Model\Authenticator diff --git a/CD-collection/app/model/Authenticator.php b/CD-collection/app/model/Authenticator.php index 7a7c994..b332696 100644 --- a/CD-collection/app/model/Authenticator.php +++ b/CD-collection/app/model/Authenticator.php @@ -2,8 +2,8 @@ namespace App\Model; -use Nette, - Nette\Security; +use Nette; +use Nette\Security; /** diff --git a/CD-collection/app/presenters/DashboardPresenter.php b/CD-collection/app/presenters/DashboardPresenter.php index b8afdb4..b79e987 100644 --- a/CD-collection/app/presenters/DashboardPresenter.php +++ b/CD-collection/app/presenters/DashboardPresenter.php @@ -2,9 +2,9 @@ namespace App\Presenters; -use App\Model, - Nette, - Nette\Application\UI\Form; +use App\Model; +use Nette; +use Nette\Application\UI\Form; class DashboardPresenter extends Nette\Application\UI\Presenter @@ -23,8 +23,8 @@ protected function startup() { parent::startup(); - if (!$this->user->isLoggedIn()) { - if ($this->user->logoutReason === Nette\Security\IUserStorage::INACTIVITY) { + if (!$this->getUser()->isLoggedIn()) { + if ($this->getUser()->getLogoutReason() === Nette\Security\IUserStorage::INACTIVITY) { $this->flashMessage('You have been signed out due to inactivity. Please sign in again.'); } $this->redirect('Sign:in', array('backlink' => $this->storeRequest())); @@ -93,11 +93,11 @@ protected function createComponentAlbumForm() $form->addSubmit('save', 'Save') ->setAttribute('class', 'default') - ->onClick[] = $this->albumFormSucceeded; + ->onClick[] = array($this, 'albumFormSucceeded'); $form->addSubmit('cancel', 'Cancel') - ->setValidationScope(NULL) - ->onClick[] = $this->formCancelled; + ->setValidationScope(array()) + ->onClick[] = array($this, 'formCancelled'); $form->addProtection(); return $form; @@ -127,11 +127,11 @@ protected function createComponentDeleteForm() { $form = new Form; $form->addSubmit('cancel', 'Cancel') - ->onClick[] = $this->formCancelled; + ->onClick[] = array($this, 'formCancelled'); $form->addSubmit('delete', 'Delete') ->setAttribute('class', 'default') - ->onClick[] = $this->deleteFormSucceeded; + ->onClick[] = array($this, 'deleteFormSucceeded'); $form->addProtection(); return $form; diff --git a/CD-collection/app/presenters/SignPresenter.php b/CD-collection/app/presenters/SignPresenter.php index 2eac2de..10d2a21 100644 --- a/CD-collection/app/presenters/SignPresenter.php +++ b/CD-collection/app/presenters/SignPresenter.php @@ -2,8 +2,8 @@ namespace App\Presenters; -use Nette, - Nette\Application\UI; +use Nette; +use Nette\Application\UI; class SignPresenter extends Nette\Application\UI\Presenter @@ -27,7 +27,7 @@ protected function createComponentSignInForm() $form->addSubmit('send', 'Sign in'); - $form->onSuccess[] = $this->signInFormSucceeded; + $form->onSuccess[] = array($this, 'signInFormSucceeded'); return $form; } diff --git a/CD-collection/app/templates/@layout.latte b/CD-collection/app/presenters/templates/@layout.latte similarity index 91% rename from CD-collection/app/templates/@layout.latte rename to CD-collection/app/presenters/templates/@layout.latte index d6baf03..5162179 100644 --- a/CD-collection/app/templates/@layout.latte +++ b/CD-collection/app/presenters/templates/@layout.latte @@ -27,6 +27,6 @@
Signed in as {$user->identity->realname}. Sign out
- +