@nyamsprod@phpc.social
@nyamsprod@phpc.social avatar

nyamsprod

@nyamsprod@phpc.social

Software developer. Creator of PHP centric package like league/csv and league/uri. Sponsor me at github.com/sponsors/nyamsprod

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

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 I wish I could really

nyamsprod,
@nyamsprod@phpc.social avatar

@derickr the best I could do is maybe creating the RFC and probably help with building the test suite but my knowledge of C is really not that great. Might be a goal for 2024 (talking about base32) type alias requires I believe a deeper knowledge of PHP internals that I really do not have

nyamsprod,
@nyamsprod@phpc.social avatar

@Girgias @derickr here's a simple proposition not entirely flesh out. Still rough but a general idea to think about let me know your thought https://gist.github.com/nyamsprod/8a5cf21c136952a46ec8836f29738c82

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.

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

my last blog post on how I was able to parse and manipulate in https://nyamsprod.com/blog/extracting-data-from-html-table-in-php/

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

new release for league\csv https://github.com/thephpleague/csv/releases/tag/9.11.0 #php #csv #thephpleague

Collections methods are added to the Reader class to improve DX as well as the ability to format the records prior to accessing them using the same technique already present on the Writer class.

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

@schnoop the missing new has been added 👍

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

class A implements IteratorAggregate {
protected string $foo = 'bar';
public function getIterator(): Traversable {
yield from ['bar' => 'baz'];
}
public function q(): string {
return http_build_query($this);
}
}
echo (new A())->q();

what will be display ?

nyamsprod,
@nyamsprod@phpc.social avatar

And the answer is 3/ foo=bar. http_build_query when the input is an object uses internally get_object_vars. In the current context only the protected property will be seen and used. #php #phpquiz #answerphp

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

new release league uri components

We've Added a PHP implementation of see https://uri.thephpleague.com/components/7.0/urlsearchparams/

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

what will be display ?

<?php

echo http_build_query(["x" => +1E+14]);

nyamsprod,
@nyamsprod@phpc.social avatar

And the default correct response is 4 but if you change the precision ini settings of your PHP installation then the response 2 can also be valid and 4 becomes invalid.

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

Sometimes a documentation page provides more in depth into a topic than an actual blog post. I find the documentation around feature in league/uri to be just that. Informative, to the point with best practices rolled into one

https://uri.thephpleague.com/interfaces/7.0/idn/

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

For those who are interested here's the promised blog post around the URI package release from yesterday and how and why it was built the way it is

https://nyamsprod.com/blog/uri-packages-reloaded/

Feedback are welcomed

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

with the new version of league/uri package you are able to do the following without having to think how the URL got parse normalized and all. Only the result matter. You focus on your business rules , the package takes care of all the specifications 😎

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

I'm happy to announce the release of league/uri v7 . Please head to the documentation website to see what's new and what has changed.

The goal was to make the packages easier to install, use and abuse. Hope you like it
https://uri.thephpleague.com/

I will try to share some notes on the new features and the new approach to the packages

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

So I am currently doing some #DDD documentation driven development with League\Uri v7. Every time I re-read the documentation to see if all is OK before release I found ways to improve the doc example which leads to updating the public API which means refactoring the code adding tests and changing the doc. #php #thecircleoflife

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

#php #csv
#thephpleague
the latest league/csv release 9.10.0 adds support for the long awaited feature to write new CSV rows fully enclosed 🥳🥳
https://github.com/thephpleague/csv/releases/tag/9.10.0

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

for the next major release of league/uri the requirements for installing ext-intl will be removed. You do not need the extension to use the package. However if you are using i18n domains then yes you are require to have either the extension or a polyfill in place else the library will throw. This is not an ideal solution but all the other solution I thought about are ... suboptimal unless proven wrong. #php #uri #url #i18n #domainnames #host

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