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

Wes
Wes
04:19
@Tiffany :(
 
3 hours later…
07:42
o/
Wes
Wes
07:53
\o
 
1 hour later…
08:58
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?
09:54
@beberlei Are there any nested annotations examples not involving Join?
That's the only one I could find in doctrine docs
@IluTov Thanks
Wes
Wes
10:49
@Danack hierarchical structures. DOM for example
@Wes can you make an example please?
Wes
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
Wes
$elm->childNodes->item(4)?->getElementsByTagName("header")?->item(0)?->getElementsByTagName("h1")?->item(0)?->textContent;
10:55
@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
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
@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
o/
12:08
\o
12:28
o/
 
1 hour later…
13:28
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
14:12
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'];
14:15
<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
14:17
@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?
14:27
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.
14:37
@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 :)
14:51
@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.
15:08
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
15:22
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
15:23
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
15:41
@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
cmb
16:12
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.
16:34
@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
cmb
@Derick ah, okay. It should be usable at least for maintainers to be able to review user submitted patches.
16:50
@Derick When I submit things I do, but this is rare (non-zero though)
17:03
@IluTov $group->users->getFirst()->getAvatar()->getWidth()?
 
3 hours later…
20:29
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.
20:42
substr($string, $offset, null) should return from $offset till end ・ Strings related ・ #79662
21:32
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.
21:55
Does anyone know roughly what value does PHP's float start to be represented as INF?
cmb
cmb
22:07
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
22:29
@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
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
22:45
Fuck me
I forgot basic log rules
 
1 hour later…
23:52
are all the "User Contributed Notes" gone? ・ Website problem ・ #79663

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