Skip to content

Conversation

@samsonasik
Copy link
Owner

@samsonasik samsonasik commented Dec 4, 2025

Add new Finder::partition() functionality:

It splits data into 2 arrays: matching and non-matching, instead of 2 loops to get match and non-match, it just use single iteration, and already get both matching and non-matching data.

The valid example for this:

<?php
// Import CSV data and separate valid/invalid rows in one pass
$csvRows = $csvParser->parse('users.csv');
[$validUsers, $invalidUsers] = Finder::partition(
    $csvRows,
    fn($row) => $validator->validate($row)->isValid()
);

// Bulk insert valid users
$userRepository->bulkInsert($validUsers);

// Generate error report for invalid rows
$reportGenerator->createErrorReport($invalidUsers);

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c45927f) to head (6e29b11).
⚠️ Report is 39 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #33   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        45        63   +18     
===========================================
  Files              4         5    +1     
  Lines            122       173   +51     
===========================================
+ Hits             122       173   +51     
Flag Coverage Δ
tests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samsonasik samsonasik merged commit 099b1f6 into main Dec 4, 2025
3 checks passed
@samsonasik samsonasik deleted the add-finder-partition branch December 5, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants