Skip to content

Commit 6f21101

Browse files
committed
clean and wip v0
1 parent 76f5595 commit 6f21101

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: shivammathur/setup-php@v2
2525
with:
2626
php-version: ${{ matrix.php }}
27+
extensions: gd
2728

2829
- name: Validate composer.json and composer.lock
2930
run: composer validate

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,9 @@ composer require descom/package_name
1919
```php
2020
use Descom\ImageX\ImageX;
2121

22-
// Optional
23-
ImageX::defaults([
24-
'width' => 100, // Default null, original width
25-
'height' => 100, // Default null, original height
26-
'backgroundColor' => 'F5F5F5', // Default FFFFFF
27-
]);
28-
29-
$imageX = new ImageX();
30-
31-
return ImageX::source($filename)
22+
return ImageX::from($filename)
3223
->convert('w_200,h_200,b_000000')
33-
->auto() // Auto format to image; avif, webp, jpg
24+
->auto() // Auto format to image; webp, jpg
3425
->response(); // ->save($otherFilename);
3526
```
3627

src/ImageX.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,7 @@ private function __construct()
1919
$this->format = new JpgFormat();
2020
}
2121

22-
public static function default($key, $value): void
23-
{
24-
Options::default($key, $value);
25-
}
26-
27-
public static function defaults(array $values): void
28-
{
29-
Options::defaults($values);
30-
}
31-
32-
public static function source(string $path): self
22+
public static function from(string $path): self
3323
{
3424
$imageManager = new ImageManager(['driver' => 'gd']);
3525

tests/ImageXTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function tearDown(): void
3131
{
3232
parent::tearDown();
3333

34-
// rmdir($this->pathTmp);
34+
rmdir($this->pathTmp);
3535
}
3636

3737
public function testCrop()
@@ -54,7 +54,7 @@ public function testCrop()
5454
foreach ($batchTesting as $testing) {
5555
$filenameTarget = $this->pathTmp.'/'.str_replace(',', '', $testing['options']).'.jpg';
5656

57-
ImageX::source($this->origen)
57+
ImageX::from($this->origen)
5858
->convert($testing['options'])
5959
->save($filenameTarget);
6060

@@ -93,7 +93,7 @@ public function testFormatAuto()
9393

9494
$filenameTarget = $this->pathTmp.'/'.str_replace(',', '', $testing['options']).'.jpg';
9595

96-
ImageX::source($this->origen)
96+
ImageX::from($this->origen)
9797
->convert($testing['options'])
9898
->auto()
9999
->save($filenameTarget);

0 commit comments

Comments
 (0)