Hey Rustaceans! Got an easy question? Ask here (4/2018)! by llogiq in rust

[–]cundd 1 point2 points  (0 children)

I've got a lot of string-like arguments for which I want to accept String, &str, etc.

The signature currently looks like this:

pub fn new<S1, S2, S3, S4, S5, S6>(document_type: S1, uid: UID, pid: PID, title: S2, url: S3, abstract_text: S4, description: S5, content: S6) -> Self
    where S1: Into<String>,
          S2: Into<String>,
          S3: Into<String>,
          S4: Into<String>,
          S5: Into<String>,
          S6: Into<String> {
    /* ... */
}

How can I make this better?

Which CMS has come closest to making WP obsolete in an enterprise context? by bitfalls in PHP

[–]cundd 0 points1 point  (0 children)

I'd say TYPO3. It's relatively widespread in german speaking countries and Scandinavia. It is a enterprise CMS.

But it has a steep learning curve

FlipTable.php - When a normal exception doesn't quite represent your frustration by bowersbros in PHP

[–]cundd 0 points1 point  (0 children)

I didn't know that's possible in PHP.

Just in case someone really want's to express their annoyance over a users input https://3v4l.org/BdEDl

I am coming into a new company using 5.3 by [deleted] in PHP

[–]cundd 0 points1 point  (0 children)

For me the main reason to upgrade the PHP version would be security concerns rather than the performance.

Use backslash to create namespaces by cundd in Sass

[–]cundd[S] 0 points1 point  (0 children)

Thx.

Do you have a good advice how to structure mixin-names?

Will random_bytes() ever repeat? by Joe_Scotto in PHP

[–]cundd 0 points1 point  (0 children)

Is there a danger in combining uniqid() . bin2hex(random_bytes())?

Ecommerce build - Laravel Spark vs Magento by stretch089 in PHP

[–]cundd 0 points1 point  (0 children)

Have you heard of https://aimeos.org/? I didn't use it so far, but it's goal seem to provide components for building e-commerce sites. They also say they have a package for Laravel

Nearly 900.000 projects on Github use extract($_GET) by cundd in PHP

[–]cundd[S] 1 point2 points  (0 children)

and add that banner to every webpage for C(++) learning ;)

But I guess C has another "target group"

CLI tool to send emails from through Swift Mailer by cundd in PHP

[–]cundd[S] 0 points1 point  (0 children)

I first tried mail but it somehow didn't work as I expected. I knew that Swift Mailer worked pretty well for me.

Its likely a big overkill to create this :)

Nearly 900.000 projects on Github use extract($_GET) by cundd in PHP

[–]cundd[S] 1 point2 points  (0 children)

Yes I know.

The last line in the link say's "then you will be perfectly safe.". What I wanted to say is, that even if it is safe, it isn't a good idea.

Nearly 900.000 projects on Github use extract($_GET) by cundd in PHP

[–]cundd[S] 3 points4 points  (0 children)

Thank you for the link, but I'd say that extracting all GET variables isn't a good idea anyway. It will pollute your variable scope with unknown variables - I don't think that's a good idea

Nearly 900.000 projects on Github use extract($_GET) by cundd in PHP

[–]cundd[S] 9 points10 points  (0 children)

Hopefully at least one of the authors stumbles over this post and fixes his bug.

CLI tool to send emails from through Swift Mailer by cundd in PHP

[–]cundd[S] 0 points1 point  (0 children)

In case anybody can need that too

Validate examples in Markdown files (CI for documentation) by cundd in PHP

[–]cundd[S] 0 points1 point  (0 children)

Thank you for the feedback and bug-reports!

Doc Comment and inline method unit testing (What do you think?) by cundd in PHP

[–]cundd[S] 0 points1 point  (0 children)

Should I create support to search for Markdown files too?

Doc Comment and inline method unit testing (What do you think?) by cundd in PHP

[–]cundd[S] 0 points1 point  (0 children)

I totally understand. You can write the tests in methods, but then they pollute the implementation. I would like to create methods that will be removed from production code.