Skip to content

Commit 1311bc2

Browse files
nikophilkbond
authored andcommitted
bot: fix cs [skip ci]
1 parent 850858e commit 1311bc2

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/LazyValue.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ public function __construct(callable $factory, bool $memoize = false, bool $call
3838
}
3939
}
4040

41-
public static function new(callable $factory): self
42-
{
43-
return new self($factory, false, true);
44-
}
45-
46-
public static function memoize(callable $factory): self
47-
{
48-
return new self($factory, true, true);
49-
}
50-
5141
/**
5242
* @internal
5343
*/
@@ -74,6 +64,16 @@ public function __invoke(): mixed
7464
return $value;
7565
}
7666

67+
public static function new(callable $factory): self
68+
{
69+
return new self($factory, false, true);
70+
}
71+
72+
public static function memoize(callable $factory): self
73+
{
74+
return new self($factory, true, true);
75+
}
76+
7777
/**
7878
* @internal
7979
*/

tests/Unit/FunctionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
use function Zenstruck\Foundry\faker;
2929
use function Zenstruck\Foundry\instantiate;
3030
use function Zenstruck\Foundry\instantiate_many;
31-
use function Zenstruck\Foundry\memoize;
3231
use function Zenstruck\Foundry\lazy;
32+
use function Zenstruck\Foundry\memoize;
3333
use function Zenstruck\Foundry\repository;
3434

3535
/**
@@ -52,7 +52,7 @@ public function faker(): void
5252
*/
5353
public function lazy(): void
5454
{
55-
$value = lazy(fn () => new \stdClass());
55+
$value = lazy(fn() => new \stdClass());
5656

5757
$this->assertInstanceOf(LazyValue::class, $value);
5858
$this->assertNotSame($value(), $value());
@@ -63,7 +63,7 @@ public function lazy(): void
6363
*/
6464
public function memoize(): void
6565
{
66-
$value = memoize(fn () => new \stdClass());
66+
$value = memoize(fn() => new \stdClass());
6767

6868
$this->assertInstanceOf(LazyValue::class, $value);
6969
$this->assertSame($value(), $value());

tests/Unit/LazyValueTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function can_handle_array_with_lazy_values(): void
6666
*/
6767
public function does_not_memoize_value_by_default(): void
6868
{
69-
$value = new LazyValue(fn () => new \stdClass());
69+
$value = new LazyValue(fn() => new \stdClass());
7070

7171
$this->assertNotSame($value(), $value());
7272
}
@@ -76,7 +76,7 @@ public function does_not_memoize_value_by_default(): void
7676
*/
7777
public function does_not_memoize_value(): void
7878
{
79-
$value = LazyValue::new(fn () => new \stdClass());
79+
$value = LazyValue::new(fn() => new \stdClass());
8080

8181
$this->assertNotSame($value(), $value());
8282
}
@@ -86,7 +86,7 @@ public function does_not_memoize_value(): void
8686
*/
8787
public function can_handle_memoized_value(): void
8888
{
89-
$value = LazyValue::memoize(fn () => new \stdClass());
89+
$value = LazyValue::memoize(fn() => new \stdClass());
9090

9191
$this->assertSame($value(), $value());
9292
}

0 commit comments

Comments
 (0)