1<?php 2 3/* 4 * This file is part of the Prophecy. 5 * (c) Konstantin Kudryashov <ever.zet@gmail.com> 6 * Marcello Duarte <marcello.duarte@gmail.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Prophecy\Prophecy; 13 14/** 15 * Basic prophecies revealer. 16 * 17 * @author Konstantin Kudryashov <ever.zet@gmail.com> 18 */ 19class Revealer implements RevealerInterface 20{ 21 /** 22 * Unwraps value(s). 23 * 24 * @param mixed $value 25 * 26 * @return mixed 27 */ 28 public function reveal($value) 29 { 30 if (is_array($value)) { 31 return array_map(array($this, __FUNCTION__), $value); 32 } 33 34 if (!is_object($value)) { 35 return $value; 36 } 37 38 if ($value instanceof ProphecyInterface) { 39 $value = $value->reveal(); 40 } 41 42 return $value; 43 } 44} 45