You are here

protected function ContrivedController::add in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/testing_example/src/Controller/ContrivedController.php \Drupal\testing_example\Controller\ContrivedController::add()

Add two numbers.

Parameters

int $first: The first parameter.

int $second: The second parameter.

Return value

int The sum of the two parameters.

1 call to ContrivedController::add()
ContrivedController::handCount in testing_example/src/Controller/ContrivedController.php
Generate a message based on how many hands are needed to count the sum.

File

testing_example/src/Controller/ContrivedController.php, line 89

Class

ContrivedController
A highly-contrived controller class used to demonstrate unit testing.

Namespace

Drupal\testing_example\Controller

Code

protected function add($first, $second) {
  return $first + $second;
}