for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TheCodingMachine\GraphQL\Controllers\Fixtures;
use TheCodingMachine\GraphQL\Controllers\Annotations\Logged;
use TheCodingMachine\GraphQL\Controllers\Annotations\Mutation;
use TheCodingMachine\GraphQL\Controllers\Annotations\Query;
use TheCodingMachine\GraphQL\Controllers\Annotations\Right;
class TestController
{
/**
* @Query
* @param int $int
* @param null|string $string
* @param TestObject[] $list
* @return TestObject
*/
public function test(int $int, ?string $string, array $list): TestObject
$str = '';
foreach ($list as $test) {
if (!$test instanceof TestObject) {
throw new \RuntimeException('TestObject instance expected.');
}
$str .= $test->getTest();
return new TestObject($string.$int.$str);
* @Mutation
* @param TestObject $testObject
public function mutation(TestObject $testObject): TestObject
return $testObject;
* @Logged
public function testLogged(): TestObject
return new TestObject('foo');
* @Right(name="CAN_FOO")
public function testRight(): TestObject