Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tests
on: [ push, pull_request ]

jobs:
build:
unit:
runs-on: ubuntu-latest

strategy:
Expand All @@ -30,3 +30,25 @@ jobs:

- name: Execute tests
run: composer test

type:
runs-on: ubuntu-latest

name: Type Coverage

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv
coverage: xdebug

- name: Install dependencies
run: composer update

- name: Execute tests
run: composer lint:type
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"orchestra/testbench": "^9.0 || ^10.0",
"pestphp/pest": "^3.0 || ^4.0",
"pestphp/pest-plugin-laravel": "^3.0 || ^4.0",
"pestphp/pest-plugin-type-coverage": "^3.0 || ^4.0",
"symfony/var-dumper": "^7.3"
},
"minimum-stability": "stable",
Expand Down Expand Up @@ -69,6 +70,7 @@
],
"build": "@php vendor/bin/testbench workbench:build --ansi",
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"lint:type": "@php vendor/bin/pest --type-coverage --compact --min=95",
"migrate": "@php vendor/bin/testbench migrate:fresh --seed --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"style": "vendor/bin/pint --parallel --ansi",
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/FeedInfoMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function getStub(): string
return __DIR__ . '/../../../stubs/feed_info.stub';
}

protected function getDefaultNamespace($rootNamespace): string
protected function getDefaultNamespace($rootNamespace): string // @pest-ignore-type
{
return $rootNamespace . '\Feeds\Info';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/FeedItemMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function getStub(): string
return __DIR__ . '/../../../stubs/feed_item.stub';
}

protected function getDefaultNamespace($rootNamespace): string
protected function getDefaultNamespace($rootNamespace): string // @pest-ignore-type
{
return $rootNamespace . '\Feeds\Items';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/FeedMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function getStub(): string
return __DIR__ . '/../../../stubs/feed.stub';
}

protected function getDefaultNamespace($rootNamespace): string
protected function getDefaultNamespace($rootNamespace): string // @pest-ignore-type
{
return $rootNamespace . '\Feeds';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Converters/ConvertToXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function setMixed(DOMNode $element, string $value): void
$element->appendChild($fragment);
}

protected function setItemsArray(DOMNode $parent, $value, string $key): void
protected function setItemsArray(DOMNode $parent, array $value, string $key): void
{
$key = Str::substr($key, 1);

Expand Down
8 changes: 4 additions & 4 deletions src/Services/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
/**
* @return resource
*/
public function open(string $path)
public function open(string $path) // @pest-ignore-type
{
$path = $this->draft($path);

Expand All @@ -43,7 +43,7 @@ public function open(string $path)
/**
* @param resource $resource
*/
public function append($resource, string $content, string $path): void
public function append($resource, string $content, string $path): void // @pest-ignore-type
{
if (blank($content)) {
return;
Expand All @@ -57,7 +57,7 @@ public function append($resource, string $content, string $path): void
/**
* @param resource $resource
*/
public function release($resource, string $path): void
public function release($resource, string $path): void // @pest-ignore-type
{
$this->close($resource);

Expand All @@ -74,7 +74,7 @@ public function release($resource, string $path): void
/**
* @param resource $resource
*/
public function close($resource): void
public function close($resource): void // @pest-ignore-type
{
if (! is_resource($resource)) {
return;
Expand Down
16 changes: 8 additions & 8 deletions src/Services/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function feed(Feed $feed): void
$this->setLastActivity($feed);
}

protected function performItem($file, Feed $feed): void
protected function performItem($file, Feed $feed): void // @pest-ignore-type
{
$feed->builder()->chunkById($feed->chunkSize(), function (Collection $models) use ($file, $feed) {
$content = [];
Expand All @@ -56,12 +56,12 @@ protected function performItem($file, Feed $feed): void
});
}

protected function performHeader($file, Feed $feed): void
protected function performHeader($file, Feed $feed): void // @pest-ignore-type
{
$this->append($file, $feed->header(), $feed->path());
}

protected function performInfo($file, Feed $feed): void
protected function performInfo($file, Feed $feed): void // @pest-ignore-type
{
if (blank($info = $feed->info()->toArray())) {
return;
Expand All @@ -72,7 +72,7 @@ protected function performInfo($file, Feed $feed): void
$this->append($file, PHP_EOL . $value, $feed->path());
}

protected function performRoot($file, Feed $feed): void
protected function performRoot($file, Feed $feed): void // @pest-ignore-type
{
if (! $name = $feed->root()->name) {
return;
Expand All @@ -85,7 +85,7 @@ protected function performRoot($file, Feed $feed): void
$this->append($file, $value, $feed->path());
}

protected function performFooter($file, Feed $feed): void
protected function performFooter($file, Feed $feed): void // @pest-ignore-type
{
$value = '';

Expand All @@ -105,17 +105,17 @@ protected function makeRootAttributes(ElementData $item): string
->implode(' ');
}

protected function append($file, string $content, string $path): void
protected function append($file, string $content, string $path): void // @pest-ignore-type
{
$this->filesystem->append($file, $content, $path);
}

protected function release($file, string $path): void
protected function release($file, string $path): void // @pest-ignore-type
{
$this->filesystem->release($file, $path);
}

protected function openFile(string $path)
protected function openFile(string $path) // @pest-ignore-type
{
return $this->filesystem->open($path);
}
Expand Down