Comments (10)
@sagikazarmark very fair criticism of the interface, I wholeheartedly agree. On the options: I feel extending another interface makes most sense, I for now struggle with the name.
from fxmlrpc.
Callable and Configurable interface are probably more generic.
from fxmlrpc.
Further thinking about it: I think that the main interface should be the one containing call and multicall. So it should be ClientInterface. Of course, it is a BC breaking change.
from fxmlrpc.
I would do something like this:
interface CallClientInterface
{
public function call(string $method, array $arguments): mixed;
}
interface MulticallClientInterface
{
public function multicall(): MulticallInterface;
}
interface ClientInterface extends CallClientInterface, MulticallClientInterface
{
}
interface HandlerInterface
{
public function onError(callable $handler): HandlerInterface;
public function onSuccess(callable $handler): HandlerInterface;
}
interface MulticallInterface extends HandlerInterface
{
public addCall(string $methodName, array $params = [], callable $onSuccess = null, callable $onErrors = null): MulticallInterface;
public function execute(): array;
}
What do you think?
from fxmlrpc.
Not sure I understand the reason of having a separate handler interface. Other than that it looks good.
from fxmlrpc.
Yeah, good point. Maybe calling it MulticallBuilderInterface
and moving all of them into the same interface is the nicer option. At the end it is a builder alike problem that we are dealing with.
from fxmlrpc.
Yeah, builder sounds good.
from fxmlrpc.
@sagikazarmark can you have a look?
from fxmlrpc.
Looks good.
from fxmlrpc.
Merged into develop
from fxmlrpc.
Related Issues (20)
- Explicit empty() HOT 1
- Non-XML response returns null, no way to access response HOT 3
- Confusing $isFault in Client HOT 2
- Can't parse XML the $xmlParser->parse($xmlString) return null on valid XML HOT 1
- Ivory is deprecated in favor of php-http HOT 5
- Uncaught RuntimeException: Puli Factory is not available HOT 1
- Make zendframework/zend-diactoros, php-http/message and php-http/guzzle6-adapter dependencies HOT 2
- Use php-cs-fixer HOT 1
- Finalize exported serialization package HOT 7
- Installation HOT 2
- 6MB XML file HOT 2
- Cannot install guzzle6 adapter HOT 1
- Package not updated @packagist HOT 1
- Slow speed tests HOT 1
- zend-diactoros is abandoned HOT 3
- Implement PSR-17/18 adapter for direct connection to Guzzle 7
- PHP 8 support HOT 9
- array with one integer key not zero converted to array and not to struct HOT 4
- [Bug] Implementation of PSR 17 Factories breaks requests
- New tag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fxmlrpc.