1.2.1010. Promoted Properties¶

Promoted properties is a way to declare the properties within the constructor, and have them assigned to the constructing value at instantiation.

<?php

    class CustomerDTO
    {
        public function __construct(
            public string $name,
            public string $email,
            public DateTimeImmutable $birth_date,
        ) {}
    }

?>

See also Constructor Promotion and PHP 8: Constructor property promotion.

1.2.1010.1. Connex PHP features¶

  • Promoted Properties

1.2.1010.1.1. Specs¶

Short name

Classes/PromotedProperties

Rulesets

All, Appinfo, Changed Behavior, Inventory

Exakat since

2.3.1

PHP Version

With PHP 8.0 and more recent

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud

Exakat

Navigation

  • Introduction
  • Release Note

GETTING STARTED

  • Standard installation
  • Docker installation
  • Tutorials

USER GUIDE

  • Overview
  • PHP Version
  • Library & Framework Support
  • Configuration
  • Scoping analysis
  • Rule
  • Report
  • Cobbler

REFERENCE GUIDE

  • 1. Rules
  • 2. Rulesets
  • 3. Reports
  • 4. Cobblers
  • 5. Real Code Cases

ADMINISTRATOR GUIDE

  • Installation
  • Upgrading
  • Configuration
  • Commands

OTHERS

  • Frequently Asked Questions
  • Glossary
  • Annex

Related Topics

  • Documentation overview
    • 1. Rules
      • Previous: 1.2.1009. Processing Collector
      • Next: 1.2.1011. Propagate Constants
©2015-2025, Damien Seguy - Exakat. | Powered by Sphinx 8.2.3 & Alabaster 1.0.0 | Page source