Skip to content

Call to undefined method ReflectionProperty::getDefaultValue() on php 7.x #6869

@samsonasik

Description

@samsonasik

Bug Report

Subject Details
Rector version 0.12.7

Minimal PHP Code Causing Issue

When running vendor/bin/rector --dry-run, got error:

PHP Fatal error:  Uncaught Error: Call to undefined method ReflectionProperty::getDefaultValue() in /home/runner/work/CodeIgniter4/CodeIgniter4/vendor/rector/rector/packages/NodeTypeResolver/TypeAnalyzer/ArrayTypeAnalyzer.php:168

Fatal error: Uncaught Error: Call to undefined method ReflectionProperty::getDefaultValue() in /home/runner/work/CodeIgniter4/CodeIgniter4/vendor/rector/rector/packages/NodeTypeResolver/TypeAnalyzer/ArrayTypeAnalyzer.php:168

ref https://github.com/codeigniter4/CodeIgniter4/runs/4515590674?check_suite_focus=true#step:10:8

The code seems exists even in latest dev-main

$reflectionProperty = $phpPropertyReflection->getNativeReflection();
return \is_array($reflectionProperty->getDefaultValue());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions