Skip to content

Commit

Permalink
welcome SoUuid
Browse files Browse the repository at this point in the history
  • Loading branch information
fab2s committed Feb 9, 2018
1 parent 27966df commit 0707859
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ NodalFlow shares conceptual similarities with [Transduction](https://en.wikipedi

NodalFlow can be installed using composer :

```shell
```
composer require "fab2s/NodalFlow"
```

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"require" : {
"php": ">=5.6.0",
"fab2s/context-exception": "~1.0.0"
"fab2s/context-exception": "~1.0.1",
"fab2s/souuid": "~0.0.1"
},
"require-dev": {
"phpunit/phpunit": "~5.0"
Expand Down
13 changes: 2 additions & 11 deletions src/Flows/FlowIdTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace fab2s\NodalFlow\Flows;

use fab2s\NodalFlow\Nodes\NodeInterface;
use fab2s\SoUuid\SoUuid;

/**
* Trait FlowIdTrait
Expand Down Expand Up @@ -56,17 +57,7 @@ public function __clone()
public function getId()
{
if ($this->id === null) {
// would require more effort if we where to massively generate / store Flows
$timeParts = explode(' ', microtime(false));

return $this->id = implode('.', array_map(function ($value) {
return base_convert($value, 10, 36);
}, [
$timeParts[1],
$timeParts[0] * 1000000,
++static::$nonce,
mt_rand(0, 999999),
]));
return $this->id = SoUuid::generate()->getString();
}

return $this->id;
Expand Down
2 changes: 1 addition & 1 deletion src/Nodes/InterruptNodeAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function exec($param)
$flowInterrupt = null;
}

/** @var null|InterrupterInterface $flowInterrupt */
/* @var null|InterrupterInterface $flowInterrupt */
$this->carrier->interruptFlow($flowInterruptType, $flowInterrupt);
}
}

0 comments on commit 0707859

Please sign in to comment.