« first day (3516 days earlier)      last day (1415 days later) » 

Wes
4:19 AM
@Tiffany :(
 
 
3 hours later…
7:42 AM
o/
 
Wes
7:53 AM
\o
 
 
1 hour later…
8:58 AM
o/
 
\o
 
@DaveRandom IluTov is working on null short-circuiting. But he needs a better 'real world' example for github.com/iluuu1994/nullsafe-operator-rfc/blob/v1/rfc.md - as you have thought about this, do you have one?
 
9:54 AM
@beberlei Are there any nested annotations examples not involving Join?
That's the only one I could find in doctrine docs
 
@IluTov Thanks
 
Wes
10:49 AM
@Danack hierarchical structures. DOM for example
 
@Wes can you make an example please?
 
Wes
it's stuff you want to browse at several depths and you don't care about checking that every level exists, it's all or nothing
$elm->childNodes[4]?->getElementsByTagName("header")[0]?->getElementsByTagName("h1")[0]->textContent;
by the way, probably there should be a null safe array key lookup operator also
although php's dom doesn't use that, it has item()
 
@Wes It's described under future scope: github.com/iluuu1994/nullsafe-operator-rfc/blob/v1/…
Thanks for the example! I'm looking for something simple and common/relatable.
 
and probably need to avoid the "don't write code like that" comments that are inevitable.
 
Wes
$elm->childNodes->item(4)?->getElementsByTagName("header")?->item(0)?->getElementsByTagName("h1")?->item(0)?->textContent;
 
10:55 AM
@Danack just use xpath :p
 
/** @var Logger|null */
private $logger;

$this->logger?->warn('...');
What about something like this? Pretty simplistic.
But the real benefit comes when using it inside an expression (as this isn't much better than just using an if statement).
 
@IluTov I think a long example that needs to be in the place where it is used is a good example.
Also, I hate loggers and think how everyone uses them in PHP is dumb as anything. So they don't make good examples.
But for this bit particularly, it's a bad example as the logger should always exist, and then the decision about what to do with the logging info happens somewhere else.
Sep 25 '17 at 9:20, by Danack
something something, no such thing as an optional dependency.
 
blame fig and their stupidness
 
11:11 AM
circular clone cause a crash ・ Reproducible crash ・ #79658
 
> circular clone is circular.
 
Something something recursion
 
A remark in documentation is missing ・ Documentation problem ・ #79659
 
11:28 AM
@PeeHaa or SimpleXML :þ
 
May 2 at 18:37, by Ekin
And what does simplexml do?
May 2 at 18:38, by Ekin
It takes magic and sprinkles it with fairy dust and covers it in mud to hide it
 
@Derick It's too monday to bring up stupidxml
 
I like SimpleXML for simple things and XPath for slightly more complicated things
 
@Danack fwiw that was me on ekin's machine
And yes simplexml is always wrong is my professional experience :)
 
...
 
11:55 AM
o/
 
o/
 
12:08 PM
\o
 
12:28 PM
o/
 
 
1 hour later…
1:28 PM
respected members, greetings. I am using google file picker API in laravel project. Google file picker API is not showing the select file input pox in this url localhost:8000 but it is showing the select file input box in this address:- localhost/languagetool-website-2018-master/…. What is the reason. anybody could guide please.
 
Check your console. Also this is not related in any way shape or form to php
 
2:12 PM
hi
i want to pass variables to another page without any form and not through get or post either
i want to use session
how to do it?
 
What have you tried?
 
i tried session but it doesnt work
 
Show your minimum reproducable code
!!sscce
 
If you are having a problem with some code and seeking help, preparing a Short, Self Contained, Correct Example is very useful.
 
$fnln=$_POST['fnln'];$url=$_POST['url'];$pwd=$_POST['pwd'];
 
2:15 PM
<3 @Danack
There is nothing related to session in there
Also that code is disgusting
If you format your code like that you get what you deserve
 
i removed session code
 
!!sscce
 
If you are having a problem with some code and seeking help, preparing a Short, Self Contained, Correct Example is very useful.
 
read that link if you want anybody to even try helping you
 
i want these vars to be passed on to another page in a way that the user cant change it e.g. example.com/index.php?id=101 the user can change 101
 
2:17 PM
@PeeHaa +1 put space behind semi-colon
 
Shared memory is dirty in child proc after pcntl_fork ・ Performance problem ・ #79660
 
@OmerHijazi Fine. Don't read the link
Just don't expect help
Good bye o/
3 messages moved to Trash can
 
Give power to man to see what he's like... :P
 
...
 
is sscce the new rtfm?
 
2:27 PM
This is yet another thing I need to write down clearly - it's a "if you can't be arsed to do the work to make your question be intelligible, why should other people bother to spend time helping you" thing.
 
2:37 PM
@PeeHaa flip you deleting msgs to show others youre boss
 
4 messages moved to Trash can
yes, flip peehaa. flip him right on the ear.
 
@OmerHijazi have you found Sessions page in PHP documentation?
Oh, he's gone.
 
I am loving Kint as a debugging tool... is there anything else similar other than full blown X-debug ? or should I take the time to figure out X-debug because its so good?
 
@Yourguide it's worth getting it setup and learning to use it.
 
@Danack I suspected as much.... always more to learn :)
 
2:51 PM
@Yourguide When you start using Xdebug you'll never come back to PHP development without IDE set with Xdebug. You'll just ask yourself why didn't you do that sooner.
 
one thing that probably needs to be taught is that by writing tests, you can make it really easy to debug your code separate to your application. About 95% of the time when I'm using xdebug, I'm using it to debug a failing test. It's pretty rare that I have to test something as part of the application.
 
3:08 PM
I have a website project, is there a way I can host it on the web for free, its for demonstration purposes
 
@aaa28 aws has a free tier - aws.amazon.com/free/…
 
@Tpojka I appreciate the advice. Will do.
 
2 Connections with different buffer stats cant run ・ PDO MySQL ・ #79661
 
i have some complex business logic that i am trying to refactor to make it easier to test. this code is for sending an application for a lease (e.g. for a car), then on approval, sending an item(s) you want to lease.
<?php

class  ApplicationService
{
    const DEV_BASE = "localhost:8000";

    /** @var string */
    private $baseUrl;
    /** @var string */
    private $environment;
    /** @var ApiWrapper */
    private $api;
    /** @var EntityManagerInterface */
    private $em;
    /** @var ShoppingCartService */
    private $cartService;
    /** @var ParameterBagInterface */
    private $parameterBag;
    /** @var SerializerInterface */
    private $serializer;
    /** @var UrlGeneratorInterface */
    private $urlGenerator;
as you can see, it has quite a few dependencies. (6+)
i'm wondering how i can refactor this because in my tests i'm mocking 6 objects, have to create a bunch of stubbed methods, etc.
i'm unsure of a good design pattern to handle this kind of business logic
 
@RobertCalove Look at what the class is currently doing and what should go out of there
Valdidation is one
 
3:22 PM
quick summary of the flow: 1) send application 2) validate (throw exception on validation errors) 3) persist 4) send cart 5) validate
 
redirecting too
 
redirecting happens on the controller level. all i'm doing is building the URL to redirect to.
 
Why do you need to do that in your service?
 
but that could probably exist in its own class, but all i would be doing is replacing one dependency with another
 
You don't
 
3:23 PM
i'm using the URLGenerator service provided by the framework. if i were to create my own service, i would still need to inject that service, leaving me with the same # of dependencies.
 
No you don't
 
same with validation. i'd be injecting a 7th service to handle validation, no?
 
The service doesn't need to do anything with redirects
As you said the controller does the actual redirecting
 
yes, the user sends a POST request to the controller, the controller passes the data to the service and expects a URL
i'm just confused on how i would decouple this class
because there's quite a bit of business logic in it and i recognize that it's doing too much. but idk how to do it w/o just reintroducing new services.
i separated the validation into private functions, etc. i kept the functions fairly small. b
 
3:41 PM
@salathe Are people still using edit.php.net ? /cc @heiglandreas
 
I do
When working on the French translation on the move
But it's not super important the moment stuff gets moved to git
 
cmb
4:12 PM
seems edit.php.net is down for some hours now
 
@Danack Any better?
$manager = $user !== null ? $user->getManager() : null;
$managerName = $manager !== null ? $manager->getName() : '-';
// vs
$managerName = $user?->getManager()?->getName() ?? '-';
 
@IluTov better, but still meh.
I've seen some that had 4 levels of calls where it was obvious that wrapping the code in the appropriate conditionals was a lot of typing, and never going to be a useful thing to do.
 
4:34 PM
@cmb Yes, the upgrade to Ubuntu 20 ... made the kernel panic, that's why I was asking
 
@Danack All my hope is in you then :P
 
Loki, in his prison cell.
 
cmb
@Derick ah, okay. It should be usable at least for maintainers to be able to review user submitted patches.
 
4:50 PM
@Derick When I submit things I do, but this is rare (non-zero though)
 
5:03 PM
@IluTov $group->users->getFirst()->getAvatar()->getWidth()?
 
 
3 hours later…
8:29 PM
I'm slightly annoyed at the code in front of me where everything is passed by ref … to avoid copies and save memory (even though the values usually aren't mutated) sigh.
 
Yay...
 
8:42 PM
substr($string, $offset, null) should return from $offset till end ・ Strings related ・ #79662
 
9:32 PM
Hey @StatikStasis stop working and listen to our new track noaw
 
@PeeHaa Question in subject. i.imgur.com/dgtODbK.jpg lol
 
:-)
 
Since $user?->getManager()?->getName() doesn't tell which one was failing/null, why not ?$user->getManager()->getName() with some kind of recursiveness?
 
@Derick Yes.
 
9:55 PM
Does anyone know roughly what value does PHP's float start to be represented as INF?
 
cmb
10:07 PM
PHP tries to enforce usage of IEEE754 binary64 (aka. double precision), so this would be something between 1e308 and 1e309, I think.
 
Okay, yeah seem to be that
I've been banging my head on some weird algorithm where I've got a Matematica version which I have trouble understanding
I think that'll be a problem for tomorow to continue tackling
 
10:29 PM
@Girgias I can never remember, so I remember the phrase "not representable" to find: stackoverflow.com/questions/3793838/…
.....that first link was actually the wrong one...
 
he played himself
 
( ͡° ͜ʖ ͡°)
 
cmb
@Danack this isn't what @Girgias asked, though.
 
....I should go to bed.
nn.
 
Don't worry I should too
Night :)
God why must Mathematica be so weird, like how come I can't seem to understand some semi normal line of code
 
10:45 PM
Fuck me
I forgot basic log rules
 
 
1 hour later…
11:52 PM
are all the "User Contributed Notes" gone? ・ Website problem ・ #79663
 

« first day (3516 days earlier)      last day (1415 days later) »