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:
Meritoo
2019-02-22 12:49:12 +01:00
parent 79c09a26a6
commit 292c5e6d4f
11 changed files with 481 additions and 10 deletions

View 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);
}
}