-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from fsevestre/173-chainable-filter
- Loading branch information
Showing
7 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace DeepCopy\f013; | ||
|
||
use Doctrine\Persistence\Proxy; | ||
|
||
class A implements Proxy | ||
{ | ||
public $foo = 1; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function __load() | ||
{ | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function __isInitialized() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace DeepCopy\f013; | ||
|
||
use Doctrine\Persistence\Proxy; | ||
|
||
class B implements Proxy | ||
{ | ||
private $foo; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function __load() | ||
{ | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function __isInitialized() | ||
{ | ||
} | ||
|
||
public function getFoo() | ||
{ | ||
return $this->foo; | ||
} | ||
|
||
public function setFoo($foo) | ||
{ | ||
$this->foo = $foo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace DeepCopy\f013; | ||
|
||
class C | ||
{ | ||
public $foo = 1; | ||
|
||
public function __clone() | ||
{ | ||
$this->foo = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace DeepCopy\Filter; | ||
|
||
/** | ||
* Defines a decorator filter that will not stop the chain of filters. | ||
*/ | ||
class ChainableFilter implements Filter | ||
{ | ||
/** | ||
* @var Filter | ||
*/ | ||
protected $filter; | ||
|
||
public function __construct(Filter $filter) | ||
{ | ||
$this->filter = $filter; | ||
} | ||
|
||
public function apply($object, $property, $objectCopier) | ||
{ | ||
$this->filter->apply($object, $property, $objectCopier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters