« first day (3254 days earlier)      last day (1710 days later) » 

7:01 PM
so many frameworks use decorators by compiling classes, Magento 2 is the latest addition, Flow/Neos, oxid, old Shopware versions. It would allow awesome plugin systems
 
+1 on decorators...
Also ... I'm super confused with LDFLAGS in the build system right now ... It looks like we never actually SUBST them...?
 
A challenge would be properties. What happens if we use a decorator and add __get(). Should that intercept all property checks? Or should it behave like if you added it to the base class (and hence not intercept accessable properties)
 
After finally getting around to reading the engine warnings RFC this makes me so sad:
> Rationale: This is generally a bug (and the “Array” string you get is meaningless), but in many cases also not a particularly severe one. Since string conversion exceptions are supported now, we could also promote this to an Error exception, and I'm generally open to that.
That should have been an exception...
 
lol
I still remember the last discussion on that topic, you know ;)
 
?
 
7:09 PM
It's basically the same as what we got here with undefined variables
 
@NikiC You mean our discussion?
 
@PeeHaa mailing list discussion
And I feel way less strongly about array to string than undef vars. Not my hill to die on :P
 
It would have been mine though :(
 
@NikiC Ironically, I'm the opposite
 
7:12 PM
@ircmaxell Probably because I'm bitten by undef vars very often but don't encounter the array to string one much
 
Oh well ¯\_(ツ)_/¯
Guess I will just wait 2 years for that :|
@NikiC The string Array is real though :-)
 
Cant' you just immediately RFC it as soon as this one passes?
 
And terrible behavior
@MarkR I guess I could
 
@PeeHaa If you had told me earlier I could have made a separate vote for that one as well...
 
@NikiC I've been bitten REALLY hard by array to string before.
 
7:14 PM
heh
 
@NikiC We... actually discussed it :P
 
and never really been bitten by undef vars
 
Same to being bitten by array to string.
 
@NikiC it's funny how different people have different experiences :D
 
When I told you I was doing it you told me to just go for an exception right away @NikiC :D
 
7:15 PM
I ended up switching out Symfony's property bag because their get methods all allow returning arrays even though they're documented as string types.
Adding a ?var[]=abc in the URL blew it up
 
@MarkR I guess that is technically correct after conversion to string :D
Anyway. I will just finish the tests and RFC before 8 and see what happens
 
@PeeHaa I guess I did ^^
 
:P
 
Name for a server event handler when a client connects: onConnect, onConnection, onClient, other?
 
onConnect
Was just about to reply on the commit :D
And no I cannot really defend it with a proper argument
Just reads better?
 
7:18 PM
I don't really have a strong opinion…
 
The action is connect not connection
 
Yeah, but the server isn't connecting, it's receiving connections.
 
Probably somebody more englishable has a strong opinion
 
@Trowski depends on the abstraction the event set provides. If it's connection oriented, onConnect seems reasonable. If it's client oriented (and the connection is just a "means" for the client), then onClient.
 
@Trowski The method name does not say what side is connecting though
 
7:20 PM
@ircmaxell It's a websocket server receiving connections, so method is invoked when a client connects.
 
@PeeHaa onClient ?
 
onClient seems pretty reasonable…
 
If the object it's being called on is the one that's connecting in, onConnect, if it's not, if it's some kind of handler, onClientConnection
 
@Trowski then I'd suggest onConnect(), because a single client could connect multiple times, no?
 
with onClientXXX you can add anything else you want without name conflicts
 
7:21 PM
@ircmaxell The server handles many connections, so onConnect is called for each connection.
 
@Trowski yes, but can a client connect twice?
 
@ircmaxell Well, being a websocket server, it's considered a different client.
 
Imo it reads better with a verb
So I would prefer even onClientConnect over onClient
 
Maybe it should be onClientHandshake and onClientConnect?
 
That I can totally live with
 
7:25 PM
or onNewClient() or onClientCreate() or ...
 
@MarkR I have this exact case in front of me right now
 
Naming stuff is such a pain, on the main piece I work on, it's a webinar platform and it has lots and lots of collections of things. I have about a dozen different things all called Package, 6 different things called Session.
 
@MarkR Just name some managers
:P
 
I used to like short, concise names, but over time I've come to prefer longer, more descriptive names.
 
Same
 
7:27 PM
Don't even get me started on how many things are XyzModule or XyzManager :P
 
@MarkR :D
 
@Trowski should I replace my ajax to AMP?
 
2000+ classes and it feels like a quarter of them are either packages, sessions or managers x_x
 
@OtávioBarreto wut
@MarkR I like the consistency!
@kelunik @Trowski @JoeWatkins @NikiC (sorry megaping) do you know if anybody is working on async at the moment?
 
@PeeHaa async in core you mean?
 
7:30 PM
ManagersManagerManager ... a class to manage the management of manager users. (Kidding, but only just)
 
@kelunik ext/async yeah
 
async programing
 
@OtávioBarreto ajax is front end, amp is backend
Unless you are talking about google amp in which case: hell no
 
@PeeHaa no I am talking aout amp php
 
@PeeHaa @kelunik I've been thinking it might be best to start with getting only fibers in core. The entirety of ext-async is way too much to go into core and keep our sanity.
 
7:32 PM
since it's similar in some cases like
<?php

Loop::run(function () {
    Loop::delay(1000, function () {
        echo date('H:i:s') . ' After timeout' . PHP_EOL;
    });
    echo date('H:i:s') . ' Before timeout' . PHP_EOL;
});
a implementation of set interval javascript function with AMP php
 
Do we have anyone who frequents this room who works on Swoole? I want to beg them to add statics back
 
@OtávioBarreto Yes, but again. You are asking whether you should replace frontend code with backend code
It doesn't work like that
 
@Trowski "client" isn't really an event name.
 
Phew
Read the backlog of this room
and scrolled through the ML thread
 
@PeeHaa As Martin deleted the repository, I don't think anyone is working on it currently.
 
7:34 PM
@Trowski Might be a good idea
 
Boy was that a lot of words
 
@Girgias You earned a cold one now
 
@PeeHaa yeah got it but since my backend can generate my frontend so I think it's possible
 
@PeeHaa :D
 
@OtávioBarreto ok
:P
 
7:40 PM
@Trowski Could also be named onClientAccept ^^
 
I know it's a very small sample size, but 3 people have complained about the name ValueError(just the name, nothing else). I really don't want to put that particular bike shed on internals, do you think it should be?
 
Huh, what did I recommend it should be called @salathe? Because I don't see what other name would be better
 
@Trowski Actually these methods don't accept callbacks but are implemented by child classes, so they probably shouldn't have an on prefix. Maybe handshake / handleHandshake / processMessages
 
The obvious choice of php.net/manual/en/class.invalidargumentexception.php has already been taken by SPL.
 
@salathe what would you suggest? NameError?
 
7:45 PM
Then again, thats an exception rather than deriving from \Error
 
@ircmaxell I'd suggest ValueError.
 
@salathe Haven't followed; what's the criticism of ValueError?
 
@ircmaxell He introduced the ValueError, so I'd say it's the job of other people who complained to come up with a better name IMHO
 
@salathe InvalidValueError?
 
InvalidValueError would be a solid choice
 
7:45 PM
I think Invalid and Error are redundant.
 
is there a simple way to make this work in phpstorm? $this->repository = ObjectManager::get(RegionRepository::class);
 
Just means it's derrived from Error, not Exception
 
@LeviMorrison I honestly don't know, the feedback has just been "I don't like that name!"... you guys have given more feedback in the last 60 seconds. :P
 
@LeviMorrison try { .. } catch (Value $v) { ... } < I don't think the Invalid is redundant.
 
7:46 PM
in terms of code analysis
 
@Girgias OHHHHHH
 
@user3655829 You need to go look at phpmeta
 
@kelunik As in either one of those should be dropped not both :P
 
@salathe what are other's suggesting in its place?
 
@kelunik I meant InvalidValue or ValueError; no need for both Invalid and Error.
 
7:47 PM
InvalidValue sounds like it's an actual... invalid ... value
 
@MarkR yes that is what im missing thanks
 
fwiw $this->repository = ObjectManager::get(RegionRepository::class); smells a lot like a service locator
 
ArgumentConstraintError ?
 
@PeeHaa not everything of course but somethings could be replaced
 
7:48 PM
@ircmaxell only suggestion was IllegalArgumentException from Java.
 
what about just ArgumentError?
 
@PeeHaa in the first place its a FactoryDecidingStrategy :P But i dont tell you what the factories are doing
 
Actual PHP question, best way to change the extension of a file who's path name is retrieved from a RecursiveDirectoryIterator?
 
Not specific enough, for invalid type of argument we have TypeError. For invalid value... *ponders*
@ircmaxell ^^
 
7:50 PM
Or is the best way to use pathinfo() ?
 
@salathe I think ValueError makes sense there then
 
@salathe We have InvalidArgumentException for that, but unfortunately SPL...
 
@salathe @ircmaxell We do have ArgumentCountError that comes from TypeError, so an ArgumentError does appeal in terms of naming, but thats just me, I got no strong feelings either way
 
InvalidArgumentError is good or not? so its easy to find similarity
 
ArgumentValueError or if you want to be more verbose ... ArgumentWasTheRightTypeButYouStillScrewedItUpSomehowError
 
7:52 PM
@beberlei Using InvalidArgument doesn't provide any info, as the exception is based on the Value of it an not it's type
 
@Kalle if that's the direction you're going down, why not ArgumentCountError, ArgumentTypeError, and ArgumentValueError all extending ArgumentError
 
ArgumentTypeError would need to derive from TypeError, would break the tree
 
@ircmaxell because we cannot change TypeError as it was introduced in 7.3, else that would have been my proposal too
 
/me just chnages all the class hiearchies at random, because
 
@Kalle ArgumentCountError isn't about an argument, like Argument(Type|Value)Error would be if those existed. I don't like it.
@ircmaxell That's it, we need a third family of exceptions!
 
7:55 PM
Add your favourites to a strawpoll.me and we'll vote on it. Because who needs RFCs anyway xD
 
@salathe three? meh. We can have
all classes are exceptions!~
 
@kelunik handleHandshake and handleClient?
 
Just remove the nuances and convert everything to Error :D
 
that would be fun, we can pick a class a random and throw it
and see what happens
 
7:56 PM
@ircmaxell throw new DateTimeImmutable("now")? :)
 
@Trowski will think about the names a bit more
 
@salathe throw new DirectoryIterator(__DIR__)
 
@kelunik Yeah, let me know in IRC. I'll leave it for now.
 
@salathe at least 50% of the responses there are wrong so far
 
@ircmaxell :-)
 
7:58 PM
I voted for ValueError \o/
 
@ircmaxell if none of them get 2/3 or more, then the vote doesn't pass :)
 
Actually, throw new RecursiveIteratorIterator($this);
 
8:13 PM
Sometimes I feel people take the RFC process too close to heart, like everything need to be flipped there, even for the simplest thing, but oh well :)
 
8:27 PM
To be honest, I generally think that as well and is one reason why I don't write patches for php-src often. I'd rather stab myself in the eye with a fork than have to go through the RFC process.
 
:/
@salathe what about it specifically?
 
@salathe I agree, most of my patches probably wouldn't have gone in if I had to debate for 2 weeks and then another 2 weeks of voting for something like the IMG_FILTER_SCATTER or making ext/exif work with stream resources
 
What did you think to the GitFC? It seemed to be much more functional
 
@ircmaxell the ValueError commit comments on GH
 
@Kalle link?
 
When I was originally doing my chanegs for the throw errors, I asked on externals.io/message/106675 if we should define an API that included argument number so it could be identified by reflection, but didnt get any bites.
 
I am in the middle on that. In general I don't believe that RFCs are or should be needed for everything. However, in this case, exception hierarchy feels like something that may be worth discussion (whether or not it needs a formal RFC with vote, I don't know)
 
Also @ircmaxell just sent your "beyond design patterns" blog post to somene :D
like 5 years after
 
@salathe I expect ValueError to be thrown when the method does not accept this or a specific combination of arguments. Does it do that? Then the name is fine.
 
Hahahaha :)
@BenjaminGruenbaum nice :)
 
8:46 PM
@bwoebi yes
 
@ircmaxell Take adding ValueError; there's no way on earth I'd have the energy to spend a month championing adding that one class. Maybe that's more my failing than the processes though.
@bwoebi yes, things like github.com/php/php-src/commit/…
 
@salathe In my C++ code I tend to just throw a std::string …
 
as far as i remember Error was just renamed from EngineException pre php 7 without any extra RFC. the RFCs are about the big picture imho and implementation may need to change stuff based on reality
 
I thought the major change was everything basing on Throwable and a split between userland and engine exceptions ?
 
@salathe oh, I think a full RFC for that is overkill. But the reason I would raise it as a discussion item, is it may broaden scope to do some other changes at the same time (or tweak this proposal). In the end, what I am talking about is basically a quick mail "I am thinking of doing this, any major thoughts or objections" and if nothing major for a few days shipit
 
8:56 PM
Right now is probably not the best time to raise any discussions that involve the word "exception" on the mailing list
2
 
Hahahahhaah
 
@ircmaxell yeah just randmly here.
@ircmaxell random question - I feel like the level of average developers in software arch has gotten worse over the last 5-10 year. I also feel like the level of arch discussions has gotten worse over the last 5-10 years (including conferences). Do you feel anything similar?
 
@ircmaxell That's what the pull request was for. :-)
 
@NikiC lmfao
@NikiC Speaking of which, Firebird is having their conference in Berlin this year and there is a track for FB+PHP, I cannot anything else but I envy you being so close to that conf lol
 
Aye made a bit more progress about generating doc.php.net from CI :D php-infrastructe.gitlab.io/doc/tutorial
 
9:11 PM
@salathe well then, we are in agreement sir :)
@BenjaminGruenbaum define average? The number of developers doubles about every 5 years, meaning that the number of "new" developers doubles at the same cadence.
 
Or in other words, half of the developers perpetually have < 5 years of experience.
 
And that's what I feel. Not that it is going down, per se, but that there are more. I still see great people capable of awesome thought leadership and skill, and that they remain a relative fixed proportion of the main set.
 
I mean about architecture in particular. Like I think the average JavaScript developer is better than his counterpart 5 years ago in most parts except architecture and reading about it.
s/his/their
 
When I graduated something like 12 years ago, software architecture was a very small part of the course (despite being BEng Software Engineering), we did maybe half a semester on design patterns and that was about it
 
@NikiC About the RFC experiment on GitHub. I'm not sure if it's a good idea. There are no requirements on voting except for a GitHub, allowed the vote count to be easily manipulated.
For instance, I could use something like gimhub.com to buy enough votes to swing the RFC to a certain direction.
 
9:24 PM
There is no voting on Github Jasny (In terms of the final outcome)
 
Maybe people were always bad at it mostly :D
 
some fun trolling on a new stdlib github.com/beberlei/stdlib ;)
 
At least make your trolling a class with static methods ;)
 
@MarkR okay, good. I misunderstood. So it's only the discussion. Voting will happen elsewhere (like the wiki still).
 
@MarkR why? i think functions are awesome for the stdlib :)
 
9:29 PM
Because functions have to be either fully qualified or imported individually. If you do them as statics you only have to do:

use php\strings; and it's done
 
i like the prefix in each call, as this is similar how it works in go :)
 
Str::substr(...);
Str::len(...)
Str::replace(..., ..., ...)

Just my personal preference, I think it's a bit cleaner than renamed namespaces. I can forsee versioning too:

use php\Utf8Strings as Str;
 
i forgot how to write composer files, last time i created a new lib must have been a few ears ago
i am going to write my OWN standard library, oh the irony ;)
 
@Jasny-ArnoldDaniels nobody is suggesting to do rfc votes on github
votes need to stay limited to those with voting rights ^^
Or do you mean that the thumbs-up/thumbs-down reactions can give the author a wrong impression about popularity, even if they are not official/binding?
 
9:45 PM
auto_detect_line_endings value not parsed as bool – #78535
 
@NikiC No, I thought they had meaning.
 
9:59 PM
Nevermind this. Was getting my RFC's confused.
 
10:15 PM
I wonder if I could make a living off of officially maintaining PHP 7 indefinitely. I mean that word literally; I have no idea how long I would actually maintain it for even if I got paid for it.
 
@LeviMorrison a long time i suppose, just double the prices every 2 years :)
 
You'd probably have to wait 5+ years for it to become an option as otherwise you'd be competing with the "free" sources of the LTS package maintainers. 10+ years you could potentially bring in a tidy sum
I can't remember what the PHP license says about redistributing it without code
 
why wouldn't you redistribute it with code?
people would pay for the promptness of security fix backporting and packaging
 
But if those fixes have to be returned back in open source, then anyone would use them, at which point why pay. But again, I've no idea how the license works
 
0,5% of php users compile their own php.
especially if security needs to be applied fast
 
10:24 PM
Indeed, but Levi asked about making enough to live on.
 
I think I just got a sneak peek at an awesome new github feature
 
Do tell.
 
It said something like "php:master requires linear history" at the bottom. Gone after a refresh...
So I'm assuming that we're getting a feature to forbid merge commits
 
@NikiC in repo options you have the ability to enable merge, squash, or rebase as your "Merge button"
 
10:51 PM
@Trowski onClientConnect. So you can then also have onClientDisconnect etc...
@NikiC could just be Github decided to support causal Fridays....
 
11:45 PM
 

« first day (3254 days earlier)      last day (1710 days later) »