]> khamidou — GitHub mirrors - arcanist.git/commit
Provide a simpler analyzer script for killing __init__.php
authorepriestley <git@epriestley.com>
Thu, 24 May 2012 17:56:56 +0000 (10:56 -0700)
committerepriestley <git@epriestley.com>
Thu, 24 May 2012 17:56:56 +0000 (10:56 -0700)
commit81976ff2ff9338e4544677dbcb76c47825aa7c2d
treeb79489337dce52ac2df8ecdf38e5bc9e49519827
parentee41e9c72085e7a5ae1099251b758d570f548a40
Provide a simpler analyzer script for killing __init__.php

Summary:
The `phutil_analyzer.php` script currently analyzes entire modules and is fairly complex. We don't need or want this in a post-__init__.php world.

This is basically a simplified version of `phutil_analyzer.php`, which takes one file and emits symbols.

Test Plan:
```$ ./scripts/phutil_symbols.php resources/test/diverse_symbols.php
{
  "have" : {
    "function"  : {
      "f" : 348
    },
    "class"     : {
      "L"      : 308,
      "A"      : 497,
      "C"      : 509,
      "D"      : 531,
      "CLocal" : 627
    },
    "interface" : {
      "ILocal" : 593
    }
  },
  "need" : {
    "function"  : {
      "g" : 402,
      "h" : 462
    },
    "class"     : {
      "B"         : 519,
      "INonlocal" : 642,
      "U"         : 552,
      "X"         : 421,
      "V"         : 557,
      "W"         : 565,
      "P"         : 572
    },
    "interface" : {
      "IForeign" : 608
    }
  }
}```

Reviewers: vrana, nh, btrahan

Reviewed By: vrana

CC: aran
Maniphest Tasks: T1103

Differential Revision: https://secure.phabricator.com/D2561
resources/test/diverse_symbols.php.example [new file with mode: 0644]
scripts/phutil_symbols.php [new file with mode: 0755]