{"action":"created","issue":{"url":"https://api.github.com/repos/etsy/phan/issues/240","repository_url":"https://api.github.com/repos/etsy/phan","labels_url":"https://api.github.com/repos/etsy/phan/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/etsy/phan/issues/240/comments","events_url":"https://api.github.com/repos/etsy/phan/issues/240/events","html_url":"https://github.com/etsy/phan/issues/240","id":151228301,"number":240,"title":"TypeError: Return value of Phan\\Language\\Scope::getParentScope() must be an instance of Phan\\Language\\Scope, null returned","user":{"login":"oligriffiths","id":1246671,"avatar_url":"https://avatars.githubusercontent.com/u/1246671?v=3","gravatar_id":"","url":"https://api.github.com/users/oligriffiths","html_url":"https://github.com/oligriffiths","followers_url":"https://api.github.com/users/oligriffiths/followers","following_url":"https://api.github.com/users/oligriffiths/following{/other_user}","gists_url":"https://api.github.com/users/oligriffiths/gists{/gist_id}","starred_url":"https://api.github.com/users/oligriffiths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oligriffiths/subscriptions","organizations_url":"https://api.github.com/users/oligriffiths/orgs","repos_url":"https://api.github.com/users/oligriffiths/repos","events_url":"https://api.github.com/users/oligriffiths/events{/privacy}","received_events_url":"https://api.github.com/users/oligriffiths/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/etsy/phan/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"morria","id":387209,"avatar_url":"https://avatars.githubusercontent.com/u/387209?v=3","gravatar_id":"","url":"https://api.github.com/users/morria","html_url":"https://github.com/morria","followers_url":"https://api.github.com/users/morria/followers","following_url":"https://api.github.com/users/morria/following{/other_user}","gists_url":"https://api.github.com/users/morria/gists{/gist_id}","starred_url":"https://api.github.com/users/morria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morria/subscriptions","organizations_url":"https://api.github.com/users/morria/orgs","repos_url":"https://api.github.com/users/morria/repos","events_url":"https://api.github.com/users/morria/events{/privacy}","received_events_url":"https://api.github.com/users/morria/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-04-26T20:13:43Z","updated_at":"2016-04-26T20:33:45Z","closed_at":null,"body":"Hi\r\n\r\nI just updated phan to the latest version, and I'm now getting the following error when running:\r\n\r\n```\r\n~/.composer/vendor/etsy/phan/phan -i\r\n\r\nTypeError: Return value of Phan\\Language\\Scope::getParentScope() must be an instance of Phan\\Language\\Scope, null returned in /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/Scope.php:54\r\nStack trace:\r\n#0 /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/Scope.php(93): Phan\\Language\\Scope->getParentScope()\r\n#1 /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/Context.php(277): Phan\\Language\\Scope->getClassFQSEN()\r\n#2 /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/Context.php(296): Phan\\Language\\Context->getClassFQSEN()\r\n#3 /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/UnionType.php(535): Phan\\Language\\Context->getClassInScope(Object(Phan\\CodeBase))\r\n#4 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/ContextNode.php(167): Phan\\Language\\UnionType->asClassList(Object(Phan\\CodeBase), Object(Phan\\Language\\Context))\r\n#5 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/ContextNode.php(730): Phan\\AST\\ContextNode->getClassList()\r\n#6 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/UnionTypeVisitor.php(934): Phan\\AST\\ContextNode->getClassConst()\r\n#7 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(57): Phan\\AST\\UnionTypeVisitor->visitClassConst(Object(ast\\Node))\r\n#8 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(22): Phan\\AST\\Visitor\\Element->acceptKindVisitor(Object(Phan\\AST\\UnionTypeVisitor))\r\n#9 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/UnionTypeVisitor.php(116): Phan\\AST\\Visitor\\KindVisitorImplementation->__invoke(Object(ast\\Node))\r\n#10 /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/UnionType.php(151): Phan\\AST\\UnionTypeVisitor::unionTypeFromNode(Object(Phan\\CodeBase), Object(Phan\\Language\\Context), Object(ast\\Node), true)\r\n#11 /home/oli/.composer/vendor/etsy/phan/src/Phan/Analysis/BinaryOperatorFlagVisitor.php(181): Phan\\Language\\UnionType::fromNode(Object(Phan\\Language\\Context), Object(Phan\\CodeBase), Object(ast\\Node))\r\n#12 /home/oli/.composer/vendor/etsy/phan/src/Phan/Analysis/BinaryOperatorFlagVisitor.php(249): Phan\\Analysis\\BinaryOperatorFlagVisitor->visitBinaryOpCommon(Object(ast\\Node))\r\n#13 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(300): Phan\\Analysis\\BinaryOperatorFlagVisitor->visitBinaryIsEqual(Object(ast\\Node))\r\n#14 /home/oli/.composer/vendor/etsy/phan/src/Phan/Analysis/BinaryOperatorFlagVisitor.php(60): Phan\\AST\\Visitor\\Element->acceptBinaryFlagVisitor(Object(Phan\\Analysis\\BinaryOperatorFlagVisitor))\r\n#15 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/UnionTypeVisitor.php(598): Phan\\Analysis\\BinaryOperatorFlagVisitor->__invoke(Object(ast\\Node))\r\n#16 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(45): Phan\\AST\\UnionTypeVisitor->visitBinaryOp(Object(ast\\Node))\r\n#17 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(22): Phan\\AST\\Visitor\\Element->acceptKindVisitor(Object(Phan\\AST\\UnionTypeVisitor))\r\n#18 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/UnionTypeVisitor.php(116): Phan\\AST\\Visitor\\KindVisitorImplementation->__invoke(Object(ast\\Node))\r\n#19 /home/oli/.composer/vendor/etsy/phan/src/Phan/Language/UnionType.php(151): Phan\\AST\\UnionTypeVisitor::unionTypeFromNode(Object(Phan\\CodeBase), Object(Phan\\Language\\Context), Object(ast\\Node), true)\r\n#20 /home/oli/.composer/vendor/etsy/phan/src/Phan/Analysis/PreOrderAnalysisVisitor.php(555): Phan\\Language\\UnionType::fromNode(Object(Phan\\Language\\Context), Object(Phan\\CodeBase), Object(ast\\Node))\r\n#21 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(107): Phan\\Analysis\\PreOrderAnalysisVisitor->visitIfElem(Object(ast\\Node))\r\n#22 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(22): Phan\\AST\\Visitor\\Element->acceptKindVisitor(Object(Phan\\Analysis\\PreOrderAnalysisVisitor))\r\n#23 /home/oli/.composer/vendor/etsy/phan/src/Phan/BlockAnalysisVisitor.php(252): Phan\\AST\\Visitor\\KindVisitorImplementation->__invoke(Object(ast\\Node))\r\n#24 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(107): Phan\\BlockAnalysisVisitor->visitIfElem(Object(ast\\Node))\r\n#25 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(22): Phan\\AST\\Visitor\\Element->acceptKindVisitor(Object(Phan\\BlockAnalysisVisitor))\r\n#26 /home/oli/.composer/vendor/etsy/phan/src/Phan/BlockAnalysisVisitor.php(203): Phan\\AST\\Visitor\\KindVisitorImplementation->__invoke(Object(ast\\Node))\r\n#27 /home/oli/.composer/vendor/etsy/phan/src/Phan/BlockAnalysisVisitor.php(401): Phan\\BlockAnalysisVisitor->visitBranchedContext(Object(ast\\Node))\r\n#28 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(105): Phan\\BlockAnalysisVisitor->visitIf(Object(ast\\Node))\r\n#29 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(22): Phan\\AST\\Visitor\\Element->acceptKindVisitor(Object(Phan\\BlockAnalysisVisitor))\r\n#30 /home/oli/.composer/vendor/etsy/phan/src/Phan/BlockAnalysisVisitor.php(113): Phan\\AST\\Visitor\\KindVisitorImplementation->__invoke(Object(ast\\Node))\r\n#31 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(312): Phan\\BlockAnalysisVisitor->visit(Object(ast\\Node))\r\n#32 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/Element.php(147): Phan\\AST\\Visitor\\KindVisitorImplementation->visitStmtList(Object(ast\\Node))\r\n#33 /home/oli/.composer/vendor/etsy/phan/src/Phan/AST/Visitor/KindVisitorImplementation.php(22): Phan\\AST\\Visitor\\Element->acceptKindVisitor(Object(Phan\\BlockAnalysisVisitor))\r\n#34 /home/oli/.composer/vendor/etsy/phan/src/Phan/Analysis.php(345): Phan\\AST\\Visitor\\KindVisitorImplementation->__invoke(Object(ast\\Node))\r\n#35 /home/oli/.composer/vendor/etsy/phan/src/Phan/Phan.php(162): Phan\\Analysis::analyzeFile(Object(Phan\\CodeBase), './app/compiled_...')\r\n#36 /home/oli/.composer/vendor/etsy/phan/src/Phan/ForkPool.php(101): Phan\\Phan::Phan\\{closure}(142, './app/compiled_...')\r\n#37 /home/oli/.composer/vendor/etsy/phan/src/Phan/Phan.php(190): Phan\\ForkPool->__construct(Array, Object(Closure), Object(Closure), Object(Closure))\r\n#38 /home/oli/.composer/vendor/etsy/phan/src/phan.php(42): Phan\\Phan::analyzeFileList(Object(Phan\\CodeBase), Array)\r\n#39 /home/oli/.composer/vendor/etsy/phan/phan(2): require_once('/home/oli/.comp...')\r\n#40 {main}\r\n```\r\n\r\nMy config file looks like this:\r\n```php\r\n<?php\r\n\r\nuse \\Phan\\Config;\r\nuse \\Phan\\Issue;\r\n\r\n/**\r\n * This configuration will be read and overlayed on top of the\r\n * default configuration. Command line arguments will be applied\r\n * after this file is read.\r\n *\r\n * @see src/Phan/Config.php\r\n * See Config for all configurable options.\r\n *\r\n * A Note About Paths\r\n * ==================\r\n *\r\n * Files referenced from this file should be defined as\r\n *\r\n * ```\r\n *   Config::projectPath('relative_path/to/file')\r\n * ```\r\n *\r\n * where the relative path is relative to the root of the\r\n * project which is defined as either the working directory\r\n * of the phan executable or a path passed in via the CLI\r\n * '-d' flag.\r\n */\r\nreturn [\r\n\t\r\n        // A list of directories that should be parsed for class and\r\n        // method information. After excluding the directories\r\n        // defined in exclude_analysis_directory_list, the remaining\r\n        // files will be statically analyzed for errors.\r\n        //\r\n        // Thus, both first-party and third-party code being used by\r\n        // your application should be included in this list.\r\n        'directory_list' => ['./'],\r\n\r\n        // A directory list that defines files that will be excluded\r\n        // from static analysis, but whose class and method\r\n        // information should be included.\r\n        //\r\n        // Generally, you'll want to include the directories for\r\n        // third-party code (such as \"vendor/\") in this list.\r\n        //\r\n        // n.b.: If you'd like to parse but not analyze 3rd\r\n        //       party code, directories containing that code\r\n        //       should be added to the `directory_list` as\r\n        //       to `excluce_analysis_directory_list`.\r\n    'exclude_analysis_directory_list' => ['vendor', 'node_modules'],\r\n\r\n        // Backwards Compatibility Checking. This is slow\r\n        // and expensive, but you should consider running\r\n        // it before upgrading your version of PHP to a\r\n        // new version that has backward compatibility\r\n        // breaks.\r\n    'backward_compatibility_checks' => true,\r\n\r\n\r\n        // Run a quick version of checks that takes less\r\n        // time at the cost of not running as thorough\r\n        // an analysis. You should consider setting this\r\n        // to true only when you wish you had more issues\r\n        // to fix in your code base.\r\n        'quick_mode' => true,\r\n\r\n        // If enabled, check all methods that override a\r\n        // parent method to make sure its signature is\r\n        // compatible with the parent's. This check\r\n        // can add quite a bit of time to the analysis.\r\n    'analyze_signature_compatibility' => false,\r\n\r\n        // If true, missing properties will be created when\r\n        // they are first seen. If false, we'll report an\r\n        // error message if there is an attempt to write\r\n        // to a class property that wasn't explicitly\r\n        // defined.\r\n    'allow_missing_properties' => true,\r\n\r\n        // If enabled, scalars (int, float, bool, string, null)\r\n        // are treated as if they can cast to each other.\r\n    'scalar_implicit_cast' => true,\r\n\r\n        // Include a progress bar in the output\r\n    'progress_bar' => true,\r\n\r\n        // The number of processes to fork off during the analysis\r\n        // phase.\r\n    'processes' => 12,\r\n\r\n        // Add any issue types (such as 'PhanUndeclaredMethod')\r\n        // here to inhibit them from being reported\r\n    'suppress_issue_types' => [\r\n        'PhanAccessNonStaticToStatic',\r\n        'PhanAccessPropertyPrivate',\r\n        'PhanAccessPropertyProtected',\r\n        'PhanAccessSignatureMismatch',\r\n        'PhanAccessSignatureMismatchInternal',\r\n        'PhanAccessStaticToNonStatic',\r\n        'PhanCompatibleExpressionPHP7',\r\n        'PhanCompatiblePHP7',\r\n        'PhanContextNotObject',\r\n        'PhanDeprecatedClass',\r\n        'PhanDeprecatedFunction',\r\n        'PhanEmptyFile',\r\n        'PhanNonClassMethodCall',\r\n        'PhanNoopArray',\r\n        'PhanNoopClosure',\r\n        'PhanNoopConstant',\r\n        'PhanNoopProperty',\r\n        'PhanNoopVariable',\r\n        'PhanParamReqAfterOpt',\r\n        'PhanParamSpecial1',\r\n        'PhanParamSpecial2',\r\n        'PhanParamSpecial3',\r\n        'PhanParamSpecial4',\r\n        'PhanParamTooFew',\r\n        'PhanParamTooFewInternal',\r\n        'PhanParamTooMany',\r\n        'PhanParamTooManyInternal',\r\n        'PhanParamTypeMismatch',\r\n        'PhanParentlessClass',\r\n        'PhanRedefineClass',\r\n        'PhanRedefineClassInternal',\r\n        'PhanRedefineFunction',\r\n        'PhanRedefineFunctionInternal',\r\n        'PhanSignatureMismatch',\r\n        'PhanSignatureMismatchInternal',\r\n        'PhanStaticCallToNonStatic',\r\n        'PhanSyntaxError',\r\n        'PhanTraitParentReference',\r\n        'PhanTypeArrayOperator',\r\n        'PhanTypeArraySuspicious',\r\n        'PhanTypeComparisonFromArray',\r\n        'PhanTypeComparisonToArray',\r\n        'PhanTypeConversionFromArray',\r\n        'PhanTypeInstantiateAbstract',\r\n        'PhanTypeInstantiateInterface',\r\n        'PhanTypeInvalidLeftOperand',\r\n        'PhanTypeInvalidRightOperand',\r\n        'PhanTypeMismatchArgument',\r\n        'PhanTypeMismatchArgumentInternal',\r\n        'PhanTypeMismatchDefault',\r\n        'PhanTypeMismatchForeach',\r\n        'PhanTypeMismatchProperty',\r\n        'PhanTypeMismatchReturn',\r\n        'PhanTypeMissingReturn',\r\n        'PhanTypeNonVarPassByRef',\r\n        'PhanTypeParentConstructorCalled',\r\n        'PhanTypeVoidAssignment',\r\n        'PhanUnanalyzable',\r\n        'PhanUndeclaredClass',\r\n        'PhanUndeclaredClassCatch',\r\n        'PhanUndeclaredClassConstant',\r\n        'PhanUndeclaredClassInstanceof',\r\n        'PhanUndeclaredClassMethod',\r\n        'PhanUndeclaredClassReference',\r\n        'PhanUndeclaredConstant',\r\n        'PhanUndeclaredExtendedClass',\r\n        'PhanUndeclaredFunction',\r\n        'PhanUndeclaredInterface',\r\n        'PhanUndeclaredMethod',\r\n        'PhanUndeclaredProperty',\r\n        'PhanUndeclaredStaticMethod',\r\n        'PhanUndeclaredStaticProperty',\r\n        'PhanUndeclaredTrait',\r\n        'PhanUndeclaredTypeParameter',\r\n        'PhanUndeclaredTypeProperty',\r\n        'PhanUndeclaredVariable',\r\n        'PhanUnreferencedClass',\r\n        'PhanUnreferencedConstant',\r\n        'PhanUnreferencedMethod',\r\n        'PhanUnreferencedProperty',\r\n        'PhanVariableUseClause',\r\n    ],\r\n];\r\n```\r\n\r\nAny ideas? I just want to scan for PHP7 compatibility errors"},"comment":{"url":"https://api.github.com/repos/etsy/phan/issues/comments/214877246","html_url":"https://github.com/etsy/phan/issues/240#issuecomment-214877246","issue_url":"https://api.github.com/repos/etsy/phan/issues/240","id":214877246,"user":{"login":"oligriffiths","id":1246671,"avatar_url":"https://avatars.githubusercontent.com/u/1246671?v=3","gravatar_id":"","url":"https://api.github.com/users/oligriffiths","html_url":"https://github.com/oligriffiths","followers_url":"https://api.github.com/users/oligriffiths/followers","following_url":"https://api.github.com/users/oligriffiths/following{/other_user}","gists_url":"https://api.github.com/users/oligriffiths/gists{/gist_id}","starred_url":"https://api.github.com/users/oligriffiths/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oligriffiths/subscriptions","organizations_url":"https://api.github.com/users/oligriffiths/orgs","repos_url":"https://api.github.com/users/oligriffiths/repos","events_url":"https://api.github.com/users/oligriffiths/events{/privacy}","received_events_url":"https://api.github.com/users/oligriffiths/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T20:33:45Z","updated_at":"2016-04-26T20:33:45Z","body":"Ah, I can see it's one of our compiled templates, let me take a look and see."}}