Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored and github-actions[bot] committed Jul 15, 2024
1 parent 21a4e6b commit e079888
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/MediaCollections/Exceptions/FileNameNotAllowed.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Spatie\MediaLibrary\MediaCollections\Exceptions;

use Spatie\MediaLibrary\Support\File;

class FileNameNotAllowed extends FileCannotBeAdded
{
public static function create(string $orignalName, string $sanitizedName): self
Expand Down
3 changes: 1 addition & 2 deletions src/MediaCollections/FileAdder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
use Spatie\MediaLibrary\Conversions\ImageGenerators\Image as ImageGenerator;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\MediaCollections\Exceptions\DiskCannotBeAccessed;
Expand Down Expand Up @@ -394,7 +393,7 @@ public function defaultSanitizer(string $fileName): string
{
$sanitizedFileName = preg_replace('#\p{C}+#u', '', $fileName);

$sanitizedFileName = str_replace(['#', '/', '\\', ' '], '-', $sanitizedFileName);
$sanitizedFileName = str_replace(['#', '/', '\\', ' '], '-', $sanitizedFileName);

$phpExtensions = [
'php', 'php3', 'php4', 'php5', 'php7', 'php8', 'phtml', 'phar',
Expand Down
2 changes: 1 addition & 1 deletion tests/MediaCollections/FileAdderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
->toEqual('Scan-9.14.2022-7.23.28.pdf');
});

it('will throw an exception if the sanitized file name is a php file name', function() {
it('will throw an exception if the sanitized file name is a php file name', function () {
$adder = app(FileAdder::class);

$adder->defaultSanitizer('filename.php‎');
Expand Down

0 comments on commit e079888

Please sign in to comment.