You are here

class Call in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Call/Call.php \Prophecy\Call\Call

Call object.

@author Konstantin Kudryashov <ever.zet@gmail.com>

Hierarchy

  • class \Prophecy\Call\Call

Expanded class hierarchy of Call

7 files declare their use of Call
CallbackPrediction.php in vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php
CallPrediction.php in vendor/phpspec/prophecy/src/Prophecy/Prediction/CallPrediction.php
CallTimesPrediction.php in vendor/phpspec/prophecy/src/Prophecy/Prediction/CallTimesPrediction.php
NoCallsPrediction.php in vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php
ObjectProphecy.php in vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php

... See full list

File

vendor/phpspec/prophecy/src/Prophecy/Call/Call.php, line 21

Namespace

Prophecy\Call
View source
class Call {
  private $methodName;
  private $arguments;
  private $returnValue;
  private $exception;
  private $file;
  private $line;

  /**
   * Initializes call.
   *
   * @param string      $methodName
   * @param array       $arguments
   * @param mixed       $returnValue
   * @param Exception   $exception
   * @param null|string $file
   * @param null|int    $line
   */
  public function __construct($methodName, array $arguments, $returnValue, Exception $exception = null, $file, $line) {
    $this->methodName = $methodName;
    $this->arguments = $arguments;
    $this->returnValue = $returnValue;
    $this->exception = $exception;
    if ($file) {
      $this->file = $file;
      $this->line = intval($line);
    }
  }

  /**
   * Returns called method name.
   *
   * @return string
   */
  public function getMethodName() {
    return $this->methodName;
  }

  /**
   * Returns called method arguments.
   *
   * @return array
   */
  public function getArguments() {
    return $this->arguments;
  }

  /**
   * Returns called method return value.
   *
   * @return null|mixed
   */
  public function getReturnValue() {
    return $this->returnValue;
  }

  /**
   * Returns exception that call thrown.
   *
   * @return null|Exception
   */
  public function getException() {
    return $this->exception;
  }

  /**
   * Returns callee filename.
   *
   * @return string
   */
  public function getFile() {
    return $this->file;
  }

  /**
   * Returns callee line number.
   *
   * @return int
   */
  public function getLine() {
    return $this->line;
  }

  /**
   * Returns short notation for callee place.
   *
   * @return string
   */
  public function getCallPlace() {
    if (null === $this->file) {
      return 'unknown';
    }
    return sprintf('%s:%d', $this->file, $this->line);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Call::$arguments private property
Call::$exception private property
Call::$file private property
Call::$line private property
Call::$methodName private property
Call::$returnValue private property
Call::getArguments public function Returns called method arguments.
Call::getCallPlace public function Returns short notation for callee place.
Call::getException public function Returns exception that call thrown.
Call::getFile public function Returns callee filename.
Call::getLine public function Returns callee line number.
Call::getMethodName public function Returns called method name.
Call::getReturnValue public function Returns called method return value.
Call::__construct public function Initializes call.