Skip to content

Commit

Permalink
Applied rector and php-cs-fixer with php 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
stevleibelt committed Jul 29, 2024
1 parent 404b288 commit 3d4a75e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ try {
* @todo
* add support for lambdafunctions or move to __invoke() fully
* added example for [tee](https://en.wikipedia.org/wiki/Tee_(command))
* fixed invalid package names
* @done
* fixed invalid package names
* Added rector
* Added php-cs-fixer
* [1.1.1](https://github.com/bazzline/php_component_process_pipe/tree/1.1.1) - released at 29.07.2016
* fixed invalid example links
* removed local api
Expand Down
6 changes: 4 additions & 2 deletions source/ExecutableException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author stev leibelt <[email protected]>
* @since 2014-11-07
* @since 2014-11-07
*/

namespace Net\Bazzline\Component\ProcessPipe;
Expand All @@ -12,4 +12,6 @@
* Class ExecutableException
* @package Net\Bazzline\Component\ProcessPipe
*/
class ExecutableException extends RuntimeException {}
class ExecutableException extends RuntimeException
{
}
7 changes: 3 additions & 4 deletions source/ExecutableInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author stev leibelt <[email protected]>
* @since 2014-11-07
* @since 2014-11-07
*/

namespace Net\Bazzline\Component\ProcessPipe;
Expand All @@ -13,9 +13,8 @@
interface ExecutableInterface
{
/**
* @param mixed $input
* @return mixed
* @throws ExecutableException
*/
public function execute($input = null);
}
public function execute(mixed $input = null);
}
6 changes: 4 additions & 2 deletions source/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author stev leibelt <[email protected]>
* @since 2014-11-11
* @since 2014-11-11
*/

namespace Net\Bazzline\Component\ProcessPipe;
Expand All @@ -12,4 +12,6 @@
* Class InvalidArgumentException
* @package Net\Bazzline\Component\ProcessPipe
*/
class InvalidArgumentException extends ParentClass {}
class InvalidArgumentException extends ParentClass
{
}
16 changes: 6 additions & 10 deletions source/Pipe.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author stev leibelt <[email protected]>
* @since 2014-11-07
* @since 2014-11-07
*/

namespace Net\Bazzline\Component\ProcessPipe;
Expand All @@ -13,21 +13,17 @@
class Pipe implements PipeInterface
{
/** @var array|ExecutableInterface[] */
private $processes;
private $processes = [];

/**
* Adds one or more process to the pipe
*
* @param ExecutableInterface $process - or more
* @param ExecutableInterface $_ [optional]
* @throws InvalidArgumentException
*/
public function __construct(ExecutableInterface $process = null, $_ = null)
public function __construct()
{
$this->processes = array();

if (func_num_args() > 0) {
call_user_func_array(array($this, 'pipe'), func_get_args());
call_user_func_array($this->pipe(...), func_get_args());
}
}

Expand Down Expand Up @@ -61,8 +57,8 @@ public function pipe(ExecutableInterface $process, $_ = null)
} else {
$message = 'Argument ' . $index . ' passed to ' . __METHOD__ .
'() must implement interface ' .
'Net\Bazzline\Component\ProcessPipe\ExecutableInterface' .
', instance of ' . get_class($process) . ' given';
\Net\Bazzline\Component\ProcessPipe\ExecutableInterface::class .
', instance of ' . $process::class . ' given';
throw new InvalidArgumentException($message);
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/PipeInterface.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @author stev leibelt <[email protected]>
* @since 2014-11-07
* @since 2014-11-07
*/

namespace Net\Bazzline\Component\ProcessPipe;
Expand All @@ -21,4 +21,4 @@ interface PipeInterface extends ExecutableInterface
* @return $this
*/
public function pipe(ExecutableInterface $process, $_ = null);
}
}

0 comments on commit 3d4a75e

Please sign in to comment.