mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
Arrays > getNonEmptyValuesAsString() method > returns non-empty values concatenated by given separator
45 lines
812 B
PHP
45 lines
812 B
PHP
<?php
|
|
|
|
/**
|
|
* (c) Meritoo.pl, http://www.meritoo.pl
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Meritoo\Common\Test\Utilities\Arrays;
|
|
|
|
/**
|
|
* Simple class convertible to string.
|
|
* Used for testing the Arrays class.
|
|
*
|
|
* @author Meritoo <github@meritoo.pl>
|
|
* @copyright Meritoo <http://www.meritoo.pl>
|
|
*/
|
|
class SimpleToString
|
|
{
|
|
/**
|
|
* Identifier
|
|
*
|
|
* @var string
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* Class constructor
|
|
*
|
|
* @param string $id Identifier
|
|
*/
|
|
public function __construct($id)
|
|
{
|
|
$this->id = $id;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function __toString()
|
|
{
|
|
return sprintf('Instance with ID: %s', $this->id);
|
|
}
|
|
}
|