@@ -5,20 +5,20 @@ |
||
| 5 | 5 | * to "wc -l <filename>" |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -if (!isset($_SERVER['argv'][1])) { |
|
| 8 | +if (!isset($_SERVER[ 'argv' ][ 1 ])) { |
|
| 9 | 9 | die("You must provide a filename\n"); |
| 10 | 10 | } |
| 11 | -$fileName = $_SERVER['argv'][1]; |
|
| 11 | +$fileName = $_SERVER[ 'argv' ][ 1 ]; |
|
| 12 | 12 | |
| 13 | 13 | // Include standard autoloader |
| 14 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
| 14 | +require __DIR__.'/../../vendor/autoload.php'; |
|
| 15 | 15 | |
| 16 | 16 | // create network |
| 17 | 17 | $traceableNetwork = new \PhpFlo\TraceableNetwork( |
| 18 | 18 | new PhpFlo\Network( |
| 19 | 19 | new PhpFlo\Builder\ComponentFactory() |
| 20 | 20 | ), |
| 21 | - new \PhpFlo\Logger\SimpleFile(__DIR__ . DIRECTORY_SEPARATOR . 'flow.log', 'info') |
|
| 21 | + new \PhpFlo\Logger\SimpleFile(__DIR__.DIRECTORY_SEPARATOR.'flow.log', 'info') |
|
| 22 | 22 | ); |
| 23 | 23 | $traceableNetwork |
| 24 | 24 | ->boot(__DIR__.'/count.fbp') |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | */ |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | namespace PhpFlo\Logger; |
| 12 | 12 | |
| 13 | 13 | use Psr\Log\AbstractLogger; |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | $log = pathinfo($logFile); |
| 44 | 44 | // check if $logFile is a dir because of possible stream url |
| 45 | 45 | $isLogdir = is_dir($logFile); |
| 46 | - if (!$isLogdir && (isset($log['dirname']) && !is_dir($log['dirname']))) { |
|
| 46 | + if (!$isLogdir && (isset($log[ 'dirname' ]) && !is_dir($log[ 'dirname' ]))) { |
|
| 47 | 47 | throw new \InvalidArgumentException( |
| 48 | - "Directory does not exist: {$log['dirname']}" |
|
| 48 | + "Directory does not exist: {$log[ 'dirname' ]}" |
|
| 49 | 49 | ); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if ($isLogdir || !isset($log['filename'])) { |
|
| 53 | - $logFile = $logFile . DIRECTORY_SEPARATOR . self::DEFAULT_FILENAME; |
|
| 52 | + if ($isLogdir || !isset($log[ 'filename' ])) { |
|
| 53 | + $logFile = $logFile.DIRECTORY_SEPARATOR.self::DEFAULT_FILENAME; |
|
| 54 | 54 | } |
| 55 | 55 | $this->logFile = $logFile; |
| 56 | 56 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | if (in_array($level, $this->levels)) { |
| 72 | 72 | file_put_contents( |
| 73 | - $this->logFile, $message . PHP_EOL, FILE_APPEND |
|
| 73 | + $this->logFile, $message.PHP_EOL, FILE_APPEND |
|
| 74 | 74 | ); |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | */ |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | namespace PhpFlo; |
| 12 | 12 | |
| 13 | 13 | use PhpFlo\Common\AbstractNetworkDecorator; |
@@ -90,21 +90,21 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | private function traceData(array $args, string $type) |
| 92 | 92 | { |
| 93 | - $data = $args[0]; |
|
| 94 | - $socket = $args[1]; |
|
| 93 | + $data = $args[ 0 ]; |
|
| 94 | + $socket = $args[ 1 ]; |
|
| 95 | 95 | |
| 96 | 96 | if (!is_string($data)) { |
| 97 | 97 | $data = serialize($data); |
| 98 | 98 | } |
| 99 | 99 | $to = $socket->to(); |
| 100 | - $message = "-> {$to['port']} {$to['process']['id']}"; |
|
| 100 | + $message = "-> {$to[ 'port' ]} {$to[ 'process' ][ 'id' ]}"; |
|
| 101 | 101 | |
| 102 | 102 | $from = $socket->from(); |
| 103 | - if (isset($from['process'])) { |
|
| 104 | - $message = " {$from['process']['id']} {$from['port']} {$message}"; |
|
| 103 | + if (isset($from[ 'process' ])) { |
|
| 104 | + $message = " {$from[ 'process' ][ 'id' ]} {$from[ 'port' ]} {$message}"; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - $this->logger->info("{$message} {$this->actions[$type]} {$data}"); |
|
| 107 | + $this->logger->info("{$message} {$this->actions[ $type ]} {$data}"); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -113,15 +113,15 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private function traceAction(array $args, string $type) |
| 115 | 115 | { |
| 116 | - $socket = $args[0]; |
|
| 116 | + $socket = $args[ 0 ]; |
|
| 117 | 117 | $to = $socket->to(); |
| 118 | - $message = "-> {$to['port']} {$to['process']['id']}"; |
|
| 118 | + $message = "-> {$to[ 'port' ]} {$to[ 'process' ][ 'id' ]}"; |
|
| 119 | 119 | |
| 120 | 120 | $from = $socket->from(); |
| 121 | - if (isset($from['process'])) { |
|
| 122 | - $message = " {$from['process']['id']} {$from['port']} {$message}"; |
|
| 121 | + if (isset($from[ 'process' ])) { |
|
| 122 | + $message = " {$from[ 'process' ][ 'id' ]} {$from[ 'port' ]} {$message}"; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $this->logger->debug("{$message} {$this->actions[$type]}"); |
|
| 125 | + $this->logger->debug("{$message} {$this->actions[ $type ]}"); |
|
| 126 | 126 | } |
| 127 | 127 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | */ |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | namespace PhpFlo\Common; |
| 12 | 12 | |
| 13 | 13 | /** |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | */ |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | namespace PhpFlo\Test; |
| 12 | 12 | |
| 13 | 13 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | protected function stub( |
| 37 | 37 | string $class, |
| 38 | - array $methods = [], |
|
| 38 | + array $methods = [ ], |
|
| 39 | 39 | string $className = '', |
| 40 | 40 | bool $forceMethods = false |
| 41 | 41 | ) : \PHPUnit_Framework_MockObject_MockObject { |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * For the full copyright and license information, please view the LICENSE |
| 8 | 8 | * file that was distributed with this source code. |
| 9 | 9 | */ |
| 10 | -declare(strict_types=1); |
|
| 10 | +declare(strict_types = 1); |
|
| 11 | 11 | namespace PhpFlo\Common; |
| 12 | 12 | |
| 13 | 13 | /** |