public static function image() { return self::$image ?: (self::$image = new ImageType()); }
public function resolveType($object, Types $types) { if ($object instanceof User) { return Types::user(); } else { if ($object instanceof Image) { return Types::image(); } else { if ($object instanceof Story) { return Types::story(); } } } }