use shorter get_class_vars for dump method

master
Jean-Christian Paul Denis 2023-04-24 13:16:19 +02:00
parent 3d404671e8
commit 1c882964be
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
2 changed files with 7 additions and 16 deletions

View File

@ -57,13 +57,6 @@ class ActionDescriptor
*/
public function dump(): array
{
return [
'id' => $this->id,
'ns' => $this->ns,
'select' => $this->select,
'query' => $this->query,
'success' => $this->success,
'error' => $this->error,
];
return get_class_vars(__CLASS__) ?: [];
}
}

View File

@ -15,7 +15,10 @@ declare(strict_types=1);
namespace Dotclear\Plugin\Uninstaller;
/**
* Cleaner value descriptor
* Cleaner value descriptor.
*
* Description of a value from AbstractCleaner::value()
* and AbstractCleaner::related()
*/
class ValueDescriptor
{
@ -30,21 +33,16 @@ class ValueDescriptor
public readonly string $ns,
public readonly string $id,
public readonly int $count,
) {
}
/**
* Get descriptor properties.
*
* @return array<string,string> The properties
* @return array<string,mixed> The properties
*/
public function dump(): array
{
return [
'ns' => $this->ns,
'id' => $this->id,
'count' => $this->count,
];
return get_class_vars(__CLASS__) ?: [];
}
}