Skip to content

Commit

Permalink
Nette: added missing docblocks, unified php file headings
Browse files Browse the repository at this point in the history
  • Loading branch information
klimesf committed Nov 19, 2015
1 parent 864cf93 commit 4b8a075
Show file tree
Hide file tree
Showing 27 changed files with 98 additions and 30 deletions.
1 change: 0 additions & 1 deletion nette/notejam/app/components/Notes/INotesFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Components\Notes;

use Nette\Database\Table\Selection;
Expand Down
2 changes: 0 additions & 2 deletions nette/notejam/app/components/Notes/Notes.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php


namespace App\Components\Notes;


use Nette;
use Nette\Database\Table\Selection;

Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/components/Pads/IPadsFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Components\Pads;


Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/components/Pads/Pads.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Components\Pads;

use Nette\Application\UI\Control;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/components/UserBar/IUserBarFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Components\UserBar;


Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/components/UserBar/UserBar.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Components\UserBar;

use Nette;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Account;

use App\Model\CurrentPasswordMismatch;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Note/DeleteNoteFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Note;

use App\Model\NoteManager;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Note/EditNoteFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Note;

use App\Model\NoteManager;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Note/NewNoteFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Note;

use App\Model\NoteManager;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Pad/DeletePadFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Pad;

use Nette;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Pad/EditPadFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Pad;

use Nette;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Pad/NewPadFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Pad;

use Nette;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Sign;

use App\Model\UserManager;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/forms/Sign/SignUpFormFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Forms\Sign;

use App\Model\DuplicateNameException;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/helpers/OrderHelper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Helpers;


Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/model/NoteManager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Model;

use Nette;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/model/PadManager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Model;

use Nette;
Expand Down
1 change: 0 additions & 1 deletion nette/notejam/app/model/UserManager.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Model;

use Nette;
Expand Down
2 changes: 0 additions & 2 deletions nette/notejam/app/presenters/AccountPresenter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Presenters;

use Nette;
Expand All @@ -13,7 +12,6 @@ class AccountPresenter extends BasePresenter
/** @var AccountSettingsFormFactory @inject */
public $formFactory;


/**
* Sign-in form factory.
* @return Nette\Application\UI\Form
Expand Down
3 changes: 3 additions & 0 deletions nette/notejam/app/presenters/Error4xxPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
class Error4xxPresenter extends BasePresenter
{

/**
* @param \Exception $exception
*/
public function renderDefault(\Exception $exception)
{
// load template 403.latte or 404.latte or ... 4xx.latte
Expand Down
7 changes: 5 additions & 2 deletions nette/notejam/app/presenters/ErrorPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@

class ErrorPresenter extends Nette\Object implements Nette\Application\IPresenter
{

/** @var ILogger */
private $logger;


/**
* ErrorPresenter constructor.
* @param ILogger $logger
*/
public function __construct(ILogger $logger)
{
$this->logger = $logger;
}


/**
* @return Nette\Application\IResponse
*/
Expand Down
12 changes: 12 additions & 0 deletions nette/notejam/app/presenters/HomepagePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class HomepagePresenter extends SecuredBasePresenter
/** @var object[] */
protected $notes;


/********************* Controls ***********************************************************************************/

/**
* @return \App\Components\Notes\Notes
*/
Expand All @@ -28,6 +31,12 @@ protected function createComponentNotes()
return $this->notesFactory->create($this->notes);
}

/********************* Actions ************************************************************************************/

/**
* Homepage:default.
* @param string $order
*/
public function actionDefault($order)
{
$this->notes = $this->noteManager->findAll();
Expand All @@ -36,6 +45,9 @@ public function actionDefault($order)
}
}

/**
* Homepage:default render.
*/
public function renderDefault()
{
$this->template->notes = $this->notes;
Expand Down
35 changes: 33 additions & 2 deletions nette/notejam/app/presenters/NotePresenter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Presenters;

use App\Forms\Note\DeleteNoteFormFactory;
Expand Down Expand Up @@ -43,6 +42,9 @@ class NotePresenter extends SecuredBasePresenter
/** @var object[] */
private $notes;


/********************* Controls ***********************************************************************************/

/**
* @return \Nette\Application\UI\Form
*/
Expand Down Expand Up @@ -97,44 +99,74 @@ protected function createComponentNewNoteForm()
return $form;
}

/********************* Actions ************************************************************************************/

/**
* Note:default.
* @param int $id
* @throws BadRequestException
*/
public function actionDefault($id)
{
$this->loadNote($id);
$this->notes = $this->noteManager->findByPad($id);
}

/**
* Note:default render.
*/
public function renderDefault()
{
$this->template->note = $this->note;
}

/**
* Note:edit.
* @param int $id
* @throws BadRequestException
*/
public function actionEdit($id)
{
$this->loadNote($id);
}

/**
* Note:edit render.
*/
public function renderEdit()
{
$this->template->note = $this->note;
}

/**
* Note:delete.
* @param int $id
* @throws BadRequestException
*/
public function actionDelete($id)
{
$this->loadNote($id);
}

/**
* Note:delete render.
*/
public function renderDelete()
{
$this->template->note = $this->note;
}

/**
* Note:new.
* @param int $pad
*/
public function actionNew($pad)
{
$this->padId = $pad;
}

/**
* Loads note with given id and if not found, throws BadRequestException.
* @param int $id
* @throws BadRequestException
*/
Expand All @@ -147,5 +179,4 @@ private function loadNote($id)
}
}


}
31 changes: 30 additions & 1 deletion nette/notejam/app/presenters/PadPresenter.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace App\Presenters;

use App\Components\Notes\INotesFactory;
Expand Down Expand Up @@ -43,6 +42,8 @@ class PadPresenter extends SecuredBasePresenter
/** @var object[] */
private $notes;

/********************* Controls ***********************************************************************************/

/**
* @return \Nette\Application\UI\Form
*/
Expand Down Expand Up @@ -106,6 +107,14 @@ protected function createComponentNotes()
}


/********************* Actions ************************************************************************************/

/**
* Pad:default.
* @param int $id
* @param string|null $order
* @throws BadRequestException
*/
public function actionDefault($id, $order)
{
$this->loadPad($id);
Expand All @@ -115,32 +124,52 @@ public function actionDefault($id, $order)
}
}

/**
* Pad:default render.
*/
public function renderDefault()
{
$this->template->pad = $this->pad;
}

/**
* Pad:edit.
* @param int $id
* @throws BadRequestException
*/
public function actionEdit($id)
{
$this->loadPad($id);
}

/**
* Pad:edit render.
*/
public function renderEdit()
{
$this->template->pad = $this->pad;
}

/**
* Pad:delete.
* @param int $id
* @throws BadRequestException
*/
public function actionDelete($id)
{
$this->loadPad($id);
}

/**
* Pad:delete render.
*/
public function renderDelete()
{
$this->template->pad = $this->pad;
}

/**
* Loads pad with given id and if not found, throws BadRequestException.
* @param int $id
* @throws BadRequestException
*/
Expand Down
Loading

0 comments on commit 4b8a075

Please sign in to comment.