Skip to content

Commit

Permalink
Fix(typehint) Fix PHP deprecations on Doctrine_Record_Filter::filterS…
Browse files Browse the repository at this point in the history
…et() and ::filterGet() and sub-classes
  • Loading branch information
thePanz committed Oct 28, 2024
1 parent 5c857c2 commit 5ffcb73
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
10 changes: 8 additions & 2 deletions lib/Doctrine/Record/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@
*/
abstract class Doctrine_Record_Filter
{
/**
* @var Doctrine_Table|null
*/
protected $_table;

public function setTable(Doctrine_Table $table)
{
$this->_table = $table;
}

/**
* @return Doctrine_Table|null
*/
public function getTable()
{
return $this->_table;
Expand All @@ -56,7 +62,7 @@ public function init()
*
* @return Doctrine_Record the given record
*
* @thrown Doctrine_Exception when this way is not available
* @throws Doctrine_Exception when this way is not available
*/
abstract public function filterSet(Doctrine_Record $record, $propertyOrRelation, $value);

Expand All @@ -67,7 +73,7 @@ abstract public function filterSet(Doctrine_Record $record, $propertyOrRelation,
*
* @return mixed
*
* @thrown Doctrine_Exception when this way is not available
* @throws Doctrine_Exception when this way is not available
*/
abstract public function filterGet(Doctrine_Record $record, $propertyOrRelation);
}
14 changes: 3 additions & 11 deletions lib/Doctrine/Record/Filter/Compound.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,9 @@ public function init()
}

/**
* Provides a way for setting property or relation value to the given record.
* @return Doctrine_Record
*
* @param string $propertyOrRelation
*
* @return Doctrine_Record the given record
*
* @thrown Doctrine_Record_UnknownPropertyException when this way is not available
* @throws Doctrine_Record_UnknownPropertyException
*/
public function filterSet(Doctrine_Record $record, $propertyOrRelation, $value)
{
Expand All @@ -90,13 +86,9 @@ public function filterSet(Doctrine_Record $record, $propertyOrRelation, $value)
}

/**
* Provides a way for getting property or relation value from the given record.
*
* @param string $propertyOrRelation
*
* @return mixed
*
* @thrown Doctrine_Record_UnknownPropertyException when this way is not available
* @throws Doctrine_Record_UnknownPropertyException
*/
public function filterGet(Doctrine_Record $record, $propertyOrRelation)
{
Expand Down
8 changes: 2 additions & 6 deletions lib/Doctrine/Record/Filter/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,15 @@
class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter
{
/**
* @param string $propertyOrRelation
*
* @thrown Doctrine_Record_UnknownPropertyException
* @return Doctrine_Record the given record
*/
public function filterSet(Doctrine_Record $record, $propertyOrRelation, $value)
{
throw new Doctrine_Record_UnknownPropertyException(sprintf('Unknown record property / related component "%s" on "%s"', $propertyOrRelation, get_class($record)));
}

/**
* @param string $propertyOrRelation
*
* @thrown Doctrine_Record_UnknownPropertyException
* @return mixed
*/
public function filterGet(Doctrine_Record $record, $propertyOrRelation)
{
Expand Down

0 comments on commit 5ffcb73

Please sign in to comment.