You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-22Lines changed: 23 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
# Laudis Neo4j PHP Client
2
2
3
-
## Installation and basic usage
4
-
5
-
### installing
3
+
## Installation
6
4
7
5
Install via composer:
8
6
9
7
```bash
10
8
composer require laudis/neo4j-php-client
11
9
```
12
10
13
-
If you want to use the http protocol but haven't installed any of the psr7, psr17 and psr18 implementations yet:
11
+
The HTTP protocol requires [psr-7](https://www.php-fig.org/psr/psr-7/), [psr-17](https://www.php-fig.org/psr/psr-17/) and [psr-18](https://www.php-fig.org/psr/psr-18/) implementations. If there are not any available, composer can install them.
@@ -57,15 +58,15 @@ foreach ($client->run('UNWIND range(1, 9) as x RETURN x') as $item) {
57
58
echo $item->get('x');
58
59
}
59
60
```
60
-
will echo `123456789`
61
+
will echo `123456789`.
61
62
62
63
The Map representing the Record can only contain null, scalar or array values. Each array can then only contain null, scalar or array values, ad infinitum.
63
64
64
65
## Diving Deeper
65
66
66
67
### Running multiple queries at once
67
68
68
-
You can run multiple statements at once by simple wrapping a bunch of statements in an iterable object and passing it to the `runStatements` method.
69
+
The `runStatements` method will run all the statements at once. This method is an essential tool to reduce the number of database calls.
Custom injections can be wrapped around a callable for lazy initialization as can be found in the example above.
144
+
Wrapping the injections in a callable will enforce lazy initialization.
144
145
145
146
## Final Remarks
146
147
147
148
### Filosophy
148
149
149
-
This client tries to strike a balance between extensibility, performance and clean code. All classes are marked final but where there is an interface, injections and decorators can be used.
150
+
This client tries to strike a balance between extensibility, performance and clean code. All elementary classes have an interface. These provide infinite options to extend or change the implementation.
150
151
151
-
I also chose not to implement custom resultsets but use the php-ds extension or polyfill instead. This is because these datastructures are a lot more capable than I will ever be able to make them. Php ds has a consistent interface, works nicely with psalm, has all features you can really want from a simple container and is incredibly fast.
152
+
This library does use any custom result classes but uses php-ds instead. These data structures are competent, flexible and fast. It furthermore provides a consistent interface and works seamlessly with other iterables.
152
153
153
-
Flexibility is maintained where possible by making all parameters iterables if they are a container of sorts. This means you can pass parameters as an array, \Ds\Map or any other object which implements the \Iterator or \IteratorAggregate. These are all valid:
154
+
Flexibility is maintained where possible by making all parameters iterables if they are a container of sorts. This means you can pass parameters as an array, \Ds\Map or any other object which implements the \Iterator or \IteratorAggregate. These examples are all valid:
0 commit comments