Comments (10)
OK I understand, no problem! I'll look into it when I have a bit of time.
Sponsoring is greatly appreciated though.
from collection.
Hi there!
Super cool idea !
Are you willing to submit a PR?
Thanks
from collection.
Hi Pol, thanks for quick response!
Great to hear that!
Well, currently I have zero experience with functional programming and I doubt if this task is feasible for me. At least for now, this library looks like a black box with some magic inside. Not because something is wrong with it, - conversely it is me who is FP freshmen.
Thus, there will be no pull request from my side soon.
from collection.
Dear @rela589n,
I've implemented the feature in #314.
Would you be OK to test it?
Thanks!
from collection.
It would be nice
Though, I'm not sure where to start from. I assume at first I should check documentation page https://loophp-collection.readthedocs.io/en/latest/pages/tests.html , but what should I do then? Maybe you could point out some similar test(s) examples I can inspire implementation from. And "Static analysis tests" - something really new to me.
Thank you
from collection.
You could simply checkout the branch containing the new operation and create a simple file in the root of the project test.php
, containing:
<?php
declare(strict_types=1);
namespace Test;
use loophp\collection\Collection;
require_once __DIR__ . '/vendor/autoload.php';
$collection = Collection::fromIterable([1, 2, 3])
->plus([4, 5, 6])
->plus(['a' => 'a']);
foreach ($collection as $i => $r) {
var_dump($r);
}
So that you can play with the new operation and see if it corresponds to what you were expecting.
from collection.
I've checked it.
Works like a charm! It does exactly what is expected.
If you wish to add some unit tests, as a starting point you may use the following test case from my branch
feat/add-plus-operation...rela589n:loophp-collection:feat/add-plus-operation
Thank you!
from collection.
Thanks!
I'm using a specific workflow for tests based on data providers.
I made a new commit for tests, find it here: 9f29100
What would really help me is to create the documentation and the code example.
from collection.
Since this issue has not had any activity within the last 5 days, I have marked it as stale.
I will close it if no further activity occurs within the next 5 days.
from collection.
@rela589n Are you willing to contribute to the documentation of the associated PR ?
from collection.
Related Issues (20)
- `Partition` Operation - Awkward to use? HOT 18
- Add find/search/where/single/firstWhere method HOT 23
- Modify `all` operation to prevent data loss HOT 6
- PHPStan 1.0 upgrade HOT 1
- Typed collection support HOT 17
- API oddities HOT 6
- Reduction operations should return a single value HOT 9
- Issue with cache and fromCallable HOT 13
- PHPStan reporting an error for missing optional parameters HOT 6
- [Question] Rename Collection interface to CollectionInterface HOT 1
- Dependency Dashboard HOT 51
- Collection interface doesn't extend Countable HOT 9
- Weird interplay between Collection and PDO result set HOT 13
- Palm cannot infer types when using some operations HOT 4
- Unexpected behavior of pair operation over empty collection HOT 1
- [Feature request] Implement stable sorting HOT 12
- Memory size exhausted for large collections HOT 15
- Issue with distinct HOT 3
- Distinct is slow 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 collection.