Elektrine
Log in Register
Paige Chat Timeline Gallery Friends Email Drive DNS Private DNS Domains VPN Kairo Nerve
Remote

ignace nyamagana butera

@nyamsprod@phpc.social
mastodon 4.7.3
  • Open on phpc.social

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

133 Followers
39 Following
45 Posts
Joined June 08, 2020
Website:
https://nyamsprod.com
Github:
https://github.com/nyamsprod
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2w ago
Replying to
@timwolla@phpc.social @derickr@phpc.social weekend reading
2
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2w ago
Replying to
@derickr@phpc.social Indeed Now I need to find/write the greatest pitch ever written 😂
1
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 3w ago
@timwolla@phpc.social @derickr@phpc.social https://bakame-php.github.io/tokei/1.0/duration/ I hope this can give you more ideas for PHP8.7 around duration 😉
Duration - Tokei
Working with duration and local time in PHP

Duration - Tokei

A framework-agnostic PHP library to handle duration, time, circular 24-hour intervals, and interval sets, without timezone complexity.

1
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
#PHP I've notice that I barely use __toString nowadays. I came to realise that there is no one true single string representation for anything. So __toString is a bad micro/early optimisation that should be avoided. It is conceptually a bad idea. I prefer toWhateverRepresentationString. it might be a bit longer to type but it won't bite you in six months. PS: I have the share the same thoughts for toArray.
11
2
3
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
For Tokei I found myself having to type this everywhere. function method(Duration|DateInterval|Interval|Task|TimeDuration $duration) Here's me again wishing for type alias in #PHP I do not really care about generics and yes I know that type alias is hard in #PHP . PS: For those with eagle eyes yes next Tokei release will support the upcoming PHP8.6 Time\Duration class out of the box
2
0
3
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 3mo ago
Replying to
@asgrim@phpc.social vs Symfony ... who will win 😂
3
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
@timwolla@phpc.social used your proof of concept as a basis to add support for Time\Duration in my Tokei package. I will wait for the vote result to see if I need to use Duration::sub or Duration::subtract :) ... Currently using the later. https://github.com/bakame-php/tokei/blob/main/lib/Time/Duration.php
github.com
2
2
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@timwolla@phpc.social https://github.com/bakame-php/tokei/blob/main/src/DivisionResult.php refactored looks nice 💯
GitHub

tokei/src/DivisionResult.php at main · bakame-php/tokei

Local time, duration and interval primitives without timezone complexity - bakame-php/tokei

2
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
The Duration class also introduces a new modulo() method, complementing dividedInto() by providing an easy way to retrieve the remainder of a duration division. This is especially useful when dealing with circular ranges. #duration #localtime #php #circular-range https://bakame-php.github.io/tokei/
Tokei. Duration, Local time and interval primitives without timezone complexity - Tokei
Working with duration and local time in PHP

Tokei. Duration, Local time and interval primitives without timezone complexity - Tokei

A framework-agnostic PHP library to handle duration, time, circular 24-hour intervals, and interval sets, without timezone complexity.

2
0
1
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 3mo ago
Replying to
@asgrim@phpc.social liar 😂
2
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@roave@mastodon.social @ocramius@mastodon.social since when do people actually discuss on LinkedIn asking for a friend who go there only once every February the 30th
1
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ocramius@mastodon.social the secret plan from FIFA we want 64 teams for the next World cup to make sure Italy will play and now UEFA is against that why 😂 😂😂😂 #fridayfun #football
1
2
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago

The next #tokei release brings a complete rewrite of its `Duration` and `Time` classes.

The new `Duration` implementation aligns with the upcoming `Time\Duration` class introduced in PHP 8.6, while `Time` is now represented internally as the elapsed duration since midnight.

These changes significantly simplify the internal implementation and provide a stronger foundation for the library.

This might be the last release before the first stable version. 🚀

#PHP #OOP

phpc.social
1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ocramius@mastodon.social good strategy flooding my zone so I won't see all the Laravel announcements this week keep on the good job 👍🏾
1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ocramius@mastodon.social too much blogging at once
1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Tokei 0.2.0 introduces support for identified Temporal Value Objects: temporal values that can carry identifiers and preserve their meaning through operations. For instance the following example shows how task identifiers are retained during a union operation. #duration #localtime #php #identifier
1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@Crell@phpc.social @ramsey@phpc.social I still love me some good ol' readonly better known as writeOnce and forget about it 😈 . And now you have an instance method not a named constructor ... which is another issue in design IMHO
1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ramsey@phpc.social I am 6 hours before holiday it will be very difficult to do so 😂
1
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to

@heiglandreas@phpc.social I currently favour using format() and fromFormat() methods on my objects. with a Format Enum which list the most common use case in my domain and expose all the properties so that you can in your own domain define other string representations if needed via a Formatter or a Builder. I would argue that the best trade off I have for now 🤷‍♂️ . But the main take-away is it has to be explicit and __toString is everything but that.

1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 3mo ago
Replying to
@asgrim@phpc.social no-one did but this is one of their mantra in their ecosystem https://github.com/symfony/symfony/pull/36876
github.com
1
2
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 7mo ago

Interesting fact that no one cares about Laravel13 soon to be released will require PHP8.3 minimum whereas the latest Symfony8 requires PHP8.4 different framework, different strategy I presume. But still, I would have expected an alignment of L13 to PHP8.4 🤷 #PHP guess I was wrong

phpc.social

PHP Community on Mastodon

4
0
1
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 5mo ago

Did you know that you can map #CSV row to DTO using league/csv ? in the next version you will be able in #PHP8.5+ to use a static closure to allow specific casting rules

phpc.social
2
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 6mo ago

I feel that at some point in time I will have to do either write a long post or create a talk around handling #deprecations in #PHP https://github.com/thephpleague/csv/issues/574#issuecomment-4115906017 I regularly get those tickets and conversation and I feel the community does not know what a deprecation is... am I wrong or am I wrong 🤔

phpc.social
2
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 6mo ago

For the next League URI major version I will merge the uri and the uri-components packages but how should the merge occurs:

Should I keep the Components subnamespace or get rid of it completely 🤔 .

Keeping it reduces BC break but then postpone to the next major version some changes.

Removing the Component namespace adds a bigger BC break BUT simplify greatly the package usage for newcomers 🤷 So should I

1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 7mo ago

#funfacts I updated the league/uri mono repo to use #PHPStan v2 instead of v1 currently for fun locally. The package is developed with level max.

The result from a clean pass in v1 I got more than 200 errors in v2 🤯 .

The question is should I really clean them all 🤔

phpc.social
1
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 7mo ago

I just discovered I never published my http-cache-status package for PHP 😆 ... now it is done

https://packagist.org/packages/bakame/http-cache-status enjoy and happy coding !!

#http-structured-field #headers #php

packagist.org
1
0
1
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 22mo ago

How to correctly use the Deprecated attribute according to @nicolasgrekas@phpc.social it even give a "beautiful" error log message when E_USER_DEPRECATED is not silenced

4
0
2
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ramsey@phpc.social the cache is not reliable. I have a small test suite. Each PHPUnit test file passes without any issue but when I run the full test suite in one command some errors appears because the "singleton" is no longer shared and unique
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@timwolla@phpc.social I think I can improve it a bit more by not relying on is_int but on intdiv and PHP_INT_MAX instead
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2w ago
Replying to
Or I should submit a talk around it ... is there a PHP group near Brussels looking for a speaker ?
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@timwolla@phpc.social updated the implementation with your different remarks
0
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago

@timwolla@phpc.social @derickr@phpc.social https://github.com/symfony/polyfill/pull/642/changes added tim as co-author since I built the polyfill based on his work. I will update the implementation once the php implementation tests land on php source code.

github.com
0
0
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ramsey@phpc.social final class readonly Duration { public function __construct(public $microseconds) {} public static function zero(): self { static $instance = null; $instance ??= new self(0); return $instance; } } The "zero" instance is a singletion declared once and because of the readonly it is safe to use, only once instance will be created
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to

@velkuns@phpc.social this is a recurring question that I get when people look at my packages I will TL;DR ir with:

  • ease of tests discovery
  • ease of maintenance
  • uniformity in package configuration

But that's just my opinion. And it depends on the package and on how many people work on it I guess (even though I do not really buy that last argument)

PS: Last time I've checked TypeScript does the same but maybe they changed in the meantime (I do not use TypeScript).

0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 6mo ago

@timwolla@phpc.social I still find it fascinating that base64_encode and base64_decode are defined under the URLs extension 🤷
https://www.php.net/manual/en/book.url.php

php.net
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@timwolla@phpc.social ended up adding this small helper https://github.com/bakame-php/tokei/blob/main/lib/Time/Duration.php#L109-L115
github.com
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
Replying to
@ramsey@phpc.social final class Duration { public int $microseconds { get => $this->ticks } public function __construct(private readonly $ticks) {} public static function zero(): self { static $instance = null; $instance ??= new self(0); return $instance; } } because of the hooks I loose the readonly property on the class and "singleton" nature ... now the in-memory cache no longer works it is better to return each time a new instance
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
#PHP I am happy to announce the immediate release of tokei 0.2.0 — codename Botan 🌸 This release brings new features, bug fixes, breaking changes, and an official documentation website: https://bakame-php.github.io/tokei/ Tokei is a small, low-level PHP package for working with local time, durations, and intervals. Try it out and share your feedback through an issue or PR: https://github.com/bakame-php/tokei If you find it useful, leave a ⭐ or consider sponsoring the project. Thanks for your support! 😉
Tokei. Duration, Local time and interval primitives without timezone complexity - Tokei
Working with duration and local time in PHP

Tokei. Duration, Local time and interval primitives without timezone complexity - Tokei

A framework-agnostic PHP library to handle duration, time, circular 24-hour intervals, and interval sets, without timezone complexity.

0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2w ago
Replying to
If I had the time and energy I would write about the 7years journey between me opening the issue and resolving the it after an "more or less" unrelated bug in the expansion algorithm was fixed. And why extraction does not use regexp 🤷🏽
0
1
0
0
Open post
ignace nyamagana butera @nyamsprod@phpc.social
· 2mo ago
#PHP I've been toying around with hooks lately, and I have mixed feelings about them. On the one hand, they can be quite handy in certain situations. On the other, the trade-off of losing the readonly modifier for the entire class is a real headache. For instance, you loose, in memory cache inside your class. Not sure if I like or dislike this consequence. And I am sure they are other things being lost with it
0
1
0
0
Back
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

I2P eepsite

j6b6cyk6gjmepjih7jjadxgxvvf3lzzujljuu2v4biemzpg3naya.b32.i2p

Platform

  • Email
  • Chat
  • Timeline
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ
  • Lite (no JS)

Legal

  • Terms of Service
  • Privacy Policy
  • Transparency Report
  • Report Abuse
  • Warrant Canary
  • VPN Policy

Support

  • support@elektrine.com
  • Report Security Issue
Mail client setup IMAP mail.elektrine.com:993 POP3 mail.elektrine.com:995 SMTP mail.elektrine.com:465
© 2026 Elektrine. All rights reserved. Server: 03:01:24 UTC