for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace drupol\phpartition\Partition;
use drupol\phpartition\Contract\Valuable;
use drupol\phpartition\Contract\Weightable;
/**
* Class Partition.
*/
class Partition extends \ArrayObject implements Weightable
{
* @return array
public function exportArrayCopy()
return \array_map(
static function (Valuable $item) {
return $item->getValue();
},
$this->getArrayCopy()
);
}
* {@inheritdoc}
public function getWeight(): float
$weight = 0;
foreach ($this as $item) {
$weight += $item->getWeight();
return $weight;