Skip to content
Permalink
Browse files

Allow more IDE detectability. Fix invalid doc blocks.

  • Loading branch information...
dereuromark committed May 18, 2017
1 parent 18f68aa commit 11cfe3c500683907447829ac1dd318a7d2365e3d
@@ -85,7 +85,7 @@ public function bindValue($column, $value, $type = 'string')
* ```
*
* @param string $type 'num' for positional columns, assoc for named columns
* @return mixed Result array containing columns and values or false if no results
* @return array|false Result array containing columns and values or false if no results
* are left
*/
public function fetch($type = 'num')
@@ -393,7 +393,7 @@ public function formatResults(callable $formatter = null, $mode = 0)
* $singleUser = $query->select(['id', 'username'])->first();
* ```
*
* @return mixed the first result from the ResultSet
* @return \Cake\Datasource\EntityInterface|null The first result from the ResultSet.
*/
public function first()
{
@@ -408,18 +408,19 @@ public function first()
* Get the first result from the executing query or raise an exception.
*
* @throws \Cake\Datasource\Exception\RecordNotFoundException When there is no first record.
* @return mixed The first result from the ResultSet.
* @return \Cake\Datasource\EntityInterface The first result from the ResultSet.
*/
public function firstOrFail()
{
$entity = $this->first();
if ($entity) {
return $entity;
if (!$entity) {
throw new RecordNotFoundException(sprintf(
'Record not found in table "%s"',
$this->repository()->table()
));
}
throw new RecordNotFoundException(sprintf(
'Record not found in table "%s"',
$this->repository()->table()
));
return $entity;
}
/**
@@ -40,6 +40,12 @@
*
* Automatic generation of HTML FORMs from given data.
*
* @method string text($fieldName, array $options = [])
* @method string number($fieldName, array $options = [])
* @method string email($fieldName, array $options = [])
* @method string password($fieldName, array $options = [])
* @method string search($fieldName, array $options = [])
*
* @property \Cake\View\Helper\HtmlHelper $Html
* @property \Cake\View\Helper\UrlHelper $Url
* @link http://book.cakephp.org/3.0/en/views/helpers/form.html
@@ -2654,7 +2660,7 @@ public function addContextProvider($type, callable $check)
* If there is no active form null will be returned.
*
* @param \Cake\View\Form\ContextInterface|null $context Either the new context when setting, or null to get.
* @return null|\Cake\View\Form\ContextInterface The context for the form.
* @return \Cake\View\Form\ContextInterface The context for the form.
*/
public function context($context = null)
{
@@ -2671,7 +2677,7 @@ public function context($context = null)
* If no type can be matched a NullContext will be returned.
*
* @param mixed $data The data to get a context provider for.
* @return mixed Context provider.
* @return \Cake\View\Form\ContextInterface Context provider.
* @throws \RuntimeException when the context class does not implement the
* ContextInterface.
*/
@@ -109,6 +109,7 @@ public function initialize(array $config)
* FormHelperTest class
*
* @property \Cake\View\Helper\FormHelper $Form
* @property \Cake\View\View $View
*/
class FormHelperTest extends TestCase
{
@@ -127,6 +128,11 @@ class FormHelperTest extends TestCase
*/
public $autoFixtures = false;
/**
* @var array
*/
protected $article = [];
/**
* setUp method
*
@@ -8459,7 +8465,7 @@ public function testResetTemplates()
$this->Form->templates(['input' => '<input/>']);
$this->assertEquals('<input/>', $this->Form->templater()->get('input'));
$this->assertNull($this->Form->resetTemplates());
$this->Form->resetTemplates();
$this->assertNotEquals('<input/>', $this->Form->templater()->get('input'));
}

0 comments on commit 11cfe3c

Please sign in to comment.
You can’t perform that action at this time.