Giter VIP home page Giter VIP logo

stitcher.io's Introduction

ยฉ 2019 Brent Roose

Translations

You're allowed to translate my content, though there are a few rules to keep in mind.

stitcher.io's People

Contributors

adrianmrn avatar alexongh avatar awebartisan avatar brendt avatar brunocfalcao avatar conorjmurphy avatar dayallnash avatar drbyte avatar ingalless avatar lacni135 avatar mgatner avatar nathangiesbrecht avatar nielsdos avatar olalekan-agbaje avatar oleksandr-moik avatar osbre avatar ptrtn avatar rgehan avatar robinbastiaan avatar romanzipp avatar romm avatar s-moon avatar saundefined avatar sebastiandedeyne avatar simonschaufi avatar szepeviktor avatar techbio avatar thepeanutguy avatar travisobregon avatar tspencer244 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

stitcher.io's Issues

Incorrect blog post canonical url

Hey, not really a big issue, but the canonical url on blog post just points to the blog index.

I noticed it when I sent one of the blog posts to my phone and it opened the blog index instead of the post.

A quick peak at the code suggests the blog id is empty.

Backed enums `cases()` does not return an associated array.

In your blog post PHP Enums under Listing enum values, you wrote that backed-enums return an associative array with its enum values as keys. This might've been the case in an early version of the RFC, but not in the current RFC or the actual enumeration implementation.

After playing around with a PHP 8.1 development build and looking at the Zend test for backed enum cases, and pure cases, reading the RFC, in regards to value listings. Both pure and backed enums return the same packed array, there is no difference between them.

Both Pure Enums and Backed Enums implement an internal interface named UnitEnum. UnitEnum includes a static method cases(). cases() returns a packed array of all defined Cases in the order of declaration.[1]

  1. RFC: Value listing

Fix typo

Silly typo but its geting me crazy. Here the text says "The PHP core team has provided a built-in attribute called AllowDynamicProperties.As its name suggests,(...)", but it should be "The PHP core team has provided a built-in attribute called AllowDynamicProperties. As its name suggests,(...)"

". As" instead of ".As"

Override article could need some more explanation

I'm currently upgrading a first application to use PHP 8.3, and Rector recommends to use #[Override]. Gathering some pros and cons about this, I've found your article at https://stitcher.io/blog/override-in-php-83 that states:

I use an IDE that prevents me from making these kinds of mistakes

Can you explain this further? How could your IDE inform you that a parent classes method was renamed and you might consider renaming the method in your own class? How could a static analyzer detect this better?

array_map

Previously, you'd had to write this
$ids = array_map(fn($post) => $post->id, $posts);

No! You should use array_column instead of.

RSS feed outputting an error

When you visit the RSS feed, a PHP error is returned: https://www.stitcher.io/rss

Fatal error: Uncaught Error: Class 'PhpOption\Option' not found in /home/forge/aggregate.stitcher.io/releases/20200131-142225/vendor/laravel/framework/src/Illuminate/Support/Env.php:100 Stack trace: #0 /home/forge/aggregate.stitcher.io/releases/20200131-142225/vendor/laravel/framework/src/Illuminate/Support/helpers.php(265): Illuminate\Support\Env::get() #1 /home/forge/stitcher.io/src/config.php(6): env() #2 /home/forge/stitcher.io/vendor/pageon/stitcher-core/src/Pageon/Config.php(83): require('/home/forge/sti...') #3 /home/forge/stitcher.io/vendor/pageon/stitcher-core/src/Pageon/Config.php(40): Pageon\Config::load() #4 /home/forge/stitcher.io/vendor/pageon/stitcher-core/src/Stitcher/App.php(25): Pageon\Config::init() #5 /home/forge/stitcher.io/public/index.php(11): Stitcher\App::init() #6 {main} thrown in /home/forge/aggregate.stitcher.io/releases/20200131-142225/vendor/laravel/framework/src/Illuminate/Support/Env.php on line 100

Broken code blocks on some pages

Deprecate dynamic properties rfc stdClass use

In https://stitcher.io/blog/new-in-php-82 you say that you can use #[AllowDynamicProperties] attribute for dynamic attributes.

however, you say:

The same goes for objects of stdClass, they will keep supporting dynamic properties.

will it also work to make your class extend stdClass?

class Post extends \stdClass
{
}
$post->name = 'Name';

perhaps add this bit to the blog as well.

Promoted properties are allowed in abstract class c-tor as long as c-tor itself is not abstract

abstract public function __construct(

Having body in an abstract method is not allowed.

So this:

abstract class A
{
    abstract public function __construct(
        public string $a,
    ) {}
}

Should be this:

abstract class A
{
    abstract public function __construct(
        public string $a,
    );
}

But this is allowed:

abstract class A
{
    public function __construct(
        public string $a,
    ) {}
}

RSS Feed issue

Hello! :)
Your RSS feed does not work :).
https://stitcher.io/rss

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.14. in /home/forge/stitcher.io/vendor/composer/platform_check.php on line 24

All best,
Chris

Wrong array_chunk example

Hi,

the first example in the guest post is giving the wrong output. It should be

[
    0 => [1, 2], 
    1 => [3, 4], 
    2 => [5, 6], 
    3 => [7, 8],
]

instead of

[
    0 => [1, 2], 
    1 => [1, 2], 
    2 => [1, 2], 
    3 => [1, 2],
]

Regards
KMB

Which is the better (or proper) writing form of arrow functions when in by-reference passing

Hello buddy, I read your post of Arrow functions in PHP 7.4 recently. Nice job!

I notice that when using like this:

<?php

$str = 'hello';
(fn&($s) => $s .= ' arrow function')($str);
echo $str . PHP_EOL; // PHP Notice

, there's an error reporting:

PHP Notice: Only variable references should be returned by reference in ... on line x

, but when I change it to:

<?php

$str = 'hello';
(fn(&$s) => $s .= ' arrow function')($str);
echo $str . PHP_EOL; // hello arrow function

, the error is gone, and the output is normal.

So I have the question as the title describes.

Here's the Gist code snippet. (My PHP is 7.4.1 on macOS.)

Thanks in advance for your any help.

whitespaces disappeared

Hi.
First of all, thank you for your great articles!

I've noticed some whitespaces disappeared in the articles like here(rendered like onDecember 07, 2019) and here(like Next up:Laravel beyond CRUD but this may not be a problem).

This might be twig's whitespace-control but I'm not sure.

I want to fix it if I could, but I'm not familliar with twig, so I just open this.

Again, thank you for the articles.
I'm looking forward to keep reading!

Regarding attributes

Hello,

After a discussion (1: #109880) on internals to rename PhpAttribute to Attribute, it was decided (2: #109987) to use simply Attribute instead. It would be great, if you could reflect those changes in the examples (in PHP 8 changes post).

Best regards,
Benas Seliuginas

#[Override] and static analysis

What strikes me most about this RFC, is how irrelevant it could be. Once again we're adding runtime checks for something that could be determined by static analysers.

I am with you here Brent - IDE analysis is best, static analysis is 2nd best and run -time warnings are worst.

However I suspect that, if a single decent static analysis tools was available and used pervasively for all PHP repos, then rules like this (and I suspect many others) could be coded in this tool, and then any pressure for PHP to validate this at run-time would be far lower.

Discussion or comments

Hi @brendt,

First, I really enjoy your blog!

It could be really nice if would add the options to adds comments and make discussions on each post. that way people can add their input and questions...

10x!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.