<?php
namespace App\Bsp\Settlement;

/**
 * Common comparison result methods
 * @author Lucian Sirbu
 */
trait CompareResultTrait
{
	/**
	 * Check if any differences are present
	 * @return boolean
	 */
	public function hasDifferences()
	{
		return (bool)$this->details;

		// NOTE: I suppose this should work better, but some tests are failing, so I'll leave it like this for now
		// return (bool)array_filter($this->details, function($item) {
		// 	return $item!='identical';
		// });

	}

	/**
	 * Check if a certain status is present
	 * @return boolean
	 */
	public function hasStatusRaw($status)
	{
		return (bool)in_array($status, $this->details);
	}
}
