Skip to content

Commit

Permalink
type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
mathsgod committed May 25, 2022
1 parent 33b3f8b commit dc74654
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Event/AfterDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class AfterDelete
{
public ModelInterface $target;
public $target;
public function __construct(ModelInterface $target)
{
$this->target = $target;
Expand Down
2 changes: 1 addition & 1 deletion src/Event/AfterUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class AfterUpdate
{
public ModelInterface $target;
public $target;
public function __construct(ModelInterface $target)
{
$this->target = $target;
Expand Down
2 changes: 1 addition & 1 deletion src/Event/BeforeDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class BeforeDelete
{
public ModelInterface $target;
public $target;
public function __construct(ModelInterface $target)
{
$this->target = $target;
Expand Down
4 changes: 3 additions & 1 deletion src/Event/BeforeInsert.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace R\DB\Event;

use R\DB\ModelInterface;

class BeforeInsert
{
public $target;
public function __construct($target)
public function __construct(ModelInterface $target)
{
$this->target = $target;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Event/BeforeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

namespace R\DB\Event;

use R\DB\ModelInterface;

class BeforeUpdate
{
public $target;
public function __construct($target)
public function __construct(ModelInterface $target)
{
$this->target = $target;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ function __set($name, $value)

function __isset($name)
{
return isset($this->_fields[$name]);
return array_key_exists($name, $this->_fields);

}
}

0 comments on commit dc74654

Please sign in to comment.