Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiaanluca committed Mar 17, 2022
1 parent 4616f44 commit 5321d44
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Pipe.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace SebastiaanLuca\PipeOperator;

class Pipe
Expand All @@ -15,14 +17,14 @@ public function __construct(mixed $value)
}
}

public static function from($value): self
public function __call(string $name, array $arguments): mixed
{
return new self($value);
return $this->pipe($name, ...$arguments);
}

public function __call(string $name, array $arguments): mixed
public static function from($value): self
{
return $this->pipe($name, ...$arguments);
return new self($value);
}

public function pipe(callable|object|string $callback, mixed ...$arguments): self|PipeProxy
Expand Down
2 changes: 2 additions & 0 deletions src/PipeProxy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace SebastiaanLuca\PipeOperator;

use Closure;
Expand Down
2 changes: 2 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use SebastiaanLuca\PipeOperator\Pipe;

if (! function_exists('take')) {
Expand Down
2 changes: 2 additions & 0 deletions tests/IdentifierTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace SebastiaanLuca\PipeOperator\Tests\Unit\Classes;

use PHPUnit\Framework\TestCase;
Expand Down
2 changes: 2 additions & 0 deletions tests/MethodsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace SebastiaanLuca\PipeOperator\Tests\Unit\Classes;

use Closure;
Expand Down
2 changes: 2 additions & 0 deletions tests/ObjectTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace SebastiaanLuca\PipeOperator\Tests\Unit\Classes;

use PHPUnit\Framework\TestCase;
Expand Down

0 comments on commit 5321d44

Please sign in to comment.