Skip to content

Commit 5321d44

Browse files
Format code
1 parent 4616f44 commit 5321d44

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

src/Pipe.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SebastiaanLuca\PipeOperator;
46

57
class Pipe
@@ -15,14 +17,14 @@ public function __construct(mixed $value)
1517
}
1618
}
1719

18-
public static function from($value): self
20+
public function __call(string $name, array $arguments): mixed
1921
{
20-
return new self($value);
22+
return $this->pipe($name, ...$arguments);
2123
}
2224

23-
public function __call(string $name, array $arguments): mixed
25+
public static function from($value): self
2426
{
25-
return $this->pipe($name, ...$arguments);
27+
return new self($value);
2628
}
2729

2830
public function pipe(callable|object|string $callback, mixed ...$arguments): self|PipeProxy

src/PipeProxy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SebastiaanLuca\PipeOperator;
46

57
use Closure;

src/functions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use SebastiaanLuca\PipeOperator\Pipe;
46

57
if (! function_exists('take')) {

tests/IdentifierTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SebastiaanLuca\PipeOperator\Tests\Unit\Classes;
46

57
use PHPUnit\Framework\TestCase;

tests/MethodsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SebastiaanLuca\PipeOperator\Tests\Unit\Classes;
46

57
use Closure;

tests/ObjectTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace SebastiaanLuca\PipeOperator\Tests\Unit\Classes;
46

57
use PHPUnit\Framework\TestCase;

0 commit comments

Comments
 (0)