graphql-php/tests/Executor/TestClasses/Adder.php

24 lines
412 B
PHP
Raw Permalink Normal View History

2018-09-01 18:07:06 +03:00
<?php
declare(strict_types=1);
namespace GraphQL\Tests\Executor\TestClasses;
class Adder
{
/** @var float */
public $num;
/** @var callable */
public $test;
public function __construct(float $num)
{
$this->num = $num;
2019-07-01 13:12:01 +03:00
$this->test = function ($objectValue, $args, $context) {
2018-09-01 18:07:06 +03:00
return $this->num + $args['addend1'] + $context['addend2'];
};
}
}