ยฉ 2019 Brent Roose
You're allowed to translate my content, though there are a few rules to keep in mind.
Source code of stitcher.io
Home Page: https://stitcher.io
ยฉ 2019 Brent Roose
You're allowed to translate my content, though there are a few rules to keep in mind.
Hi, this website looks really good! I would wish that I can use the source code for my personal blog as well.
Thanks ๐
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.
Which images editor do you use to create those illustrations?
For example in this tutorial: https://stitcher.io/blog/combining-event-sourcing-and-stateful-systems
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
Recently I set up GitHub sponsors, if you my content helps you, you can consider a one-time or monthly sponsorship.
Hello @brendt.
Recently, i have been revisiting the enum problem. I thing i found my own sollution. Can you read it?
https://gist.github.com/the-liquid-metal/a2608f197e1241d11c956890b7c8a635
Moreover, can you mention it in your article?
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]
On a post like this one, I see this with Firefox 115.0.2 on Ubuntu 22.04:
With Chrome:
It's probably due to the emoji used by Firefox, or the way the colour is applied to the emoji.
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"
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!
Hey, I noticed some of the pages have broken code blocks:
These are the pages where I could find them:
https://stitcher.io/blog/laravel-beyond-crud-07-entering-the-application-layer
https://stitcher.io/blog/laravel-custom-relation-classes
https://stitcher.io/blog/laravel-has-many-through
https://stitcher.io/blog/laravel-beyond-crud-02-working-with-data
https://stitcher.io/blog/tests-and-types
https://stitcher.io/blog/when-i-lost-a-few-hundred-leads
https://stitcher.io/blog/improvements-on-laravel-nova
https://stitcher.io/blog/bitwise-booleans-in-php
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,
) {}
}
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.
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?
Please don't use light font weight for the content of your web page. It's really hard to read it on Linux. Just use font-weight: 400 and everything will be readable for everyone on every OS. :)
In the blogpost here you link off to a google page: https://developers.google.com/web/fundamentals/performance/ however this redirects to a web.dev link now: https://web.dev/why-speed-matters/ and doesn't include the section you specifically highlight: "critical rendering path".
Just an FYI, really.
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.
Previously, you'd had to write this
$ids = array_map(fn($post) => $post->id, $posts);
No! You should use array_column instead of.
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!
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.
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
I really like your laravel beyond curd series, so i translate it into Simple Chinese, and add your blog as original source .
https://iwenson.com/laravel-beyond-curd-preface/
Is it all right to reprint ?
Thank you !
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.