Skip to content

Commit

Permalink
Improve formatting of _lighthouse_ide_helper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored Aug 23, 2024
1 parent cfb7ad3 commit 39f86b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ You can find and compare releases at the [GitHub release page](https://github.co

## Unreleased

## v6.43.1

### Changed

- Improve formatting of `_lighthouse_ide_helper.php` https://github.com/nuwave/lighthouse/pull/2604

## v6.43.0

### Added
Expand Down
6 changes: 3 additions & 3 deletions src/Console/IdeHelperCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

class IdeHelperCommand extends Command
{
public const OPENING_PHP_TAG = /** @lang GraphQL */ "<?php\n";
public const OPENING_PHP_TAG = /** @lang PHP */ "<?php declare(strict_types=1);\n\n";

public const GENERATED_NOTICE = /** @lang GraphQL */ <<<'GRAPHQL'
public const GENERATED_NOTICE = /** @lang PHP|GraphQL */ <<<'CODE'
# File generated by "php artisan lighthouse:ide-helper".
# Do not edit this file directly.
# This file should be ignored by git as it can be autogenerated.


GRAPHQL;
CODE;

protected $name = 'lighthouse:ide-helper';

Expand Down
18 changes: 5 additions & 13 deletions tests/Console/IdeHelperCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ protected function getEnvironmentSetUp($app): void

$config = $app->make(ConfigRepository::class);
$config->set('lighthouse.namespaces.directives', [
// Contains an overwritten UnionDirective
'Tests\\Console',
// We need to ensure this does not throw an error
'Empty\\Because\\The\\User\\Has\\Not\\Created\\Custom\\Directives\\Yet',
'Tests\\Console', // Contains an overwritten UnionDirective
'Empty\\Because\\The\\User\\Has\\Not\\Created\\Custom\\Directives\\Yet', // We need to ensure this does not throw an error
]);
}

Expand All @@ -42,9 +40,7 @@ public function testGeneratesIdeHelperFiles(): void

$this->artisan('lighthouse:ide-helper');

/*
* Schema directives
*/
// Schema directives

$schemaDirectives = \Safe\file_get_contents(IdeHelperCommand::schemaDirectivesPath());

Expand All @@ -64,9 +60,7 @@ public function testGeneratesIdeHelperFiles(): void
);
$this->assertStringContainsString(UnionDirective::class, $schemaDirectives);

/*
* Programmatic types
*/
// Programmatic types

$programmaticTypes = \Safe\file_get_contents(IdeHelperCommand::programmaticTypesPath());

Expand All @@ -76,9 +70,7 @@ public function testGeneratesIdeHelperFiles(): void
'Generates definitions for programmatically registered types',
);

/*
* PHP Ide Helper
*/
// PHP Ide Helper

$ideHelper = \Safe\file_get_contents(IdeHelperCommand::phpIdeHelperPath());

Expand Down

0 comments on commit 39f86b2

Please sign in to comment.