mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
61 lines
1.0 KiB
PHP
61 lines
1.0 KiB
PHP
--TEST--
|
|
GH-14480: Method visibility issue
|
|
--FILE--
|
|
<?php
|
|
trait PropertyHelperTrait
|
|
{
|
|
protected function splitPropertyParts(): void
|
|
{
|
|
echo "OK\n";
|
|
}
|
|
}
|
|
|
|
trait OrmPropertyHelperTrait
|
|
{
|
|
abstract protected function splitPropertyParts(): void;
|
|
|
|
protected function addJoinsForNestedProperty(): void
|
|
{
|
|
$this->splitPropertyParts();
|
|
}
|
|
}
|
|
|
|
trait SearchFilterTrait
|
|
{
|
|
use PropertyHelperTrait;
|
|
}
|
|
|
|
abstract class AbstractFilter
|
|
{
|
|
use OrmPropertyHelperTrait, PropertyHelperTrait;
|
|
|
|
public function apply(): void
|
|
{
|
|
$this->filterProperty();
|
|
}
|
|
|
|
abstract protected function filterProperty(): void;
|
|
}
|
|
|
|
class SearchFilter extends AbstractFilter
|
|
{
|
|
use SearchFilterTrait;
|
|
protected function filterProperty(): void
|
|
{
|
|
$this->addJoinsForNestedProperty();
|
|
}
|
|
}
|
|
|
|
class FilterExtension
|
|
{
|
|
public function applyToCollection(): void
|
|
{
|
|
(new SearchFilter())->apply();
|
|
}
|
|
}
|
|
|
|
(new FilterExtension)->applyToCollection();
|
|
?>
|
|
--EXPECT--
|
|
OK
|