Collection > create trait (to make it more flexible)

This commit is contained in:
Meritoo
2019-03-16 12:37:35 +01:00
parent a021870ebd
commit 9f6af6b6a4
8 changed files with 356 additions and 252 deletions

View File

@@ -0,0 +1,26 @@
<?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\Traits\Collection;
/**
* Trait for the Collection required by Countable interface
*
* @author Meritoo <github@meritoo.pl>
* @copyright Meritoo <http://www.meritoo.pl>
*/
trait CountableTrait
{
/**
* {@inheritdoc}
*/
public function count()
{
return count($this->elements);
}
}