Skip to content

Commit

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

public function setTable(Doctrine_Table $table)
Expand All @@ -56,7 +59,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 +70,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);
}
18 changes: 0 additions & 18 deletions lib/Doctrine/Record/Filter/Compound.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ public function init()
}
}

/**
* Provides a way for setting property or relation value to the given record.
*
* @param string $propertyOrRelation
*
* @return Doctrine_Record the given record
*
* @thrown Doctrine_Record_UnknownPropertyException when this way is not available
*/
public function filterSet(Doctrine_Record $record, $propertyOrRelation, $value)
{
foreach ($this->_aliases as $alias) {
Expand All @@ -89,15 +80,6 @@ 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)));
}

/**
* 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
*/
public function filterGet(Doctrine_Record $record, $propertyOrRelation)
{
foreach ($this->_aliases as $alias) {
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/Record/Filter/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,11 @@
*/
class Doctrine_Record_Filter_Standard extends Doctrine_Record_Filter
{
/**
* @param string $propertyOrRelation
*
* @thrown Doctrine_Record_UnknownPropertyException
*/
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
*/
public function filterGet(Doctrine_Record $record, $propertyOrRelation)
{
throw new Doctrine_Record_UnknownPropertyException(sprintf('Unknown record property / related component "%s" on "%s"', $propertyOrRelation, get_class($record)));
Expand Down

0 comments on commit a9a1f10

Please sign in to comment.