mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 01:31:45 +01:00
Arrays > getNonEmptyValues() method > returns non-empty values, e.g. without "" (empty string), null or []
Arrays > getNonEmptyValuesAsString() method > returns non-empty values concatenated by given separator
This commit is contained in:
44
tests/Utilities/Arrays/SimpleToString.php
Normal file
44
tests/Utilities/Arrays/SimpleToString.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user