title: Resolving a callable into a variable without calling it
body: <p>I have a class which has a <code>$action</code> variable, which takes a callable as it's value. Normally, when initializing this value, I could do something like this:</p>
  
  <pre><code>$this-&gt;action = function() {
     echo "My function";
  }
  </code></pre>
  
  <p>I would then call the function by doing something like this:</p>
  
  <pre><code>$this-&gt;action();
  </code></pre>
  
  <p>The class itself looks like this:</p>
  
  <pre><code>&lt;?php
  
  /**
   * Resolves an non-callable action
   */
  class ActionResolver
  {
      private $action;
  
      /**
       * Action constructor.
       *
       * @param string $action
       */
      public function __construct($action)
      {
          $this-&gt;action = $action;
      }
  
      public function resolve()
      {
          $actionResolver = new ActionResolver();
          $results = ...
          $this-&gt;action = $actionResolver-&gt;resolveCallable($results);
      }
  
      /**
       * @return callable
       */
      public function getAction()
      {
          return $this-&gt;action;
      }
  }
  </code></pre>
  
  <p>In the <code>resolveCallable()</code> function, the action should be resolved by another object's method by the results of the <code>$results</code> variable. This method is in the <code>ActionResolver</code> class. The method looks like this:</p>
  
  <pre><code>public function resolveCallable(array $results)
  {
      $class = $results[0];
      $method = null;
      if (isset($results[1])) {
          $method = ...
      }
  
      $object = new $class;
      if (!is_null($method)) {
          return $class-&gt;$method();
      }
      return function() {};
  }
  </code></pre>
  
  <p>The method and class get's resolved by a string taken from the <code>$results</code> variable. The class and method name are both valid and work.</p>
  
  <p>When I try to call this, it returns the return value from the method, but not the method itself.</p>
  
  <p>How can I return the method itself instead of the contents of the method without calling it?</p>