This commit is contained in:
Rasmus Lerdorf
2019-11-10 10:14:42 +01:00
parent e82655c853
commit 97d3f43dd4
4 changed files with 102 additions and 2 deletions

View File

@@ -651,6 +651,53 @@ $ cat /tmp/output | stackcollapse-phpspy.pl | flamegraph.pl &gt; flame.svg</code
<section id="spy5">
<object data="/presentations/slides/intro/phan.svg" type="image/svg+xml" align="center" width="80%" height="80%">Use a newer browser, please</object>
</section> </section>
<section>
<section id="phan">
<h1 style="text-align:center;">Static Analysis</h1>
<br/>
<br/>
<div align="center" style="font-size: 2em; color: ; text-align: center; margin-left: ; margin-right: ; margin-top: ; margin-bottom: ;"><a href="https://github.com/phan/phan" target="">github.com/phan/phan</a></div>
</section>
<section id="phan0">
<p class="p" style="font-size:1.5em;text-align:left;">Install with composer</p>
<pre><code class="shell nohighlight" data-trim style="font-size:1em;" >$ composer require --dev phan/phan</code></pre>
<p class="p" style="font-size:1.5em;text-align:left;">Create .phan/config.php</p>
<pre><code class="shell nohighlight" data-trim style="font-size:1em;" >return [
'target_php_version' =&gt; '7.2',
'directory_list' =&gt; [ 'src/' ],
&quot;exclude_analysis_directory_list&quot; =&gt; [ 'vendor/' ],
];</code></pre>
<pre><code class="shell nohighlight" data-trim style="font-size:1em;" >$ ./vendor/bin/phan</code></pre>
</section>
<section id="phan2">
<p class="p" style="font-size:1.5em;text-align:center;">Phan in Browser</p>
<div align="center" style="font-size: 2em; color: ; text-align: center; margin-left: ; margin-right: ; margin-top: ; margin-bottom: ;"><a href="https://phan.github.io/demo/" target="">phan.github.io/demo/</a></div>
</section>
<section id="phan3">
<p class="p" style="font-size:1.5em;text-align:center;">Dependency Graph Plugin</p>
<div align="center" style="font-size: 2em; color: ; text-align: center; margin-left: ; margin-right: ; margin-top: ; margin-bottom: ;"><a href="http://pdep.lerdorf.com/?mode=class&node=\Grav\Common\File\CompiledFile&d=1" target="">pdep example</a></div>
</section>
<section id="phan4">
<p class="p" style="font-size:2em;text-align:left;">Daemon mode</p>
<pre><code class="shell nohighlight" data-trim style="font-size:1em;" >$ phan --daemonize-tcp-port default &amp;
[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</code></pre>
<pre><code class="shell nohighlight" data-trim style="font-size:1em;" >$ 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</code></pre>
</section>
<section id="phan5">
<p class="p" style="font-size:1.5em;text-align:left;">vim integration</p>
<div id="container">
<video id='video' controls="controls" preload='none' onclick='this.paused ? this.play() : this.pause();'
width="1848" >
<source id='mp4' src="presentations/slides/intro/phanvid.mp4" type='video/mp4'/>
<p>Your user agent does not support the HTML5 Video element.</p>
</video>
</div> </section> </section>
<section data-background-color="#000000">
<section id="j">
<img src="/presentations/slides/intro/carl1.jpg" align="center" width="533" height="800">
@@ -692,7 +739,7 @@ $ cat /tmp/output | stackcollapse-phpspy.pl | flamegraph.pl &gt; flame.svg</code
<div align="left" style="font-size: 1em; color: ; text-align: left; margin-left: -1em; margin-right: ; margin-top: ; margin-bottom: ;"><a href=":-:url:-:" target="">http://talks.php.net/phpbcn19</a></div>
<div align="left" style="font-size: 1em; color: ; text-align: left; margin-left: -1em; margin-right: ; margin-top: ; margin-bottom: ;"><a href="https://github.com/phan/phan" target="">https://github.com/phan/phan</a></div>
<div align="left" style="font-size: 1em; color: ; text-align: left; margin-left: -1em; margin-right: ; margin-top: ; margin-bottom: ;"><a href="https://github.com/adsr/phpspy" target="">https://github.com/adsr/phpspy</a></div>
<div align="left" style="font-size: 1em; color: ; text-align: left; margin-left: -1em; margin-right: ; margin-top: ; margin-bottom: ;"><a href="http://php.net/migration73" target="">http://php.net/migration73</a></div>
<div align="left" style="font-size: 1em; color: ; text-align: left; margin-left: -1em; margin-right: ; margin-top: ; margin-bottom: ;"><a href="http://php.net/migration73" target="">http://php.net/migration74</a></div>
<div align="left" style="font-size: 1em; color: ; text-align: left; margin-left: -1em; margin-right: ; margin-top: ; margin-bottom: ;"><a href="https://bugs.php.net" target="">https://bugs.php.net</a></div>
<br/>
<br/>

View File

@@ -39,6 +39,7 @@
<slide>slides/intro/supported.xml</slide>
<slide>slides/intro/php74_2019.xml</slide>
<slide>slides/intro/phpspy.xml</slide>
<slide>slides/intro/phan_2019.xml</slide>
<slide>slides/intro/journey2.xml</slide>
<slide>slides/intro/sahana.xml</slide>
<slide>slides/intro/matter.xml</slide>

View File

@@ -0,0 +1,52 @@
<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' => '7.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>
<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>
<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>

View File

@@ -5,7 +5,7 @@
<link fontsize="1em" align="left" marginleft="-1em" href=":-:url:-:">:-:url:-:</link>
<link fontsize="1em" align="left" marginleft="-1em" href="https://github.com/phan/phan">https://github.com/phan/phan</link>
<link fontsize="1em" align="left" marginleft="-1em" href="https://github.com/adsr/phpspy">https://github.com/adsr/phpspy</link>
<link fontsize="1em" align="left" marginleft="-1em" href="http://php.net/migration73">http://php.net/migration73</link>
<link fontsize="1em" align="left" marginleft="-1em" href="http://php.net/migration73">http://php.net/migration74</link>
<link fontsize="1em" align="left" marginleft="-1em" href="https://bugs.php.net">https://bugs.php.net</link>
<break lines="3"/>