-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
83 lines (63 loc) · 2.44 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
declare(strict_types = 1);
require_once __DIR__ . "/../../../src/web_bootstrap.php";
use Learning\LearningSection;
use OpenDocs\GlobalPageInfo;
use OpenDocs\Page;
use function Learning\createGlobalPageInfoForLearning;
function getHtml(LearningSection $section)
{
$html = <<< HTML
<h1>Learning PHP</h1>
<p>
So you want to learn some PHP ?
</p>
<h2>Info for people who already know how to code</h2>
<p>
<a href="{$section->getPrefix()}/php_for_people_who_know_how_to_code">PHP for people who know how to code</a>
</p>
<h2>Library recommendations</h2>
<ul>
<li>
<a href='{$section->getPrefix()}/php_static_analysis_tools'>Static analysis tools</a> - A curated list of static analysis tools for PHP.</li>
</li>
</ul>
<h2>Best practices</h2>
<ul>
<li>
<a href='{$section->getPrefix()}/best_practice_exceptions'>Exceptions</a> - How to use exceptions successfully, and avoid bad patterns.
</li>
<li>
<a href='{$section->getPrefix()}/best_practice_interfaces_for_external_apis'>Interfaces for external apis</a> - People make several common mistakes when using external apis.
</li>
</ul>
<h2>Good docs</h2>
<ul>
<li>
<a href="{$section->getPrefix()}/java_exception_antipatterns">Java exception anti-patterns</a> - An article from 2006 about common anti-patterns regarding exceptions in Java.
</li>
<li>
<a href="{$section->getPrefix()}/unit_testing_tips">Unit testing tips</a>
</li>
</ul>
<h2>External links</h2>
<ul>
<li>
<a href="https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/">Falsehoods Programmers Believe About Names</a> - A list of assumptions your systems probably make about names. All of these assumptions are wrong. Try to make less of them next time you write a system which touches names.
</li>
<li>
<a href="https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/">What Color is Your Function?</a> - A list of assumptions your systems probably make about names. All of these assumptions are wrong. Try to make less of them next time you write a system which touches names.
</li>
</ul>
HTML;
return $html;
}
$fn = function (LearningSection $section): Page
{
createGlobalPageInfoForLearning(
title: 'Learning'
);
GlobalPageInfo::setContentHtml(getHtml($section));
return \OpenDocs\Page::createFromHtmlGlobalPageInfo();
};
showResponse($fn);