Skip to content

Commit

Permalink
Fix process api.
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-s committed Jun 14, 2018
1 parent 3e178bc commit df9b81b
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 9 deletions.
4 changes: 2 additions & 2 deletions jphp-core/api-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
---

## jphp-core
> version 1.0.3, created by JPPM.
> version 1.0.4, created by JPPM.
Compiler and Launcher for JPHP.

### Install
```
jppm add [email protected].3
jppm add [email protected].4
```

### API
Expand Down
4 changes: 2 additions & 2 deletions jphp-core/api-docs/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
---

## jphp-core
> версия 1.0.3, создано с помощью JPPM.
> версия 1.0.4, создано с помощью JPPM.
Compiler and Launcher for JPHP.

### Установка
```
jppm add [email protected].3
jppm add [email protected].4
```

### АПИ
Expand Down
46 changes: 44 additions & 2 deletions jphp-runtime/api-docs/classes/php/util/Flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Class Flow, Immutable
- `->`[`withKeys()`](#method-withkeys) - _Enables to save keys for the next operation_
- `->`[`onlyKeys()`](#method-onlykeys)
- `->`[`append()`](#method-append) - _Appends a new collection to the current flow,_
- `->`[`anyMatch()`](#method-anymatch) - _Returns whether any elements of this stream match the provided_
- `->`[`allMatch()`](#method-allmatch) - _Returns whether all elements of this stream match the provided predicate._
- `->`[`noneMatch()`](#method-nonematch) - _Returns whether no elements of this stream match the provided predicate._
- `->`[`find()`](#method-find) - _Finds elements by using the $filter callback,_
- `->`[`findOne()`](#method-findone) - _Finds the first element by using the $filter callback,_
- `->`[`findValue()`](#method-findvalue)
Expand Down Expand Up @@ -153,14 +156,53 @@ do not remember that you can pass a flow to this method

---

<a name="method-anymatch"></a>

### anyMatch()
```php
anyMatch(callable $predicate): bool
```
Returns whether any elements of this stream match the provided
predicate. May not evaluate the predicate on all elements if not
necessary for determining the result. If the flow is empty then
`false` is returned and the predicate is not evaluated.

---

<a name="method-allmatch"></a>

### allMatch()
```php
allMatch(callable $predicate): bool
```
Returns whether all elements of this stream match the provided predicate.
May not evaluate the predicate on all elements if not necessary for
determining the result. If the flow is empty then `true` is
returned and the predicate is not evaluated.

---

<a name="method-nonematch"></a>

### noneMatch()
```php
noneMatch(callable $predicate): bool
```
Returns whether no elements of this stream match the provided predicate.
May not evaluate the predicate on all elements if not necessary for
determining the result. If the flow is empty then `true` is
returned and the predicate is not evaluated.

---

<a name="method-find"></a>

### find()
```php
find(callable $filter): php\util\Flow
```
Finds elements by using the $filter callback,
elements - for each iteration that returns ``true``
elements - for each iteration that returns `true`

---

Expand All @@ -171,7 +213,7 @@ elements - for each iteration that returns ``true``
findOne(callable $filter): mixed
```
Finds the first element by using the $filter callback,
when $filter will return the first ``true``
when $filter will return the first `true`

---

Expand Down
46 changes: 44 additions & 2 deletions jphp-runtime/api-docs/classes/php/util/Flow.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Class Flow, Immutable
- `->`[`withKeys()`](#method-withkeys) - _Enables to save keys for the next operation_
- `->`[`onlyKeys()`](#method-onlykeys)
- `->`[`append()`](#method-append) - _Appends a new collection to the current flow,_
- `->`[`anyMatch()`](#method-anymatch) - _Returns whether any elements of this stream match the provided_
- `->`[`allMatch()`](#method-allmatch) - _Returns whether all elements of this stream match the provided predicate._
- `->`[`noneMatch()`](#method-nonematch) - _Returns whether no elements of this stream match the provided predicate._
- `->`[`find()`](#method-find) - _Finds elements by using the $filter callback,_
- `->`[`findOne()`](#method-findone) - _Finds the first element by using the $filter callback,_
- `->`[`findValue()`](#method-findvalue)
Expand Down Expand Up @@ -153,14 +156,53 @@ do not remember that you can pass a flow to this method

---

<a name="method-anymatch"></a>

### anyMatch()
```php
anyMatch(callable $predicate): bool
```
Returns whether any elements of this stream match the provided
predicate. May not evaluate the predicate on all elements if not
necessary for determining the result. If the flow is empty then
`false` is returned and the predicate is not evaluated.

---

<a name="method-allmatch"></a>

### allMatch()
```php
allMatch(callable $predicate): bool
```
Returns whether all elements of this stream match the provided predicate.
May not evaluate the predicate on all elements if not necessary for
determining the result. If the flow is empty then `true` is
returned and the predicate is not evaluated.

---

<a name="method-nonematch"></a>

### noneMatch()
```php
noneMatch(callable $predicate): bool
```
Returns whether no elements of this stream match the provided predicate.
May not evaluate the predicate on all elements if not necessary for
determining the result. If the flow is empty then `true` is
returned and the predicate is not evaluated.

---

<a name="method-find"></a>

### find()
```php
find(callable $filter): php\util\Flow
```
Finds elements by using the $filter callback,
elements - for each iteration that returns ``true``
elements - for each iteration that returns `true`

---

Expand All @@ -171,7 +213,7 @@ elements - for each iteration that returns ``true``
findOne(callable $filter): mixed
```
Finds the first element by using the $filter callback,
when $filter will return the first ``true``
when $filter will return the first `true`

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ public Memory __construct(Environment env, Memory... args) {
return Memory.NULL;
}

protected Process getProcess() {
public Process getProcess() {
if (process == null)
throw new IllegalStateException("Process is not started, use the start() method to initialize it");

return process;
}

public ProcessBuilder getProcessBuilder() {
return processBuilder;
}

@Signature
public WrapProcess inheritIO() {
if (processBuilder == null)
Expand Down

0 comments on commit df9b81b

Please sign in to comment.