PHP Classes

File: demo/index.php

Recommend this page to a friend!
  Classes of Boss Ibrahim Mussa   Options Resolver   demo/index.php   Download  
File: demo/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Options Resolver
Configure objects with option arrays
Author: By
Last change:
Date: 5 months ago
Size: 603 bytes


Class file image Download
 * Copyright (c) 2022.
 * The OptionsResolver component helps you configure objects with option arrays. It supports default values, option constraints and lazy options.

use Wepesi\Demo\Database;


$database = new Database([
'dbname' => 'app',
// Uncaught InvalidArgumentException: The required option "username" is missing.

// $database = new Database([
// 'host' => 'localhost',
// 'dbname' => 'app',
// 'username' => 'root',
// 'password' => 'root',
// ]);