function ContrivedController::add

Same name in other branches
  1. 3.x modules/testing_example/src/Controller/ContrivedController.php \Drupal\testing_example\Controller\ContrivedController::add()
  2. 8.x-1.x 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 modules/testing_example/src/Controller/ContrivedController.php
Generate a message based on how many hands are needed to count the sum.

File

modules/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;
}