<slide title="" section="phan">

<blurb fontsize="20em" align="center">Static Analysis</blurb>
<break lines="2"/>
<link fontsize="2em" align="center" href="https://github.com/phan/phan">github.com/phan/phan</link>
<break lines="1" section="phan0"/>
<blurb fontsize="1.5em" align="left">Install with composer</blurb>
<example fontsize="1em" result='0' title="" type="shell nohighlight"><![CDATA[
$ composer require --dev phan/phan
]]></example>
<blurb fontsize="1.5em" align="left">Create .phan/config.php</blurb>
<example fontsize="1em" result='0' title="" type="shell nohighlight"><![CDATA[
<?php
return [
    'target_php_version' => '8.2',
    'directory_list' => [ 'src/' ],
    "exclude_analysis_directory_list" => [ 'vendor/' ],
];
]]></example>
<example fontsize="1em" result='0' title="" type="shell nohighlight"><![CDATA[
$ ./vendor/bin/phan
]]></example>

<break lines="1" section="phan2"/>
<blurb fontsize="1.5em" align="center">Phan in Browser</blurb>
<link fontsize="2em" align="center" href="https://phan.github.io/demo/">phan.github.io/demo/</link>

<break lines="1" section="phan3"/>
<blurb fontsize="1.5em" align="center">Dependency Graph Plugin</blurb>
<link fontsize="2em" align="center" href="http://pdep.lerdorf.com/?mode=class&amp;node=\Grav\Common\File\CompiledFile&amp;d=1">pdep example</link>

<notes>
Show what depends on the \Grav\Common\File\CompiledFile trait
</notes>

<break lines="1" section="phan4"/>
<blurb fontsize="2em" align="left">Daemon mode</blurb>
<example fontsize="1em" result='0' title="" type="shell nohighlight"><![CDATA[
$ phan --daemonize-tcp-port default &
[1] 28610
Listening for Phan analysis requests at tcp://127.0.0.1:4846
Awaiting analysis requests for directory '/home/rasmus/phan_demo'

$ vi src/script.php
]]></example>
<example fontsize="1em" result='0' title="" type="shell nohighlight"><![CDATA[
$ phan_client -l src/script.php
Phan error: TypeError: PhanTypeMismatchArgument: Argument 1 (union) is array{0:1} but \C::fn() takes int|string defined at src/script.php:8 in src/script.php on line 14
Phan error: TypeError: PhanTypeMismatchArgument: Argument 3 (shaped) is array{max:10} but \C::fn() takes array{mode:string,max:int} defined at src/script.php:8 in src/script.php on line 16
]]></example>
<notes>
You can run keep the entire graph in memory using daemon mode
which allows editor integration...
</notes>

<break lines="1" section="phan5"/>
<blurb fontsize="1.5em" align="left">vim integration</blurb>
<movie filename="phanvid.mp4" align="center" width="1848" height="1008" autoplay="false" replay="0"/>
</slide>
