silverstripe / silverstripe-upgrader

A tool to help upgrade your code to handle API changes in packages you used.
BSD 3-Clause "New" or "Revised" License
40 stars 21 forks source link

upgrade fails on classes that are not a subclass of SilverStripe #178

Closed wernerkrauss closed 5 years ago

wernerkrauss commented 5 years ago

Fatal error: Uncaught TypeError: Argument 1 passed to SilverStripe\Upgrader\UpgradeRule\PHP\Visitor\ClassToTraitVisitor::getNodeName() must implement interface PhpParser\Node, null given, called in ...\vendor\silverstripe\upgrader\src\UpgradeRule\PHP\Visitor\ClassToTraitVisitor.php on line 48 and defined in ...\vendor\silverstripe\upgrader\src\ UpgradeRule\PHP\Visitor\NodeMatchable.php:42

The class is a simple PHP class with nothing fancy, like:

<?php

namespace Foo\View;

class MyClass
{
    public $ID;
}

making it a subclass of e.g. ArrayData removes that error

Pull requests

maxime-rainville commented 5 years ago

https://github.com/silverstripe/silverstripe-upgrader/pull/180 should fix this issue.

ScopeyNZ commented 5 years ago

180 is merged and released!