From 28da41373eb301c4abf82dc1de8e2be673d2f295 Mon Sep 17 00:00:00 2001 From: Korben Dallas Date: Thu, 2 May 2024 19:48:23 +0200 Subject: [PATCH] Github CI / fixes / Reducing coverage (#90) * fix ci * update dependencies --- .github/workflows/ci.yml | 4 ++-- composer.json | 2 +- src/Compilers/CreateCompiler.php | 3 +++ src/Helpers/IndexAssertions.php | 3 +++ src/Helpers/TableAssertions.php | 3 +++ src/Helpers/ViewAssertions.php | 3 +++ src/Schema/Blueprint.php | 15 +++++++++++++++ 7 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef477e9..ef1caf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: fail-fast: false env: PHP_CS_FIXER_FUTURE_MODE: '0' - name: 'Lint PHP' + name: 'Linter PHP' steps: - name: 'Checkout' uses: actions/checkout@v2 @@ -106,7 +106,7 @@ jobs: - 5432:5432 # needed because the postgres container does not provide a healthcheck options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - name: 'Test / PHP ${{ matrix.php_versions }} / Postgres ${{ matrix.postgres }}' + name: 'Testing / PHP ${{ matrix.php_versions }} / Postgres ${{ matrix.postgres }}' needs: - lint steps: diff --git a/composer.json b/composer.json index ffddd26..1eb794f 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "laravel/framework": "^11.0" }, "require-dev": { - "umbrellio/code-style-php": "^1.0", + "umbrellio/code-style-php": "^1.2", "orchestra/testbench": "^9.0", "php-coveralls/php-coveralls": "^2.7", "codeception/codeception": "^5.0", diff --git a/src/Compilers/CreateCompiler.php b/src/Compilers/CreateCompiler.php index 1e6c3dc..3bd655a 100644 --- a/src/Compilers/CreateCompiler.php +++ b/src/Compilers/CreateCompiler.php @@ -10,6 +10,9 @@ class CreateCompiler { + /** + * @codeCoverageIgnore + */ public static function compile(Grammar $grammar, Blueprint $blueprint, array $columns, array $commands = []): string { $compiledCommand = sprintf( diff --git a/src/Helpers/IndexAssertions.php b/src/Helpers/IndexAssertions.php index 5ceb153..a89922c 100644 --- a/src/Helpers/IndexAssertions.php +++ b/src/Helpers/IndexAssertions.php @@ -6,6 +6,9 @@ use Illuminate\Support\Facades\DB; +/** + * @codeCoverageIgnore + */ trait IndexAssertions { abstract public static function assertNotNull($actual, string $message = ''): void; diff --git a/src/Helpers/TableAssertions.php b/src/Helpers/TableAssertions.php index 2438bab..6b4b81b 100644 --- a/src/Helpers/TableAssertions.php +++ b/src/Helpers/TableAssertions.php @@ -6,6 +6,9 @@ use Illuminate\Support\Facades\Schema; +/** + * @codeCoverageIgnore + */ trait TableAssertions { abstract public static function assertSame($expected, $actual, string $message = ''): void; diff --git a/src/Helpers/ViewAssertions.php b/src/Helpers/ViewAssertions.php index 6b4f1ed..9873f74 100644 --- a/src/Helpers/ViewAssertions.php +++ b/src/Helpers/ViewAssertions.php @@ -6,6 +6,9 @@ use Illuminate\Support\Facades\Schema; +/** + * @codeCoverageIgnore + */ trait ViewAssertions { abstract public static function assertSame($expected, $actual, string $message = ''): void; diff --git a/src/Schema/Blueprint.php b/src/Schema/Blueprint.php index 2fc5a88..cfbb9cc 100644 --- a/src/Schema/Blueprint.php +++ b/src/Schema/Blueprint.php @@ -40,6 +40,7 @@ public function detachPartition(string $partition): void } /** + * @codeCoverageIgnore * @return LikeDefinition|Fluent */ public function like(string $table): Fluent @@ -47,6 +48,9 @@ public function like(string $table): Fluent return $this->addCommand('like', compact('table')); } + /** + * @codeCoverageIgnore + */ public function ifNotExists(): Fluent { return $this->addCommand('ifNotExists'); @@ -110,6 +114,9 @@ public function dropCheck($index): Fluent return $this->dropIndexCommand('dropUnique', 'chk', $index); } + /** + * @codeCoverageIgnore + */ public function hasIndex($index, bool $unique = false): bool { if (is_array($index)) { @@ -120,6 +127,7 @@ public function hasIndex($index, bool $unique = false): bool } /** + * @codeCoverageIgnore * @return ViewDefinition|Fluent */ public function createView(string $view, string $select, bool $materialize = false): Fluent @@ -127,6 +135,9 @@ public function createView(string $view, string $select, bool $materialize = fal return $this->addCommand('createView', compact('view', 'select', 'materialize')); } + /** + * @codeCoverageIgnore + */ public function dropView(string $view): Fluent { return $this->addCommand('dropView', compact('view')); @@ -166,8 +177,12 @@ public function daterange(string $column): Fluent return $this->addColumn(DateRangeType::TYPE_NAME, $column); } + /** + * @codeCoverageIgnore + */ protected function getSchemaManager() { + /** @scrutinizer ignore-call */ $connection = Schema::getConnection(); $doctrineConnection = DriverManager::getConnection($connection->getConfig()); return $doctrineConnection->getSchemaManager();