Ignace Nyamagana Butera's Avatar

Ignace Nyamagana Butera

@nyamsprod.com

Software developer. Creator of PHP centric package like league/csv, league/uri and bakame/http-structured-fields. Sponsor me at http://github.com/sponsors/nyamsprod

198
Followers
22
Following
83
Posts
29.11.2023
Joined
Posts Following

Latest posts by Ignace Nyamagana Butera @nyamsprod.com

I do not think they are forgotten they just have a bad reputations... nuance. I know about them but if I stumble on them during a codebase review they will be the first I ask to refactor to a more maintainable and readable code.

02.03.2026 20:17 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - bakame-php/http-cache-status: Cache-Status HTTP Response Header Field Cache-Status HTTP Response Header Field. Contribute to bakame-php/http-cache-status development by creating an account on GitHub.

A straight forward package in PHP to parse, manipulate and generate The Cache-Status HTTP Header Field. github.com/bakame-php/h... #php #http-cache-status #http-structured-fields

12.02.2026 10:10 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
aeris (@aeris) C’est qui qui a fuitΓ© aujourd’hui ? C’est La Carte Avantage Jeune https://bonjourlafuite.eu.org/#La%20Carte%20Avantage%20Jeune-2026-02-09

firefish.imirhil.fr/notes/aijate...

10.02.2026 12:17 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Dealing with a PHP BC break | nyamsprod

nyamsprod.com/blog/dealing... a new blog post explaining the new fetures in the #PHP #URI Toolkit but also encourage developers to participate in shaping the future of PHP

17.01.2026 11:44 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
This example show the usage of the new QueryString::compose method with the new QueryComposeMode Enum.  It highlights the different ways to compose an query string to better migrate between the BC breaks in http_build_query  behaviours .
the QueryComposeMode::Native mode just encode using http_build_query so it is PHP version dependent.

This example show the usage of the new QueryString::compose method with the new QueryComposeMode Enum. It highlights the different ways to compose an query string to better migrate between the BC breaks in http_build_query behaviours . the QueryComposeMode::Native mode just encode using http_build_query so it is PHP version dependent.

I just released version 7.8.0 of all my #PHP #URI packages. The new version adds support for BackedEnum everywhere, improve string coercion and allow migrating and mitigating the BC breaks introduced in http_build_query in #PHP8.4
full changelog github.com/thephpleague...

16.01.2026 17:01 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Release version 9.28.0 Β· thephpleague/csv Added EnumFormatter to format Enum for CSV serialization Deprecated None Fixed None Remove None This is the last version supporting PHP8.1

Last release of the year #CSV github.com/thephpleague... also last release which supports #PHP8.1 . It adds Enum formatting support on writing

27.12.2025 19:51 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
The picture shows some of the new features and fixes added to the package. Like the public Redact API and the improved path modification. see more on the documentation website

The picture shows some of the new features and fixes added to the package. Like the public Redact API and the improved path modification. see more on the documentation website

League URI Toolkit 7.7.0 is released. πŸŽ‰
- It fixes a regression introduced in version 7.6.0
- adds a redact URI components API via the Modifier class
- Improve host parsing and host handling

Learn more on the uri.thephpleague.com documentation website. #PHP #URI #OSS

08.12.2025 15:46 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

This is now live and for everyone to use just do `composer require league/uri-polyfill league/uri-component` and you will be good to go with version 7.6

18.11.2025 15:05 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I am very happy to announce that the League #URI toolkit for #PHP developers 7.6 has been released!
This release includes a new uri-polyfill package, a new URN object, a new FragmentDirectives object and tons of improvements please check the uri.thephpleague.com for more information

18.11.2025 12:48 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Create a Calendar in PHP using League Period Create a Calendar in PHP using League Period. GitHub Gist: instantly share code, notes, and snippets.

Also I remember creating this Calendar object with Period based on an article from your team πŸ˜€
gist.github.com/nyamsprod/c1...

18.11.2025 10:57 πŸ‘ 4 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
period/src/Period.php at d1d83adc60e2f82ace9cb8004552cc8a8c1b5947 Β· thephpleague/period PHP's time range API. Contribute to thephpleague/period development by creating an account on GitHub.

I did this for the Period package and it works like a charm
github.com/thephpleague...

18.11.2025 10:55 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
The League\Uri\Modifier class wraps any URI object and perform the correct modification on the wrapped URI. After any applied modification you can access the changed URI using the Modifier::unwrap() method.
The method will always return an URI of the same instance of the one you give to the Modifier::wrap method.
The Modifier class works for League Uri own URI class but also for PSR-7 UriInterface implementing classes and PHP's new native URI classes.

The League\Uri\Modifier class wraps any URI object and perform the correct modification on the wrapped URI. After any applied modification you can access the changed URI using the Modifier::unwrap() method. The method will always return an URI of the same instance of the one you give to the Modifier::wrap method. The Modifier class works for League Uri own URI class but also for PSR-7 UriInterface implementing classes and PHP's new native URI classes.

Here's a sneak peak at what you will be able to do with version 7.6 of the PHP league uri toolkit.

The toolkit adds support for the new PHP URI extension and gives you a nice API to work with URI in PHP.

learn more on uri.thephpleague.com

#PHP #URI #RFC3986 #WHATWGURL

29.10.2025 16:36 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 1
The image highlights the addition of import definition for PHP new native URI extension in league/uri codebase. This extension will always be available when PHP8.5 is released and support for them is being added to league/uri.

The image highlights the addition of import definition for PHP new native URI extension in league/uri codebase. This extension will always be available when PHP8.5 is released and support for them is being added to league/uri.

Finishing adding these imports everywhere in league/uri codebase version 7.6 is almost ready!! #PHP #URI #OSS
#thephpleague

24.10.2025 14:15 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
The league URI toolkit has a new package ready to be released named uri-polyfill and it brings PHP's new URI extension to PHP8.1+ version

The league URI toolkit has a new package ready to be released named uri-polyfill and it brings PHP's new URI extension to PHP8.1+ version

There's a new league/uri package in town guess which one it is ? uri.thephpleague.com
It will be release with version 7.6 of all the other packages πŸ₯³ #PHP #URI #polyfill special thanks to github.com/TimWolla, github.com/kocsismate and github.com/TRowbotham for the help and support

15.10.2025 08:16 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
All the current named constructors are being deprecated and replaced by 2 simple named constructors that are easier and more powerful to work with.
For instance Reader::createFromString is replaced by Reader::fromString
and all the other methods are replaced by the more easy to use Reader::from.

All the current named constructors are being deprecated and replaced by 2 simple named constructors that are easier and more powerful to work with. For instance Reader::createFromString is replaced by Reader::fromString and all the other methods are replaced by the more easy to use Reader::from.

Coming in the next version of league/csv named constructors simplification. All the current named constructors are deprecated in favor of just two. which will simplify the user choice and improve DX #csv #php #oss #thephpleague Read the doc for more informations csv.thephpleague.com/9.0/connecti...

14.10.2025 20:12 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
You load a CSV written in french iso-8895-15 and using the ";" as delimiter
You first load the CSV document. 
Then using the stream feature you convert on the fly the document into UTF-8 using mb_string extension. 
You convert and store the CSV document as a NDJson file using a list with a header. Last but not least you convert the strings into integer where it makes sense using the JsonConverter formatter capabilities.

You load a CSV written in french iso-8895-15 and using the ";" as delimiter You first load the CSV document. Then using the stream feature you convert on the fly the document into UTF-8 using mb_string extension. You convert and store the CSV document as a NDJson file using a list with a header. Last but not least you convert the strings into integer where it makes sense using the JsonConverter formatter capabilities.

Coming in the next minor version of #LeagueCSV the JsonConverter #ndjson support is improved you can now do the following #php #csv #oss

26.09.2025 16:05 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Modern API to process URIs in PHP - URI Modern API to process URIs in PHP

New minor versions of the league/uri packages are coming in a couple of weeks. They will contain new features and deprecations. Please head over the documentation site or play around with the dev-master and report bugs or regressions now. #PHP #URI #OOS uri.thephpleague.com

25.09.2025 21:30 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Dealing with Warnings in PHP, the Right Way | nyamsprod

PHP warnings:
Sometimes harmless 🀷
Sometimes critical πŸ’₯
Always annoying πŸ˜…

My fix: a Warning class to cloak or trap them, once and for all.

nyamsprod.com/blog/dealing...

#php #warnings #error_handling

13.09.2025 07:07 πŸ‘ 0 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
A fluent, unit-aware PHPUnit helper for asserting profiler metrics. Straightforward to use by adding a simple trait to your PHPUnit test class. And Since all the data are in bytes or nanoseconds you can assert using other units and they will be automatically converted into the proper unit.

A fluent, unit-aware PHPUnit helper for asserting profiler metrics. Straightforward to use by adding a simple trait to your PHPUnit test class. And Since all the data are in bytes or nanoseconds you can assert using other units and they will be automatically converted into the proper unit.

A new version of #stackwatch is out with tons of new features, fixes and removal for instance the new version nows comes with a PHPUnit helper traits to ease testing callback or method performances. See more on the documentation website bakame-php.github.io/stackwatch/ #php #profiling #OOP

05.09.2025 20:19 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
The Warning class is a utility for controlling PHP warnings during the execution of callbacks. It provides two static methods:

trap() β€” converts any PHP warning (E_WARNING or E_USER_WARNING) emitted by the callback into an ErrorException, allowing them to be caught and handled like regular exceptions.

cloak() β€” suppresses warnings emitted by the callback, effectively hiding them during execution.

Both methods ensure that the original error handler is restored after the callback executes, and they propagate any exceptions thrown directly by the callback.

The Warning class is a utility for controlling PHP warnings during the execution of callbacks. It provides two static methods: trap() β€” converts any PHP warning (E_WARNING or E_USER_WARNING) emitted by the callback into an ErrorException, allowing them to be caught and handled like regular exceptions. cloak() β€” suppresses warnings emitted by the callback, effectively hiding them during execution. Both methods ensure that the original error handler is restored after the callback executes, and they propagate any exceptions thrown directly by the callback.

I hope theses examples explain the goal. To have total control over the functions behaviour.

19.08.2025 08:57 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

That what does it wraps them

18.08.2025 23:44 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

`fopen` returns false on error ... so fopen is a code smell is that what you are saying πŸ€” and that's the case for most php internal functions. so the solution is for a known behaviour of PHP not for userland code where I do not expect developer to use E_USER_WARNING + false but rather exceptions

18.08.2025 21:44 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

because the method already return false why would I want to know twice that there's a error ... If the function was returning an Error like a ValueError I would not have to suppress anything. I already know I have false returned it's twice the same information for no real added value.

18.08.2025 20:38 πŸ‘ 0 πŸ” 0 πŸ’¬ 2 πŸ“Œ 0

A code smell ? Why ?

18.08.2025 19:06 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
This PHP trait safely executes a callback while suppressing PHP warnings and notices during its execution.

Useful for calling functions or methods that may trigger non-critical errors without interrupting program flow like most PHP internal functions.

This PHP trait safely executes a callback while suppressing PHP warnings and notices during its execution. Useful for calling functions or methods that may trigger non-critical errors without interrupting program flow like most PHP internal functions.

I usually hate traits but I hate even more the PHP error control operator so I made this trait #PHP #trait

18.08.2025 09:32 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Preview
bakame-php/stackwatch A minimalist multi-metric PHP Profiler. Contribute to bakame-php/stackwatch development by creating an account on GitHub.

I created a new package called #stackwatch and If someone is interested I have 3 open issues on #stackwatich which I need help for github.com/bakame-php/s... to tag the first stable version.

Of course feel free to add more issues if you test the package #php #profiling

15.08.2025 09:39 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Periodic reminder: stop using boolean as options flags in #PHP use Enum instead. Boolean flags are hard to read and to remember and lead to tricky bugs and requiring a trip to the method/function definition, Enum are explicit and readable and offer granularity instead of a simple yes/no answer

13.08.2025 11:34 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
PHP: rfc:data_encoding_api

I have updated my RFC around data encoding in PHP to allow users to migrate to the new API. wiki.php.net/rfc/data_enc... comments and remarks are welcomed #PHP #RFC #base64 #base16 #base58 #base32

03.07.2025 14:41 πŸ‘ 0 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - bakame-php/aide-profiler: A minimalist multi-metric PHP Profiler A minimalist multi-metric PHP Profiler. Contribute to bakame-php/aide-profiler development by creating an account on GitHub.

github.com/bakame-php/a... is almost stable if you could give a spin an report issues or improvement it would be nice. It is a nice non brainer straightforward profiler in PHP which seats between Xdebug and you double call to microtime πŸ˜‚ Give it a shot. #PHP #profiler #OSS

03.07.2025 12:48 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - bakame-php/aide-profiler: A simple profiler in PHP A simple profiler in PHP. Contribute to bakame-php/aide-profiler development by creating an account on GitHub.

An entry level package to profile your code it's not #xdebug but it does the job needed github.com/bakame-php/a... #php #profiling #memoryusage #microtime

26.06.2025 17:50 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0