Skip to content

Commit 7c6aa96

Browse files
committed
Deploy multi-version support
- PHP versions: 8.1.33, 8.2.30, 8.3.29, 8.4.16, 8.5.1 - Phan versions: 5.5.2, v6-dev - php-ast versions: 1.1.2, 1.1.3 - User-selectable PHP, Phan, and ast versions
1 parent 49ac0df commit 7c6aa96

File tree

3 files changed

+292
-10
lines changed

3 files changed

+292
-10
lines changed

index.html

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,19 +366,68 @@ <h1>Phan in Browser</h1>
366366
<div id="plugin-modal" class="modal">
367367
<div class="modal-content">
368368
<div class="modal-header">
369-
<h2>Configure Phan Plugins</h2>
369+
<h2>Configure Phan Analysis</h2>
370370
<button class="modal-close" id="modal-close">&times;</button>
371371
</div>
372372
<div class="modal-body">
373-
<div class="level-buttons">
374-
<button class="level-btn" data-level="1">Level 1</button>
375-
<button class="level-btn" data-level="2">Level 2</button>
376-
<button class="level-btn" data-level="3">Level 3</button>
377-
<button class="level-btn" data-level="4">Level 4</button>
378-
<button class="level-btn" data-level="5">Level 5</button>
373+
<div class="plugins-section">
374+
<h3>Plugins</h3>
375+
<div class="level-buttons">
376+
<button class="level-btn" data-level="1">Level 1</button>
377+
<button class="level-btn" data-level="2">Level 2</button>
378+
<button class="level-btn" data-level="3">Level 3</button>
379+
<button class="level-btn" data-level="4">Level 4</button>
380+
<button class="level-btn" data-level="5">Level 5</button>
381+
</div>
382+
<div class="plugin-list" id="plugin-list">
383+
<!-- Plugins will be populated by JavaScript -->
384+
</div>
379385
</div>
380-
<div class="plugin-list" id="plugin-list">
381-
<!-- Plugins will be populated by JavaScript -->
386+
387+
<div class="strict-checking-section">
388+
<h3>Strict Type Checking</h3>
389+
<p class="section-description">When enabled, Phan will warn if <strong>any</strong> type in a union cannot be cast to the expected type. This reveals more bugs but may introduce false positives.</p>
390+
<div class="strict-checking-list" id="strict-checking-list">
391+
<div class="strict-item">
392+
<input type="checkbox" id="strict-method" value="strict_method_checking">
393+
<label for="strict-method">
394+
<span class="strict-name">strict_method_checking</span>
395+
<span class="strict-desc">Warn if any type in a method invocation's object is not an object, or if any type is not callable</span>
396+
</label>
397+
</div>
398+
<div class="strict-item">
399+
<input type="checkbox" id="strict-param" value="strict_param_checking">
400+
<label for="strict-param">
401+
<span class="strict-name">strict_param_checking</span>
402+
<span class="strict-desc">Warn if any type in an argument cannot be cast to the parameter's expected type</span>
403+
</label>
404+
</div>
405+
<div class="strict-item">
406+
<input type="checkbox" id="strict-property" value="strict_property_checking">
407+
<label for="strict-property">
408+
<span class="strict-name">strict_property_checking</span>
409+
<span class="strict-desc">Warn if any type in a property assignment cannot be cast to the property's declared type</span>
410+
</label>
411+
</div>
412+
<div class="strict-item">
413+
<input type="checkbox" id="strict-return" value="strict_return_checking">
414+
<label for="strict-return">
415+
<span class="strict-name">strict_return_checking</span>
416+
<span class="strict-desc">Warn if any type in a returned value cannot be cast to the declared return type</span>
417+
</label>
418+
</div>
419+
<div class="strict-item">
420+
<input type="checkbox" id="strict-object" value="strict_object_checking">
421+
<label for="strict-object">
422+
<span class="strict-name">strict_object_checking</span>
423+
<span class="strict-desc">Warn if any type of the object expression for a property access does not contain that property</span>
424+
</label>
425+
</div>
426+
</div>
427+
<div class="strict-buttons">
428+
<button class="strict-btn" id="strict-all">Enable All</button>
429+
<button class="strict-btn" id="strict-none">Disable All</button>
430+
</div>
382431
</div>
383432
</div>
384433
<div class="modal-footer">

static/demo.css

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,12 @@ h1 {
471471
color: white;
472472
}
473473

474+
.plugins-section h3 {
475+
margin: 0 0 0.75em 0;
476+
font-size: 1.2em;
477+
color: var(--text-primary);
478+
}
479+
474480
.plugin-list {
475481
display: grid;
476482
grid-template-columns: 1fr 1fr;
@@ -1375,3 +1381,94 @@ h1 {
13751381
margin-bottom: 0.5em;
13761382
opacity: 0.3;
13771383
}
1384+
1385+
/* Strict Type Checking Section */
1386+
.strict-checking-section {
1387+
margin-top: 2em;
1388+
padding-top: 1.5em;
1389+
border-top: 2px solid var(--border-color);
1390+
}
1391+
1392+
.strict-checking-section h3 {
1393+
margin: 0 0 0.5em 0;
1394+
font-size: 1.2em;
1395+
color: var(--text-primary);
1396+
}
1397+
1398+
.strict-checking-section .section-description {
1399+
margin: 0 0 1em 0;
1400+
font-size: 0.9em;
1401+
color: var(--text-secondary);
1402+
line-height: 1.4;
1403+
}
1404+
1405+
.strict-checking-list {
1406+
display: flex;
1407+
flex-direction: column;
1408+
gap: 0.5em;
1409+
}
1410+
1411+
.strict-item {
1412+
display: flex;
1413+
align-items: flex-start;
1414+
padding: 0.75em;
1415+
border-radius: 6px;
1416+
transition: background 0.2s;
1417+
}
1418+
1419+
.strict-item:hover {
1420+
background: var(--bg-secondary);
1421+
}
1422+
1423+
.strict-item input[type="checkbox"] {
1424+
width: 18px;
1425+
height: 18px;
1426+
margin-right: 0.75em;
1427+
margin-top: 2px;
1428+
cursor: pointer;
1429+
flex-shrink: 0;
1430+
}
1431+
1432+
.strict-item label {
1433+
cursor: pointer;
1434+
flex: 1;
1435+
display: flex;
1436+
flex-direction: column;
1437+
gap: 0.25em;
1438+
}
1439+
1440+
.strict-name {
1441+
font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
1442+
font-size: 0.95em;
1443+
font-weight: 600;
1444+
color: var(--text-primary);
1445+
}
1446+
1447+
.strict-desc {
1448+
font-size: 0.85em;
1449+
color: var(--text-secondary);
1450+
line-height: 1.3;
1451+
}
1452+
1453+
.strict-buttons {
1454+
display: flex;
1455+
gap: 0.5em;
1456+
margin-top: 1em;
1457+
}
1458+
1459+
.strict-btn {
1460+
padding: 0.5em 1em;
1461+
border: 2px solid var(--border-color);
1462+
background: var(--bg-primary);
1463+
border-radius: 6px;
1464+
cursor: pointer;
1465+
font-weight: 600;
1466+
font-size: 0.9em;
1467+
transition: all 0.2s;
1468+
color: var(--text-secondary);
1469+
}
1470+
1471+
.strict-btn:hover {
1472+
border-color: #0d6efd;
1473+
color: #0d6efd;
1474+
}

0 commit comments

Comments
 (0)