Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

nyamsprod, to php
@nyamsprod@phpc.social avatar

I have a question regarding dependencies and semver for maintainers. let's say I have package B which depends on package A.

If I move a class from package A to package B does this constitute a BC break for A and B or only for A ?

alessandrolai,
@alessandrolai@phpc.social avatar

@nyamsprod as other have said, definitely a BC for A due to class removal. And due to the inverse relation, you don't even have an easy migration path (like with a plain class_alias or an extension)... 😔

nyamsprod,
@nyamsprod@phpc.social avatar

@alessandrolai I have an easy way out I can bump package A to the next major and keep B in it's current version and move the class there effectively embracing the BC break BUT it makes my monorepo ugly to work with until I bump package B to the same version as package A and I need in the meantime fin a good git-split tool able to handle 2 majors release ... that's the complex part

nyamsprod, (edited ) to php
@nyamsprod@phpc.social avatar

I know that ship has already sailed but it would have been nice if the spread operator on iterable did follow the semantic of iterator_to_array with the preserve keys argument being true

For context: https://3v4l.org/AKEbB

zimzat,
@zimzat@mastodon.social avatar

@nyamsprod It has the same behavior as array_merge, which makes it very consistent 1-to-1 behavior.

I've seen the default iterator to array key behavior bite people more often, especially when doing iterator to array on multiple yield/from generators.

nyamsprod,
@nyamsprod@phpc.social avatar

@zimzat I get the reasoning behind but would have been "cool" nice to have the iterator_to_array behaviour when working with iterator it seems more appropriate

nyamsprod, to random
@nyamsprod@phpc.social avatar

league/csv 9.16.0 relesed with an improved query builder for CSV https://github.com/thephpleague/csv/releases/tag/9.16.0

I also added a smal blog post about the status of the library where it comes from and where it is right now

https://nyamsprod.com/blog/modernizing-leaguecsv-api/

nyamsprod, to random
@nyamsprod@phpc.social avatar

@Crell I have a question ? https://github.com/thephpleague/csv/blob/master/src/Operator/Comparison.php I use an Enum in the case because to me the number of Comparison operator is finit BUT there is a case for using a class instead for better type hinting ? What do you think from a DX perspective ?

nyamsprod,
@nyamsprod@phpc.social avatar

@Crell opt to remove any method on the enum and used good old classes. The implementation feels a bit more natural IMHO and is usable outside League\CSV enum are still present but the usage is a bit "hidden"
Everything is defined under League\Csv\Constraint

Crell,
@Crell@phpc.social avatar

@nyamsprod The constraints feel like an unbounded set from the looks of them, so I agree, classes are the better solution than enums in this case.

nyamsprod, to php
@nyamsprod@phpc.social avatar

Coming soon in the next minor release of League\Csv 😍
still ironing the feature that you can already test on the master branch. give it a try
https://csv.thephpleague.com/9.0/reader/statement/#where-clauses

nyamsprod,
@nyamsprod@phpc.social avatar

@derflocki there are a couple reasons why I do not use SQLite. First the package needs no dependencies, two, the feature was already present in the package like 7 years ago I only updated the UX around it and last but not least I seldom encounter CSV that adheres fully to the draft/informal RDC. Hence using the SQLite extension would not solve CSV parsing in real world IMHO.

derflocki,

@nyamsprod Thanks for the explanation!

nyamsprod, to random French
@nyamsprod@phpc.social avatar

@derickr @Girgias I have updated my Draft RFC for base32_encode/base32_decode. Let me know what you think about the new proposal.
https://gist.github.com/nyamsprod/8a5cf21c136952a46ec8836f29738c82

nyamsprod,
@nyamsprod@phpc.social avatar

@derickr @Girgias yes I saw it been a bit busy with work related tasks. Will continue on the implementation next week if all settles down a bit

derickr,
@derickr@phpc.social avatar

@nyamsprod @Girgias That's Ok! Was just making sure that you had seen it.

nyamsprod, to random French
@nyamsprod@phpc.social avatar

Last night I published league/csv version 9.15.0 https://github.com/thephpleague/csv/releases/tag/9.15.0 I hope it will be the first and last release this year (aside any security and bug releases).. I think it will take time for people to adapt to all the new shiny things that landed in the package the past year.

thepanz,
@thepanz@phpc.social avatar

@nyamsprod hope not the last one! ... As I still need to find time to prepare the PR for supporting generics in the object loading tho 😅

nyamsprod, (edited )
@nyamsprod@phpc.social avatar

@thepanz I think this can be considred a fix and nor a new feature AFAIK also I think I already updated the docblocs to this https://github.com/thephpleague/csv/blob/master/src/Reader.php#L455-L466

nyamsprod, to php French
@nyamsprod@phpc.social avatar

When getting an Iterator as returned by a function/method do you expect the Iterator to already be rewinded or not ? Asking because in this assumption is never guaranteed by any contract 🤔

zimzat,
@zimzat@mastodon.social avatar

@nyamsprod @ocramius How are you starting off in an unrewound state? From the user's perspective (based on the example in the issue) the csv hasn't been interacted with yet, so it should be in position 0 still.

If that's an internal implementation detail then perhaps switching out Iterator for IteratorAggregate would be a future change.

nyamsprod,
@nyamsprod@phpc.social avatar

@zimzat @ocramius
For context, the class already exposes the IteratorAggregate interface but the getRecords method is needed for cases where using the interface is not possible (ie if more options are needed to calculate the records)

nyamsprod, (edited ) to random French
@nyamsprod@phpc.social avatar

to honour
@fredbouchery what will be display ? #phpquiz
echo date('Y-m-d H:i:s', strtotime('')), PHP_EOL;

nyamsprod, to php French
@nyamsprod@phpc.social avatar

I wish #PHP had two things and none of them involve generics... I wish it had type aliases and a native base32 encoding/decoding mechanism (in a class or a pair of functions I do not care)

nyamsprod,
@nyamsprod@phpc.social avatar

@derickr @Girgias If we stick with functions a la base64 we then need to add extra variables - the alphabet and maybe the padding character. so that user land can switch the alphabet and/or the padding character as they want PHP would only provide the Hex and Us-Ascii alphabet (those from the RFC)
So for encoding you would have at most 3 parameters and 4 on decode.

nyamsprod,
@nyamsprod@phpc.social avatar

@derickr @Girgias following our last discussion I createed a polyfill using functions only let me know if this is what you had in mind. https://github.com/bakame-php/aide/tree/main/src/Base32
The implementation does not really matter what matter most is the API

nyamsprod, to php French
@nyamsprod@phpc.social avatar

#newrelease #csv #php league/csv 9.13.0 with improvements around deserialization and with a new stream filter to improve support for multibyte delimiters https://github.com/thephpleague/csv/releases/tag/9.13.0

nyamsprod, to php French
@nyamsprod@phpc.social avatar

To Celebrate the 10th anniversary there a new minor release league/csv 9.12.0 with lots of exciting new features is out https://github.com/thephpleague/csv/releases/tag/9.12.0 #csv #php #oss

the main feature being able to convert you CSV records into DTOs

nyamsprod,
@nyamsprod@phpc.social avatar

you will also be able to select columns, rows and cells using https://rfc-editor.org/rfc/rfc7111 #csv #php #rfc7111

The optional header argument from getRecords and getObjects is now a full mapper allowing you to select and rearrange the record.

you can also select the column using the offset or the column name indistinctively
😍 😍

image/png
image/png

nyamsprod, to random French
@nyamsprod@phpc.social avatar

Tomorrow will mark the 10th anniversary of the first commit of what will become league/csv 🥳 If you have something nice to say about the package please RT or reply to this post.

https://github.com/thephpleague/csv/commit/a5b5bcdcaeb19dc0bf671e51cfc0c4fe20297993

nyamsprod, to php French
@nyamsprod@phpc.social avatar

new releases for @thephpleague URI components they are all bump to version 7.4.0 with new features and bug fixes. #uri #oss #php

https://github.com/thephpleague/uri/releases/tag/7.4.0
https://github.com/thephpleague/uri-components/releases/tag/7.4.0

nyamsprod, to php French
@nyamsprod@phpc.social avatar

New PR to add object casting to League\Csv https://github.com/thephpleague/csv/pull/509
Comments/Remarks and suggestions are more than welcome

#csv #php #thephpleague
In all honesty I believe the next minor version of league csv is getting cool new features.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • khanakhh
  • GTA5RPClips
  • osvaldo12
  • magazineikmin
  • mdbf
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • everett
  • Durango
  • JUstTest
  • ngwrru68w68
  • modclub
  • tester
  • tacticalgear
  • cubers
  • thenastyranch
  • cisconetworking
  • ethstaker
  • Leos
  • provamag3
  • normalnudes
  • anitta
  • lostlight
  • All magazines