Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ClassCodeGenerator.php

function ClassCodeGenerator::generateMethod

1 call to ClassCodeGenerator::generateMethod()
ClassCodeGenerator::generate in vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php
Generates PHP code for class node.

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCodeGenerator.php, line 64

Class

ClassCodeGenerator
Class code creator. Generates PHP code for specific class node tree.

Namespace

Prophecy\Doubler\Generator

Code

private function generateMethod(Node\MethodNode $method) : string {
    $php = sprintf("%s %s function %s%s(%s)%s {\n", $method->getVisibility(), $method->isStatic() ? 'static' : '', $method->returnsReference() ? '&' : '', $method->getName(), implode(', ', $this->generateArguments($method->getArguments())), ($ret = $this->generateTypes($method->getReturnTypeNode())) ? ': ' . $ret : '');
    $php .= $method->getCode() . "\n";
    return $php . '}';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal