Skip to content
Psalm
Documentation MissingClassConstType
Type to start searching
    GitHub
    GitHub
    • Documentation Home
      • Installation
      • Configuration
        • Using plugins
        • Authoring plugins
        • How Psalm represents types
      • Command line usage
      • IDE support
        • Dealing with code issues
        • Issue Types
      • Checking non-PHP files
      • Using Type Annotations
      • Union Types
      • Atomic Type Reference
      • Intersection Types
      • Supported Annotations
      • Template Annotations
      • Assert Annotations
      • Fixing code with Psalter
      • Refactoring code
      • Introduction
      • Taint annotations
      • Taint flow annotations
      • Custom taint sources
      • Custom taint sinks
      • Avoiding false-positives
      • Avoiding false-negatives
    • Contributing
    

    MissingClassConstType

    Emitted when a class constant doesn't have a declared type.

    <?php
    
    class A {
        public const B = 0;
    }
    

    Correct with:

    <?php
    
    class A {
        public const int B = 0;
    }
    
    powered by MkDocs and Material for MkDocs