Skip to content

About extends Path #3966

@ghost

Description

Support question

Thank you for awesome static analysis!
I have a problem about extend.

When I use web framework FuelPHP ,phpstan does not read extends path.
I try using symbol and autoload but it cannot solve the problem.
I would appreciate if you teach me solve the extends path problem.

details below.

・Command

../../../vendor/bin/phpstan analyse password.php

・Error from phpstan

Fatal error: Class 'Controller' not found in path_to_definition_file_at_Controller

・Extends Relations

Class Password is extended from Controller_Base.
Class Controller_Base is extended from Controller_Templates.
Controller_Templates is extended from Controller.

Password ← Controller_Base ← Controller_Templates ← Controller

・password.php

class Controller_Password extends Controller_Base

・phpstan.neon

parameters:
level: 7
scanFiles:
- %rootDir%/../../../core/classes/controller/template.php  // define abstract class Controller_Template extends \Controller
- %rootDir%/../../../core/classes/controller.php // define abxtract class Controller
- base.php // define class Controller_Base extends Controller_Template
scanDirectories:
- %rootDir%/../../../core/classes/controller/
- %rootDir%/../../../core/classes/
autoload_files:
- %rootDir%/../../../core/classes/controller.php
- %rootDir%/../../../core/classes/controller/template.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions