├── 1.start ├── .htaccess ├── Controllers │ ├── HomeController.php │ └── UserController.php ├── Models │ └── User.php ├── README.md ├── Views │ ├── 404.php │ ├── home.php │ ├── includes │ │ ├── __footer.php │ │ └── __header.php │ ├── login.php │ ├── register.php │ └── results.php ├── assets │ └── css │ │ └── main.css ├── config │ ├── config.php │ └── init.php ├── database.sql └── index.php ├── 2.finish ├── .htaccess ├── Controllers │ ├── HomeController.php │ └── UserController.php ├── Models │ └── User.php ├── README.md ├── Views │ ├── 404.php │ ├── home.php │ ├── includes │ │ ├── __footer.php │ │ └── __header.php │ ├── login.php │ ├── register.php │ └── results.php ├── assets │ └── css │ │ └── main.css ├── class │ ├── Config.php │ ├── Controller.php │ ├── ControllerFactory.php │ ├── Router.php │ ├── Validation.php │ └── index.php ├── config │ ├── config.php │ └── init.php ├── database.sql └── index.php └── README.md /1.start/.htaccess: -------------------------------------------------------------------------------- 1 | Options +FollowSymLinks 2 | RewriteEngine On 3 | RewriteRule ^(.*)$ index.php [NC,L] -------------------------------------------------------------------------------- /1.start/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | db = $db; 16 | 17 | } 18 | 19 | public function register() 20 | { 21 | unset($_SESSION['old_user']); 22 | $user = new User($this->db); 23 | 24 | if ($user->validate()) { 25 | $user->createUser(); 26 | $user->saveUser(); 27 | $_SESSION['msg'] = "Welcome, " . $_POST['name']; 28 | header("Location: home"); 29 | } else { 30 | $_SESSION['old_user'] = $_POST; 31 | header("Location: register"); 32 | 33 | } 34 | } 35 | 36 | public function login() 37 | { 38 | $email = $_POST['email']; 39 | $password = $_POST['password']; 40 | $user = new User($this->db); 41 | 42 | if ($user->loginUser($email, $password)) { 43 | $_SESSION['msg'] = "Welcome, " . $_SESSION['user']; 44 | header("Location: home"); 45 | } else { 46 | $_SESSION['msg'] = "Error loging in. Check your email and password"; 47 | header("Location: login"); 48 | } 49 | } 50 | 51 | public function findUser() 52 | { 53 | $user = new User($this->db); 54 | $result = $user->findUsers(); 55 | $_SESSION['result'] = $result; 56 | 57 | if (empty($result)) { 58 | $_SESSION['msg'] = "No results found"; 59 | header("Location: results"); 60 | } else { 61 | unset($_SESSION['msg']); 62 | header("Location: results"); 63 | } 64 | } 65 | 66 | public static function logout() 67 | { 68 | session_destroy(); 69 | header("Location: home"); 70 | } 71 | } -------------------------------------------------------------------------------- /1.start/Models/User.php: -------------------------------------------------------------------------------- 1 | db = $db; 16 | } 17 | 18 | public function createUser() 19 | { 20 | $this->email = $_POST['email']; 21 | $this->name = $_POST['name']; 22 | $this->password = $_POST['password_1']; 23 | } 24 | 25 | 26 | public function saveUser() 27 | { 28 | $hash = password_hash($this->password, PASSWORD_DEFAULT); 29 | 30 | $sql = ("insert into users (email, name, password) values (:email, :name, :password);"); 31 | $statement = $this->db->prepare($sql); 32 | $statement->execute([ 33 | "email" => $this->email, 34 | "name" => $this->name, 35 | "password" => $hash, 36 | ]); 37 | 38 | //TODO login registered user and redirect home 39 | 40 | } 41 | 42 | public function loginUser($email, $password) 43 | { 44 | 45 | $sql = ("select * from users where email = :email"); 46 | $statement = $this->db->prepare($sql); 47 | $statement->execute([ 48 | "email" => $email, 49 | ]); 50 | $result = $statement->fetch(PDO::FETCH_ASSOC); 51 | 52 | if ($result) { 53 | if (password_verify($password, $result['password'])) { 54 | $this->name = $result['name']; 55 | $this->email = $result['email']; 56 | $_SESSION['logged_in'] = true; 57 | $_SESSION['user'] = $this->name; 58 | $_SESSION['user_email'] = $this->email; 59 | return true; 60 | } 61 | } 62 | } 63 | 64 | 65 | /* 66 | * Find user by name or email 67 | * return array 68 | */ 69 | 70 | public function findUsers(): array 71 | { 72 | 73 | $searchTerm = $_POST['search']; 74 | 75 | if (strlen($searchTerm) < 1) return []; 76 | $sql = ("select email, name from users where email like :email or name like :name "); 77 | $statement = $this->db->prepare($sql); 78 | $statement->execute([ 79 | "email" => '%' . $searchTerm . '%', 80 | "name" => '%' . $searchTerm . '%', 81 | ]); 82 | 83 | return $statement->fetchAll(PDO::FETCH_ASSOC); 84 | 85 | } 86 | 87 | private function isRegistered($email) 88 | { 89 | $sql = ("select * from users where email = :email "); 90 | $statement = $this->db->prepare($sql); 91 | $statement->execute([ 92 | "email" => $email, 93 | 94 | ]); 95 | $result = $statement->fetch(PDO::FETCH_ASSOC); 96 | 97 | if ($result) return true; 98 | 99 | 100 | } 101 | 102 | 103 | public function validate() 104 | { 105 | 106 | unset($_SESSION['password_error']); 107 | unset($_SESSION['mail_error']); 108 | 109 | 110 | if ($this->isRegistered($_POST['email'])) { 111 | $_SESSION['mail_error'] = 'User already registered!'; 112 | return false; 113 | }; 114 | 115 | 116 | //Validate email 117 | 118 | 119 | //Check if mail is valid 120 | if (!$this->validateEmail($_POST['email'])) { 121 | $_SESSION['mail_error'] = 'Invalid email address'; 122 | return false; 123 | } 124 | 125 | //Check if both passwords match 126 | if ($_POST['password_1'] != $_POST['password_2']) { 127 | $_SESSION['password_error'] = 'Passwords doas not match'; 128 | return false; 129 | } 130 | 131 | //Check password lenth 132 | 133 | if (!$this->validatePassword($_POST['password_1'])) { 134 | $_SESSION['password_error'] = 'Passwords minimum lenghth is 5 characters'; 135 | return false; 136 | } 137 | 138 | return true; 139 | 140 | } 141 | 142 | private function validateEmail($email) 143 | { 144 | if (filter_var($email, FILTER_VALIDATE_EMAIL)) { 145 | return true; 146 | } else { 147 | return false; 148 | } 149 | } 150 | 151 | private function validatePassword($password) 152 | { 153 | 154 | //Set password minimum length 155 | if (strlen($password) < 5) { 156 | return false; 157 | } else return true; 158 | 159 | } 160 | 161 | } -------------------------------------------------------------------------------- /1.start/README.md: -------------------------------------------------------------------------------- 1 | login 2 | test@applicableprogramming.com 3 | test 4 | -------------------------------------------------------------------------------- /1.start/Views/404.php: -------------------------------------------------------------------------------- 1 |

Page not found

2 | -------------------------------------------------------------------------------- /1.start/Views/home.php: -------------------------------------------------------------------------------- 1 | ".$_SESSION['msg'].""; 9 | unset($_SESSION['msg']); 10 | 11 | } 12 | 13 | echo "

Index page

"; 14 | 15 | require_once 'includes/__footer.php'; 16 | -------------------------------------------------------------------------------- /1.start/Views/includes/__footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /1.start/Views/includes/__header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Code review #1 9 | 10 | 11 | 12 | 13 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /1.start/Views/login.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |

Please enter your email and password to log in

6 | 7 | ".$_SESSION['msg'].""; 12 | unset($_SESSION['msg']); 13 | }?> 14 | 15 |
16 | 17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 | 7 | 8 |

Please enter your data to register

9 |
10 | 11 | 14 | ".$_SESSION['mail_error'] ?> 15 |
16 | 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /1.start/Views/results.php: -------------------------------------------------------------------------------- 1 | ".$_SESSION['msg'].""; 10 | unset($_SESSION['msg']); 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 |
User NameUser Email
42 | 43 | setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 7 | $dbHandle->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); 8 | 9 | 10 | //TODO: Create Router class and make improvements 11 | 12 | $route = str_replace('', "", $_SERVER['REQUEST_URI']); 13 | $route = explode('/', $route); 14 | 15 | switch ($route[1]??'') { 16 | 17 | case '': 18 | case 'home': 19 | case 'index.php': 20 | HomeController::show(); 21 | break; 22 | 23 | case 'login': 24 | HomeController::showLoginForm(); 25 | break; 26 | 27 | case 'logout': 28 | UserController::logout(); 29 | break; 30 | 31 | case 'results': 32 | HomeController::showResults(); 33 | break; 34 | 35 | case 'register': 36 | HomeController::showRegisterForm(); 37 | break; 38 | 39 | case 'registerUser': 40 | $user = new UserController($dbHandle); 41 | $user->register(); 42 | break; 43 | 44 | case 'loginUser': 45 | $user = new UserController($dbHandle); 46 | $user->login(); 47 | break; 48 | 49 | case 'search': 50 | $user = new UserController($dbHandle); 51 | $user->findUser(); 52 | break; 53 | 54 | default: 55 | include 'Views/404.php'; 56 | break; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /2.finish/.htaccess: -------------------------------------------------------------------------------- 1 | Options +FollowSymLinks 2 | RewriteEngine On 3 | RewriteRule ^(.*)$ index.php [NC,L] -------------------------------------------------------------------------------- /2.finish/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | db = $db; 16 | 17 | } 18 | 19 | public function register() 20 | { 21 | unset($_SESSION['old_user']); 22 | $user = new User($this->db); 23 | 24 | if ($user->validate()) { 25 | $user->createUser(); 26 | $user->saveUser(); 27 | $_SESSION['msg'] = "Welcome, " . $_POST['name']; 28 | header("Location: home"); 29 | } else { 30 | $_SESSION['old_user'] = $_POST; 31 | header("Location: register"); 32 | 33 | } 34 | } 35 | 36 | public function login() 37 | { 38 | $email = $_POST['email']; 39 | $password = $_POST['password']; 40 | $user = new User($this->db); 41 | 42 | if ($user->loginUser($email, $password)) { 43 | $_SESSION['msg'] = "Welcome, " . $_SESSION['user']; 44 | header("Location: home"); 45 | } else { 46 | $_SESSION['msg'] = "Error loging in. Check your email and password"; 47 | header("Location: login"); 48 | } 49 | } 50 | 51 | public function findUser() 52 | { 53 | $user = new User($this->db); 54 | $result = $user->findUsers(); 55 | $_SESSION['result'] = $result; 56 | 57 | if (empty($result)) { 58 | $_SESSION['msg'] = "No results found"; 59 | header("Location: results"); 60 | } else { 61 | unset($_SESSION['msg']); 62 | include 'Views/results.php'; 63 | } 64 | } 65 | 66 | public static function logout() 67 | { 68 | session_destroy(); 69 | header("Location: home"); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /2.finish/Models/User.php: -------------------------------------------------------------------------------- 1 | db = $db; 16 | } 17 | 18 | public function createUser() 19 | { 20 | $this->email = $_POST['email']; 21 | $this->name = $_POST['name']; 22 | $this->password = $_POST['password_1']; 23 | } 24 | 25 | 26 | public function saveUser() 27 | { 28 | $hash = password_hash($this->password, PASSWORD_DEFAULT); 29 | 30 | $sql = ("insert into users (email, name, password) values (:email, :name, :password);"); 31 | $statement = $this->db->prepare($sql); 32 | $statement->execute([ 33 | "email" => $this->email, 34 | "name" => $this->name, 35 | "password" => $hash, 36 | ]); 37 | 38 | //TODO login registered user and redirect home 39 | 40 | } 41 | 42 | public function loginUser($email, $password) 43 | { 44 | 45 | $sql = ("SELECT * FROM users WHERE email = :email"); 46 | $statement = $this->db->prepare($sql); 47 | $statement->execute([ 48 | "email" => $email, 49 | ]); 50 | $result = $statement->fetch(PDO::FETCH_ASSOC); 51 | 52 | if ($result) { 53 | if (password_verify($password, $result['password'])) { 54 | $this->name = $result['name']; 55 | $this->email = $result['email']; 56 | $_SESSION['logged_in'] = true; 57 | $_SESSION['user'] = $this->name; 58 | $_SESSION['user_email'] = $this->email; 59 | return true; 60 | } 61 | } 62 | } 63 | 64 | 65 | /* 66 | * Find user by name or email 67 | * return array 68 | */ 69 | 70 | public function findUsers(): array 71 | { 72 | 73 | $searchTerm = $_POST['search']; 74 | 75 | if (strlen($searchTerm) < 1) return []; 76 | $sql = ("select email, name from users where email like :email or name like :name "); 77 | $statement = $this->db->prepare($sql); 78 | $statement->execute([ 79 | "email" => '%' . $searchTerm . '%', 80 | "name" => '%' . $searchTerm . '%', 81 | ]); 82 | 83 | return $statement->fetchAll(PDO::FETCH_ASSOC); 84 | 85 | } 86 | 87 | private function isRegistered($email) 88 | { 89 | $sql = ("select * from users where email = :email "); 90 | $statement = $this->db->prepare($sql); 91 | $statement->execute([ 92 | "email" => $email, 93 | 94 | ]); 95 | $result = $statement->fetch(PDO::FETCH_ASSOC); 96 | 97 | if ($result) return true; 98 | 99 | 100 | } 101 | 102 | 103 | public function validate($validation) 104 | { 105 | 106 | unset($_SESSION['password_error']); 107 | unset($_SESSION['mail_error']); 108 | 109 | 110 | if ($this->isRegistered($_POST['email'])) { 111 | $_SESSION['mail_error'] = 'User already registered!'; 112 | return false; 113 | }; 114 | 115 | 116 | //Validate email 117 | 118 | 119 | //Check if mail is valid 120 | if (!$this->validateEmail($_POST['email'])) { 121 | $_SESSION['mail_error'] = 'Invalid email address'; 122 | return false; 123 | } 124 | 125 | //Check if both passwords match 126 | if ($_POST['password_1'] != $_POST['password_2']) { 127 | $_SESSION['password_error'] = 'Passwords doas not match'; 128 | return false; 129 | } 130 | 131 | //Check password lenth 132 | 133 | if (!$this->validatePassword($_POST['password_1'])) { 134 | $_SESSION['password_error'] = 'Passwords minimum lenghth is 5 characters'; 135 | return false; 136 | } 137 | 138 | return true; 139 | 140 | } 141 | 142 | 143 | } 144 | -------------------------------------------------------------------------------- /2.finish/README.md: -------------------------------------------------------------------------------- 1 | Project uses MVC structural pattern that separates logic into Models - which deal with data manipulation, Views - which present information to the users, and Controllers - which control behaviour of entire application. 2 | It also uses Front Controller design pattern, which basically routes entire application trough one index.php file using mod_rewrite on apache, and by doing that it provides for more control over the access to the application. Allowing us easy and centralized access control, easy way of taking down the entire website during maintainance and big errors, easy performance measuring etc. 3 | Singleton pattern is used for Database and Config because it enforces a single instance of each object, preventing multiple database connections by accid. With a note that Config could be refactored into regular object if singleton is not beneficial. Config is also made with more robust/standardized data storage in mind (.env files or similar). 4 | Router is injected as a dependency into other classes that use it (Controller Factory in current version), which allows for easy use of multiple different Router strategies, by simply making another way of parsing the route. 5 | Controller Factory uses simple factory design pattern, which returns proper, and already configured controller, which is then executed in main index.php file. 6 | Controllers extend main controller, using advantages of inheritance in OOP, so that children controllers can reuse code that is common for all controllers in general. 7 | Every model mostly follows Single Responsibility Principle, and is tested independently by using separated file. 8 | 9 | login details: 10 | test@applicableprogramming.com 11 | test 12 | -------------------------------------------------------------------------------- /2.finish/Views/404.php: -------------------------------------------------------------------------------- 1 |

Page not found

2 | -------------------------------------------------------------------------------- /2.finish/Views/home.php: -------------------------------------------------------------------------------- 1 | ".$_SESSION['msg'].""; 9 | unset($_SESSION['msg']); 10 | 11 | } 12 | 13 | echo "

Index page

"; 14 | 15 | require_once 'includes/__footer.php'; 16 | -------------------------------------------------------------------------------- /2.finish/Views/includes/__footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /2.finish/Views/includes/__header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Code review #1 9 | 10 | 11 | 12 | 13 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /2.finish/Views/login.php: -------------------------------------------------------------------------------- 1 | 4 | 5 |

Please enter your email and password to log in

6 | 7 | ".$_SESSION['msg'].""; 12 | unset($_SESSION['msg']); 13 | }?> 14 | 15 |
16 | 17 | 18 |
19 | 20 |
21 | 22 |
23 | 24 | 25 | 7 | 8 |

Please enter your data to register

9 |
10 | 11 | 14 | ".$_SESSION['mail_error'] ?> 15 |
16 | 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /2.finish/Views/results.php: -------------------------------------------------------------------------------- 1 | ".$_SESSION['msg'].""; 10 | unset($_SESSION['msg']); 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 |
User NameUser Email
42 | 43 | $method(); 6 | } 7 | } 8 | 9 | public static function show($viewFilename) 10 | { 11 | include 'Views/' . $viewFilename . '.php'; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /2.finish/class/ControllerFactory.php: -------------------------------------------------------------------------------- 1 | make($router->parseRoute(), $dbHandle); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2.finish/class/Router.php: -------------------------------------------------------------------------------- 1 | uri = $uri; 7 | } 8 | 9 | public function parseRoute($route=''){ 10 | if($route != ''){ 11 | $this->uri = $route; 12 | } 13 | $route = str_replace('', "", $this->uri); 14 | $route = explode('/', $route); 15 | return $route; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /2.finish/class/Validation.php: -------------------------------------------------------------------------------- 1 | parseRoute( $_SERVER['REQUEST_URI']); 16 | //$route = $router->parseRoute('/search'); 17 | //$route = $router->parseRoute(); 18 | //$route = $router->parseRoute('/user/logout'); 19 | //var_dump($route); 20 | // 21 | $controllerFactory = new ControllerFactory(); 22 | ////$controller = $controllerFactory->make($route, new stdClass()); 23 | $controller = $controllerFactory->makeFromRouter($router, new stdClass()); 24 | //var_dump($controller); 25 | 26 | $validation = new Validation(); 27 | var_dump($validation->validateEmail('test@text.com')); 28 | var_dump($validation->validateEmail('1231')); 29 | var_dump($validation->validateEmail('test@text.com')); 30 | var_dump($validation->validateEmail('1231')); 31 | var_dump($validation->validateEmail('test@text.com')); 32 | var_dump($validation->validateEmail('1231')); 33 | var_dump($validation->validateEmail('test@text.com')); 34 | var_dump($validation->validateEmail('1231')); 35 | var_dump($validation->validateEmail('test@text.com')); 36 | var_dump($validation->validateEmail('1231')); 37 | -------------------------------------------------------------------------------- /2.finish/config/config.php: -------------------------------------------------------------------------------- 1 | setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 7 | $dbHandle->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); 8 | 9 | 10 | //TODO: Create Router class and make improvements 11 | 12 | $route = str_replace('', "", $_SERVER['REQUEST_URI']); 13 | $route = explode('/', $route); 14 | 15 | switch ($route[1] ?? '') { 16 | 17 | case '': 18 | case 'home': 19 | case 'index.php': 20 | HomeController::show(); 21 | break; 22 | 23 | case 'login': 24 | HomeController::showLoginForm(); 25 | break; 26 | 27 | case 'logout': 28 | UserController::logout(); 29 | break; 30 | 31 | case 'results': 32 | HomeController::showResults(); 33 | break; 34 | 35 | case 'register': 36 | HomeController::showRegisterForm(); 37 | break; 38 | 39 | case 'registerUser': 40 | $user = new UserController($dbHandle); 41 | $user->register(); 42 | break; 43 | 44 | case 'loginUser': 45 | $user = new UserController($dbHandle); 46 | $user->login(); 47 | break; 48 | 49 | case 'search': 50 | $user = new UserController($dbHandle); 51 | $user->findUser(); 52 | break; 53 | 54 | default: 55 | include 'Views/404.php'; 56 | break; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Applicable Programming logo](https://s3.amazonaws.com/contents.newzenler.com/3161/library/60e0d31eb3efa_1625346846_applicable-programming-logo-blue-github-title.png "Applicable Programming logo")](https://applicableprogramming.com "Applicable Programming") 2 | 3 |

PHP Design Patterns in real life - Student code review #1

4 | 5 |

This project is part of the PHP Design Patterns course from ApplicableProgramming.com showing usage of 6 |
Design patterns and other OOP principles in real life - by commenting on one student project.

7 | 8 | 9 | 10 | Reviewed project uses **MVC architectural pattern** that separates logic into Models - which deal with data manipulation, Views - which present information to the users, and Controllers - which control behaviour of entire application. 11 | 12 | It also uses **Front Controller design pattern**, which basically routes entire application trough one index.php file using mod_rewrite on apache, and by doing that it provides for more control over the access to the application. Allowing us easy and centralized access control, easy way of taking down the entire website during maintainance and big errors, easy performance measuring etc. 13 | 14 | **Singleton pattern** is used for Database and Config because it enforces a single instance of each object, preventing multiple database connections by accid. With a note that Config could be refactored into regular object if singleton is not beneficial. Config is also made with more robust/standardized data storage in mind (.env files or similar). 15 | 16 | Router is injected as a **dependency** into other classes that use it (Controller Factory in current version), which allows for easy use of multiple different Router strategies, by simply making another way of parsing the route. 17 | 18 | Controller Factory uses **simple factory** design pattern, which returns proper, and already configured controller, which is then executed in main index.php file. 19 | 20 | Controllers extend main controller, using advantages of **inheritance** in OOP, so that children controllers can reuse code that is common for all controllers in general. 21 | 22 | Every model mostly follows **Single Responsibility Principle**, and is tested independently by using separated file. 23 | 24 | login details: 25 | test@applicableprogramming.com 26 | test 27 | 28 | 29 | 30 | > Source by: (anonymized by author request)
31 | > Video review [Code Review](https://www.youtube.com/watch?v=JS-AdMxIfew) 32 | > Youtube: [ApplicableProgramming](https://www.youtube.com/c/ApplicableProgramming/) 33 | --------------------------------------------------------------------------------