phalcon/cphalcon · error · Phalcon\Di\Exceptions\PropertyNameRequired

The property name is required on position

Error message

The property name is required on position {position}

What it means

Thrown by Builder::build when a 'properties' entry at the given position lacks the 'name' key. The property name identifies which attribute to set on the instance. Add 'name' to the property definition array.

Solutions

  1. Add 'name' with the target property name to the entry at the reported position
  2. Verify the property exists (is public) on the target class
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Di/Service/Builder.zep:172 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/cac851ac0da54166. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Di/Service/Builder.zep:172

                throw new SetterParametersMustBeArray();
            }

            /**
             * The method call has parameters
             */
            for propertyPosition, property in paramCalls {
                /**
                 * The call parameter must be an array of arrays
                 */
                if unlikely typeof property != "array" {
                    throw new PropertyMustBeArray(propertyPosition);
                }

                /**
                 * A param 'name' is required
                 */
                if unlikely !fetch propertyName, property["name"] {
                    throw new PropertyNameRequired(propertyPosition);
                }

                /**
                 * A param 'value' is required
                 */
                if unlikely !fetch propertyValue, property["value"] {
                    throw new PropertyValueRequired(propertyPosition);
                }

                /**
                 * Update the public property
                 */
                let instance->{propertyName} = this->buildParameter(
                    container,
                    propertyPosition,
                    propertyValue
                );
            }

View on GitHub (pinned to b7419de9cd)