for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace GraphQL\Doctrine;
use GraphQL\Type\Definition\LeafType;
/**
* A few utils
*/
abstract class Utils
{
* Get the GraphQL type name for an output type from the PHP class
*
* @param string $className
* @return string
public static function getTypeName(string $className): string
$parts = explode('\\', $className);
return end($parts);
}
* Get the GraphQL type name for a Filter type from the PHP class
* @param LeafType $type
public static function getOperatorTypeName(string $className, LeafType $type): string
return preg_replace('~Type$~', '', self::getTypeName($className)) . ucfirst($type->name);
name
GraphQL\Type\Definition\LeafType
instanceof