Skip to content

Commit

Permalink
Removed nullable return from Table::getBehavior()
Browse files Browse the repository at this point in the history
  • Loading branch information
sdustinh committed Jan 17, 2018
1 parent a78591a commit e205eda
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/ORM/Table.php
Expand Up @@ -926,7 +926,7 @@ public function behaviors()
* Get a behavior from the registry.
*
* @param string $name The behavior alias to get from the registry.
* @return \Cake\ORM\Behavior|null
* @return \Cake\ORM\Behavior
*/
public function getBehavior($name)
{
Expand Down
3 changes: 0 additions & 3 deletions tests/TestCase/ORM/TableTest.php
Expand Up @@ -1795,10 +1795,7 @@ public function testGetBehavior()
{
$table = new Table(['table' => 'comments']);
$table->addBehavior('Sluggable');

$this->assertSame($table->behaviors()->get('Sluggable'), $table->getBehavior('Sluggable'));
$this->assertFalse($table->hasBehavior('FakeBehavior'));
$this->assertNull($table->getBehavior('FakeBehavior'));
}

/**
Expand Down

0 comments on commit e205eda

Please sign in to comment.