Skip to content

Commit

Permalink
composer.phar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mfn committed Nov 5, 2019
1 parent f68bcd5 commit 361b4cd
Show file tree
Hide file tree
Showing 34 changed files with 75 additions and 75 deletions.
4 changes: 2 additions & 2 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// 'mutation' => '\Rebing\GraphQL\GraphQLController@mutation'
// ]
//
'controllers' => \Rebing\GraphQL\GraphQLController::class . '@query',
'controllers' => \Rebing\GraphQL\GraphQLController::class.'@query',

// Any middleware for the graphql route group
'middleware' => [],
Expand Down Expand Up @@ -174,7 +174,7 @@
*/
'graphiql' => [
'prefix' => '/graphiql',
'controller' => \Rebing\GraphQL\GraphQLController::class . '@graphiql',
'controller' => \Rebing\GraphQL\GraphQLController::class.'@graphiql',
'middleware' => [],
'view' => 'graphql::graphiql',
'display' => env('ENABLE_GRAPHIQL', true),
Expand Down
4 changes: 2 additions & 2 deletions src/Console/EnumMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class EnumMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/enum.stub';
return __DIR__.'/stubs/enum.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Enums';
return $rootNamespace.'\GraphQL\Enums';
}

protected function buildClass($name)
Expand Down
4 changes: 2 additions & 2 deletions src/Console/FieldMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class FieldMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/field.stub';
return __DIR__.'/stubs/field.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Fields';
return $rootNamespace.'\GraphQL\Fields';
}
}
4 changes: 2 additions & 2 deletions src/Console/InputMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class InputMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/input.stub';
return __DIR__.'/stubs/input.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Inputs';
return $rootNamespace.'\GraphQL\Inputs';
}

protected function buildClass($name)
Expand Down
4 changes: 2 additions & 2 deletions src/Console/InterfaceMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class InterfaceMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/interface.stub';
return __DIR__.'/stubs/interface.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Interfaces';
return $rootNamespace.'\GraphQL\Interfaces';
}

protected function buildClass($name)
Expand Down
4 changes: 2 additions & 2 deletions src/Console/MutationMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class MutationMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/mutation.stub';
return __DIR__.'/stubs/mutation.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Mutations';
return $rootNamespace.'\GraphQL\Mutations';
}

protected function buildClass($name)
Expand Down
6 changes: 3 additions & 3 deletions src/Console/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public function __construct(Filesystem $files)
parent::__construct();
$this->files = $files;

$fromPath = __DIR__ . '/../..';
$fromPath = __DIR__.'/../..';
$this->fileMap = [
$fromPath . '/config/config.php' => app()->basePath('config/graphql.php'),
$fromPath . '/resources/views/graphiql.php' => app()->basePath('resources/views/vendor/graphql/graphiql.php'),
$fromPath.'/config/config.php' => app()->basePath('config/graphql.php'),
$fromPath.'/resources/views/graphiql.php' => app()->basePath('resources/views/vendor/graphql/graphiql.php'),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Console/QueryMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class QueryMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/query.stub';
return __DIR__.'/stubs/query.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Queries';
return $rootNamespace.'\GraphQL\Queries';
}

protected function buildClass($name)
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ScalarMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class ScalarMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/scalar.stub';
return __DIR__.'/stubs/scalar.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Scalars';
return $rootNamespace.'\GraphQL\Scalars';
}
}
4 changes: 2 additions & 2 deletions src/Console/TypeMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class TypeMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/type.stub';
return __DIR__.'/stubs/type.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Types';
return $rootNamespace.'\GraphQL\Types';
}

protected function buildClass($name)
Expand Down
4 changes: 2 additions & 2 deletions src/Console/UnionMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class UnionMakeCommand extends GeneratorCommand

protected function getStub()
{
return __DIR__ . '/stubs/union.stub';
return __DIR__.'/stubs/union.stub';
}

protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\GraphQL\Unions';
return $rootNamespace.'\GraphQL\Unions';
}

protected function buildClass($name)
Expand Down
12 changes: 6 additions & 6 deletions src/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ protected function clearTypeInstances(): void

public function paginate(string $typeName, string $customName = null): Type
{
$name = $customName ?: $typeName . 'Pagination';
$name = $customName ?: $typeName.'Pagination';

if (! isset($this->typesInstances[$name])) {
$paginationType = config('graphql.pagination_type', PaginationType::class);
Expand Down Expand Up @@ -374,7 +374,7 @@ public function wrapType(string $typeName, string $customTypeName, string $wrapp
* @param Error $e
* @return array
*/
public static function formatError(Error $e): array
public static function formatError(PhpError $e): array
{
$debug = config('app.debug') ? (Debug::INCLUDE_DEBUG_MESSAGE | Debug::INCLUDE_TRACE) : 0;
$formatter = FormattedError::prepareFormatter(null, $debug);
Expand Down Expand Up @@ -444,14 +444,14 @@ public static function routeNameTransformer(string $name, string $schemaParamete
}

foreach ($multiLevelPath as $multiName) {
$routeName = ! $routeName ? null : $routeName . '/';
$routeName = ! $routeName ? null : $routeName.'/';
$routeName =
$routeName
. preg_replace($schemaParameterPattern, '{' . $multiName . '}', $queryRoute);
.preg_replace($schemaParameterPattern, '{'.$multiName.'}', $queryRoute);
}
}

return $routeName ?: preg_replace($schemaParameterPattern, '{' . (Helpers::isLumen() ? "$name:$name" : $name) . '}', $queryRoute);
return $routeName ?: preg_replace($schemaParameterPattern, '{'.(Helpers::isLumen() ? "$name:$name" : $name).'}', $queryRoute);
}

/**
Expand All @@ -463,7 +463,7 @@ protected function getSchemaConfiguration($schema)
$schemaName = is_string($schema) ? $schema : config('graphql.default_schema', 'default');

if (! is_array($schema) && ! isset($this->schemas[$schemaName])) {
throw new SchemaNotFound('Type ' . $schemaName . ' not found.');
throw new SchemaNotFound('Type '.$schemaName.' not found.');
}

return is_array($schema) ? $schema : $this->schemas[$schemaName];
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ protected function queryContext(string $query, ?array $params, string $schema)

public function graphiql(Request $request, string $schema = null): View
{
$graphqlPath = '/' . config('graphql.prefix');
$graphqlPath = '/'.config('graphql.prefix');
if ($schema) {
$graphqlPath .= '/' . $schema;
$graphqlPath .= '/'.$schema;
}

$view = config('graphql.graphiql.view', 'graphql::graphiql');
Expand Down
6 changes: 3 additions & 3 deletions src/GraphQLLumenServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class GraphQLLumenServiceProvider extends GraphQLServiceProvider
{
protected function bootPublishes(): void
{
$configPath = __DIR__ . '/../config';
$configPath = __DIR__.'/../config';

$this->mergeConfigFrom($configPath . '/config.php', 'graphql');
$this->mergeConfigFrom($configPath.'/config.php', 'graphql');

$viewsPath = __DIR__ . '/../resources/views';
$viewsPath = __DIR__.'/../resources/views';
$this->loadViewsFrom($viewsPath, 'graphql');
}

Expand Down
10 changes: 5 additions & 5 deletions src/GraphQLServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function boot(): void
protected function bootRouter(): void
{
if (config('graphql.routes')) {
include __DIR__ . '/routes.php';
include __DIR__.'/routes.php';
}
}

Expand All @@ -53,15 +53,15 @@ protected function bootRouter(): void
*/
protected function bootPublishes(): void
{
$configPath = __DIR__ . '/../config';
$configPath = __DIR__.'/../config';

$this->mergeConfigFrom($configPath . '/config.php', 'graphql');
$this->mergeConfigFrom($configPath.'/config.php', 'graphql');

$this->publishes([
$configPath . '/config.php' => config_path('graphql.php'),
$configPath.'/config.php' => config_path('graphql.php'),
], 'config');

$viewsPath = __DIR__ . '/../resources/views';
$viewsPath = __DIR__.'/../resources/views';
$this->loadViewsFrom($viewsPath, 'graphql');
}

Expand Down
2 changes: 1 addition & 1 deletion src/GraphQLUploadMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private function validateParsedBody(Request $request): void

if (! is_array($bodyParams)) {
throw new RequestError(
'GraphQL Server expects JSON object or array, but got ' . Utils::printSafeJson($bodyParams)
'GraphQL Server expects JSON object or array, but got '.Utils::printSafeJson($bodyParams)
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Support/PaginationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PaginationType extends ObjectType
{
public function __construct(string $typeName, string $customName = null)
{
$name = $customName ?: $typeName . 'Pagination';
$name = $customName ?: $typeName.'Pagination';

$config = [
'name' => $name,
Expand Down
8 changes: 4 additions & 4 deletions src/Support/SelectFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static function getSelectableFieldsAndRelations(

// If a primary key is given, but not in the selects, add it
if (null !== $primaryKey) {
$primaryKey = $parentTable ? ($parentTable . '.' . $primaryKey) : $primaryKey;
$primaryKey = $parentTable ? ($parentTable.'.'.$primaryKey) : $primaryKey;
if (! in_array($primaryKey, $select)) {
$select[] = $primaryKey;
}
Expand Down Expand Up @@ -189,11 +189,11 @@ protected static function handleFields(
$foreignKey = $relation->getQualifiedForeignKeyName();
}

$foreignKey = $parentTable ? ($parentTable . '.' . preg_replace('/^' . preg_quote($parentTable, '/') . '\./', '', $foreignKey)) : $foreignKey;
$foreignKey = $parentTable ? ($parentTable.'.'.preg_replace('/^'.preg_quote($parentTable, '/').'\./', '', $foreignKey)) : $foreignKey;

if (is_a($relation, MorphTo::class)) {
$foreignKeyType = $relation->getMorphType();
$foreignKeyType = $parentTable ? ($parentTable . '.' . $foreignKeyType) : $foreignKeyType;
$foreignKeyType = $parentTable ? ($parentTable.'.'.$foreignKeyType) : $foreignKeyType;

if (! in_array($foreignKey, $select)) {
$select[] = $foreignKey;
Expand Down Expand Up @@ -373,7 +373,7 @@ protected static function addFieldToSelect($field, array &$select, ?string $pare
'fields' => true,
];
} elseif (! $forRelation && ! in_array($field, $select)) {
$field = $parentTable ? ($parentTable . '.' . $field) : $field;
$field = $parentTable ? ($parentTable.'.'.$field) : $field;
if (! in_array($field, $select)) {
$select[] = $field;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function getFieldResolver(string $name, array $field): ?callable
return $field['resolve'];
}

$resolveMethod = 'resolve' . Str::studly($name) . 'Field';
$resolveMethod = 'resolve'.Str::studly($name).'Field';

if (method_exists($this, $resolveMethod)) {
$resolver = [$this, $resolveMethod];
Expand Down
2 changes: 1 addition & 1 deletion src/Support/UploadType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function parseValue($value)
*/
public function parseLiteral($valueNode, ?array $variables = null)
{
throw new Error('`Upload` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification. Instead got: ' . $valueNode->kind, [$valueNode]);
throw new Error('`Upload` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification. Instead got: '.$valueNode->kind, [$valueNode]);
}

public function toType(): Type
Expand Down
12 changes: 6 additions & 6 deletions src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

// Controllers
$controllers = config('graphql.controllers', GraphQLController::class . '@query');
$controllers = config('graphql.controllers', GraphQLController::class.'@query');
$queryController = null;
$mutationController = null;
if (is_array($controllers)) {
Expand All @@ -42,8 +42,8 @@
// Query
if ($queryRoute) {
if (preg_match($schemaParameterPattern, $queryRoute)) {
$defaultMiddleware = config('graphql.schemas.' . config('graphql.default_schema') . '.middleware', []);
$defaultMethod = config('graphql.schemas.' . config('graphql.default_schema') . '.method', ['get', 'post']);
$defaultMiddleware = config('graphql.schemas.'.config('graphql.default_schema').'.middleware', []);
$defaultMethod = config('graphql.schemas.'.config('graphql.default_schema').'.method', ['get', 'post']);

foreach ($defaultMethod as $method) {
$routeName = 'graphql.query';
Expand Down Expand Up @@ -95,8 +95,8 @@
// Mutation routes (define only if different than query)
if ($mutationRoute && $mutationRoute !== $queryRoute) {
if (preg_match($schemaParameterPattern, $mutationRoute)) {
$defaultMiddleware = config('graphql.schemas.' . config('graphql.default_schema') . '.middleware', []);
$defaultMethod = config('graphql.schemas.' . config('graphql.default_schema') . '.method', ['get', 'post']);
$defaultMiddleware = config('graphql.schemas.'.config('graphql.default_schema').'.middleware', []);
$defaultMethod = config('graphql.schemas.'.config('graphql.default_schema').'.method', ['get', 'post']);

foreach ($defaultMethod as $method) {
$routeName = 'graphql.mutation';
Expand Down Expand Up @@ -152,7 +152,7 @@
'middleware' => config('graphql.graphiql.middleware', []),
], function ($router): void {
/** @var \Illuminate\Routing\Router|\Laravel\Lumen\Routing\Router $router */
$graphiqlController = config('graphql.graphiql.controller', GraphQLController::class . '@graphiql');
$graphiqlController = config('graphql.graphiql.controller', GraphQLController::class.'@graphiql');
$schemaParameterPattern = '/\{\s*graphql\_schema\s*\?\s*\}/';
$graphiqlAction = ['uses' => $graphiqlController];

Expand Down
2 changes: 1 addition & 1 deletion tests/Database/AuthorizeArgsTests/AuthorizeArgsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function getEnvironmentSetUp($app)
{
parent::getEnvironmentSetUp($app);

$app['config']->set('graphql.controllers', GraphQLController::class . '@query');
$app['config']->set('graphql.controllers', GraphQLController::class.'@query');

$app['config']->set('graphql.schemas.default', [
'query' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ protected function getEnvironmentSetUp($app)
{
parent::getEnvironmentSetUp($app);

$app['config']->set('graphql.controllers', GraphQLController::class . '@query');
$app['config']->set('graphql.controllers', GraphQLController::class.'@query');

$app['config']->set('graphql.schemas.default', [
'query' => [
Expand Down
Loading

0 comments on commit 361b4cd

Please sign in to comment.