Refactoring
This commit is contained in:
17
lib/composer/vendor/consolidation/output-formatters/tests/src/PropertyListWithCsvCells.php
vendored
Normal file
17
lib/composer/vendor/consolidation/output-formatters/tests/src/PropertyListWithCsvCells.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace Consolidation\TestUtils;
|
||||
|
||||
use Consolidation\OutputFormatters\Options\FormatterOptions;
|
||||
use Consolidation\OutputFormatters\StructuredData\PropertyList;
|
||||
use Consolidation\OutputFormatters\StructuredData\RenderCellInterface;
|
||||
|
||||
class PropertyListWithCsvCells extends PropertyList implements RenderCellInterface
|
||||
{
|
||||
public function renderCell($key, $cellData, FormatterOptions $options, $rowData)
|
||||
{
|
||||
if (is_array($cellData)) {
|
||||
return implode(',', $cellData);
|
||||
}
|
||||
return $cellData;
|
||||
}
|
||||
}
|
||||
17
lib/composer/vendor/consolidation/output-formatters/tests/src/RowsOfFieldsWithAlternatives.php
vendored
Normal file
17
lib/composer/vendor/consolidation/output-formatters/tests/src/RowsOfFieldsWithAlternatives.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace Consolidation\TestUtils;
|
||||
|
||||
use Consolidation\OutputFormatters\Options\FormatterOptions;
|
||||
use Consolidation\OutputFormatters\StructuredData\RowsOfFields;
|
||||
use Consolidation\OutputFormatters\StructuredData\RenderCellInterface;
|
||||
|
||||
class RowsOfFieldsWithAlternatives extends RowsOfFields implements RenderCellInterface
|
||||
{
|
||||
public function renderCell($key, $cellData, FormatterOptions $options, $rowData)
|
||||
{
|
||||
if (is_array($cellData)) {
|
||||
return implode('|', $cellData);
|
||||
}
|
||||
return $cellData;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user