You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[develop regressio] Generate accessor in same file fails #694
Re-opened as the same happens when generating an accessor from a property, possibly other places where we now depend on the SourceCode path.
--
[2019-01-01 18:54:56] phpactor.DEBUG: Resolving: Microsoft\PhpParser\Node\Expression\Variable [] []
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Phpactor\Extension\Rpc\Response\UpdateFileSourceResponse::fromPathOldAndNewSource() must be of the type string, null given, called in /home/daniel/www/phpactor/phpactor/lib/Extension/CodeTransformExtra/Rpc/GenerateAccessorHandler.php on line 56 and defined in /home/daniel/www/phpactor/phpactor/vendor/phpactor/rpc-extension/lib/Response/UpdateFileSourceResponse.php:40
Stack trace:
#0 /home/daniel/www/phpactor/phpactor/lib/Extension/CodeTransformExtra/Rpc/GenerateAccessorHandler.php(56): Phpactor\Extension\Rpc\Response\UpdateFileSourceResponse::fromPathOldAndNewSource(NULL, '<?php\n\nnamespac...', '<?php\n\nnamespac...')
#1 /home/daniel/www/phpactor/phpactor/vendor/phpactor/rpc-extension/lib/RequestHandler/RequestHandler.php(33): Phpactor\Extension\CodeTransformExtra\Rpc\GenerateAccessorHandler->handle(Array)
#2 /home/daniel/www/phpactor/phpactor/vendor/phpactor/rpc-extension/lib/RequestHandler/ExceptionCatchingHandler.php(25): Phpactor\Extension\Rpc\RequestHandler\Reque in /home/daniel/www/phpactor/phpactor/vendor/phpactor/rpc-extension/lib/Response/UpdateFileSourceResponse.php on line 40
Can be temporarily fixed by reverting to the given PATH in the generate access handler when the source path is null, but would be better to ensure that the path was set.
changed the title [-][develop regression?] Generate method in same file fails[/-][+][develop regressio] Generate accessor in same file fails[/+]on Jan 8, 2019
Activity
dantleech commentedon Jan 8, 2019
Reopening as the same happens with generate accessor.
[-][develop regression?] Generate method in same file fails[/-][+][develop regressio] Generate accessor in same file fails[/+]dantleech commentedon Jan 13, 2019
Also error if the method already exists