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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
if: ${{ matrix.php-version == '8.4' }}
run: composer check

- name: Scaffold drift
if: ${{ matrix.php-version == '8.4' }}
run: php artisan package:init --check --workbench --browser --no-playwright --phpstan --rector --pint

- name: Pest
if: ${{ matrix.php-version != '8.4' }}
run: composer test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/.mcp.json
/.claude/skills/
/.agents/
/.codex/
/.junie/
/docs/superpowers/
/.superpowers/
12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lattice-php/lattice": ">=0.36.0 <1.0.0"
},
"require-dev": {
"bambamboole/extended-testbench": "^0.3",
"bambamboole/extended-testbench": "^0.6",
"bambamboole/laravel-i18next": "^0.6.0",
"larastan/larastan": "^3.0",
"laravel/boost": "^2.4",
Expand All @@ -34,6 +34,12 @@
}
},
"extra": {
"extended-testbench": {
"check-ignore": [
"tests/Browser/DummyTest.php",
"rector.php"
]
},
"lattice": {
"plugin": "resources/js/plugin.ts",
"discover": ["src"]
Expand All @@ -55,9 +61,9 @@
"post-update-cmd": [
"@boost:refresh"
],
"boost:refresh": "[ -n \"$CI\" ] || [ ! -f vendor/bin/testbench ] || [ ! -f boost.json ] || vendor/bin/testbench boost:update --no-interaction || true",
"boost:refresh": "[ -n \"$CI\" ] || [ ! -f vendor/bin/testbench ] || [ ! -f boost.json ] || { [ -f package.json ] && [ ! -d node_modules ]; } || vendor/bin/testbench boost:update --no-interaction || true",
"serve": "@php vendor/bin/testbench serve",
"test": "pest --testsuite=Unit,Feature",
"test": "pest --exclude-testsuite=Browser",
"test:browser": [
"npm run build",
"pest --testsuite=Browser"
Expand Down
1 change: 0 additions & 1 deletion config/media.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Lattice\Media\Models\Media;
Expand Down
1 change: 0 additions & 1 deletion database/factories/MediaFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Database\Factories;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
Expand Down
1 change: 0 additions & 1 deletion lang/de/media.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

return [
Expand Down
1 change: 0 additions & 1 deletion lang/en/media.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

return [
Expand Down
5 changes: 5 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
<testsuite name="Arch">
<file>tests/ArchTest.php</file>
</testsuite>
<testsuite name="Browser">
<directory>tests/Browser</directory>
</testsuite>
Expand All @@ -21,6 +24,8 @@
</include>
</source>
<php>
<!-- Testbench's own fixture key; package:purge-skeleton deletes the .env that carries it. -->
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="APP_DEBUG" value="true"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
Expand Down
3 changes: 2 additions & 1 deletion pint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"preset": "laravel",
"rules": {
"declare_strict_types": true
"declare_strict_types": true,
"blank_line_after_opening_tag": false
}
}
1 change: 0 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
Expand Down
1 change: 0 additions & 1 deletion src/Actions/DeleteMediaAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Actions;
Expand Down
1 change: 0 additions & 1 deletion src/Actions/DeleteSelectedMediaAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Actions;
Expand Down
1 change: 0 additions & 1 deletion src/Actions/UpdateMediaAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Actions;
Expand Down
1 change: 0 additions & 1 deletion src/Actions/UploadMediaAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Actions;
Expand Down
1 change: 0 additions & 1 deletion src/Components/MediaLibrary.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Components;
Expand Down
1 change: 0 additions & 1 deletion src/Console/Commands/GenerateConversionsCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Console\Commands;
Expand Down
1 change: 0 additions & 1 deletion src/Forms/Components/MediaPicker.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Forms\Components;
Expand Down
1 change: 0 additions & 1 deletion src/Forms/RichEditor/MediaImage.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Forms\RichEditor;
Expand Down
1 change: 0 additions & 1 deletion src/Forms/RichEditor/MediaImageNode.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Forms\RichEditor;
Expand Down
1 change: 0 additions & 1 deletion src/Jobs/GenerateMediaConversions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Jobs;
Expand Down
1 change: 0 additions & 1 deletion src/MediaServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media;
Expand Down
1 change: 0 additions & 1 deletion src/Models/Attachment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Models;
Expand Down
1 change: 0 additions & 1 deletion src/Models/Concerns/HasMedia.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Models\Concerns;
Expand Down
1 change: 0 additions & 1 deletion src/Models/Media.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Models;
Expand Down
1 change: 0 additions & 1 deletion src/Policies/MediaPolicy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Policies;
Expand Down
1 change: 0 additions & 1 deletion src/Rules/AttachableMedia.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Rules;
Expand Down
1 change: 0 additions & 1 deletion src/Tables/Filters/MediaTypeFilter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tables\Filters;
Expand Down
1 change: 0 additions & 1 deletion src/Tables/MediaTable.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tables;
Expand Down
10 changes: 10 additions & 0 deletions tests/ArchTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);

arch('no debug statements ship in the package')
->expect(['dd', 'ddd', 'dump', 'ray', 'var_dump', 'print_r'])
->not->toBeUsed();

arch('the package uses strict types throughout')
->expect('Lattice\Media')
->toUseStrictTypes();
1 change: 0 additions & 1 deletion tests/Browser/MediaImageEditorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\DB;
Expand Down
1 change: 0 additions & 1 deletion tests/Browser/MediaLibraryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Storage;
Expand Down
1 change: 0 additions & 1 deletion tests/Browser/MediaPickerTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\DB;
Expand Down
1 change: 0 additions & 1 deletion tests/BrowserTestCase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tests;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/CollectionConversionsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Http\UploadedFile;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/DisplayIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Storage;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/GenerateConversionsCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Http\UploadedFile;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/GenerateMediaConversionsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Filesystem\FilesystemAdapter;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/HasMediaTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Database\QueryException;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/ManageMediaActionsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Storage;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaImageExtensionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Auth;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaImageNodeTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Lattice\Media\Forms\RichEditor\MediaImageNode;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaLibraryComponentTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Http\UploadedFile;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaModelConfigTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Http\Request;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaModelTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\DB;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaPackageTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Lattice\Lattice\Core\Discovery\ComponentPackages;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaPickerFieldTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Validator;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaPolicyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Gate;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/MediaTableTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Storage;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/TranslationParityTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Support\Arr;
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/UploadMediaActionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Illuminate\Filesystem\FilesystemAdapter;
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/ConversionProduct.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tests\Fixtures;
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/CustomMedia.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tests\Fixtures;
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/DenyMediaPolicy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tests\Fixtures;
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/PartialConversionMedia.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tests\Fixtures;
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/TwoConversionMedia.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

namespace Lattice\Media\Tests\Fixtures;
Expand Down
Loading