The essential news about content management systems and mobile technology. Powered by Perfect Publisher and XT Search for Algolia.
The News Site publishes posts to the following channels: Facebook, Instagram, Twitter, Telegram, Web Push, Tumblr, and Blogger.
This month we are thrilled to include a double interview with the new Joomla 5.2 release team: Marc Dechèvre and Peter Martin. The aim of these interviews is to let the Community know a bit more about the release leads and their plans for the future of Joomla 5.2.
Read more https://magazine.joomla.org/all-issues/april-2024/getting-to-know-the-team-behind-joomla-5-2
The latest version of Joomla brings a number of interesting improvements and features for users and developers. Here's an overview of the main new features in Joomla 5.1 :
Read more https://magazine.joomla.org/all-issues/april-2024/what-s-new-in-joomla-5-1-1
So you’ve decided to join the Joomla Community, and maybe even dedicate some of your talent, skills to Joomla. Great! But now what? Where is everyone? Where do all these cool people meet? How to find a team that suits you, and how to join them? We’ve got you covered! Read all about the steps you can take to get settled in, and know: every step of the way, there’s someone who can help you.
Read more https://magazine.joomla.org/all-issues/april-2024/finding-your-way-in-the-joomla-community
This guide for beginners simply explains what the different image file formats are and how to properly use them on your website.
Read more https://magazine.joomla.org/all-issues/april-2024/what-type-of-image-should-i-use-on-my-website
The Property Hooks RFC passed a significant milestone, getting an overwhelmingly positive 34 "yes" votes and only 1 "no" vote. That's well above the required 2/3 majority required to pass.
What are property hooks in PHP?
Here's the proposal summary from the RFC:
Developers often use methods to wrap and guard access to object properties. There are several highly common patterns for such logic, which in practice may be verbose to implement repeatedly. Alternatively, developers may use __get and __set to intercept reads and writes generically, but that is a sledge-hammer approach that intercepts all undefined (and some defined) properties unconditionally. Property hooks provide a more targeted, purpose-built tool for common property interactions...
This RFC introduces two “hooks” to override the default “get” and “set” behavior of a property. Although not included in this initial version, the design includes the ability to support more hooks in the future.
Property hooks are inspired by languages like Kotlin, C#, and Swift, and the syntax includes two syntax variants that resemble short and multi-line closures:
class User implements Named
{
private bool $isModified = false;
public function __construct(
private string $first,
private string $last
) {}
public string $fullName {
// Override the "read" action with arbitrary logic.
get => $this->first . " " . $this->last;
// Override the "write" action with arbitrary logic.
set {
[$this->first, $this->last] = explode(' ', $value, 2);
$this->isModified = true;
}
}
}
The syntax doesn't require that both hooks always be defined
together; in fact, here's an example of only defining
set
from the RFC:
class User
{
public string $name {
set {
if (strlen($value) === 0) {
throw new ValueError("Name must be non-empty");
}
$this->name = $value;
}
}
public function __construct(string $name) {
$this->name = $name;
}
}
You can read all the details about Property Hooks in PHP in the RFC. This feature looks likely to drop in PHP 8.4. The implementation is already a draft pull request if you want to see the discussion and progress of this feature.
The post Property Hooks Get Closer to Becoming a Reality in PHP 8.4 appeared first on Laravel News.
Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.
Read more https://laravel-news.com/php-property-hooks
Page 3 of 1312