This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: configure app with yaml file (#3)
- Loading branch information
1 parent
6074fa7
commit 1bbbe53
Showing
7 changed files
with
310 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.env | ||
.env | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require": { | ||
"symfony/yaml": "^6.2" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
class Dashboard { | ||
|
||
/** | ||
* @var array | ||
*/ | ||
private array $settings; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public readonly string $title; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public readonly string $description; | ||
|
||
/** | ||
* @var string $image | ||
*/ | ||
public readonly string $image; | ||
|
||
/** | ||
* @var Owner | ||
*/ | ||
public readonly Owner $owner; | ||
|
||
public function __construct(array $settings) | ||
{ | ||
$this->settings = $settings; | ||
$this->setAttributes($settings); | ||
} | ||
|
||
/** | ||
* @param array $credentials | ||
* @return void | ||
*/ | ||
private function setAttributes($settings): void | ||
{ | ||
$this->title = $settings['title']; | ||
$this->description = $settings['description']; | ||
$this->image = $settings['image']; | ||
$this->owner = new Owner($settings['owner']); | ||
} | ||
|
||
|
||
} | ||
|
||
class Owner { | ||
|
||
/** | ||
* @var string $name | ||
*/ | ||
public readonly string $name; | ||
|
||
/** | ||
* @var string $firstname | ||
*/ | ||
public readonly string $firstname; | ||
|
||
/** | ||
* @var string $description | ||
*/ | ||
public readonly string $description; | ||
|
||
/** | ||
* @var string $fullName | ||
*/ | ||
public readonly string $fullName; | ||
|
||
public function __construct(array $credentials) | ||
{ | ||
$this->setAttributes($credentials); | ||
} | ||
|
||
/** | ||
* @param array $credentials | ||
* @return void | ||
*/ | ||
private function setAttributes(array $credentials): void | ||
{ | ||
$this->name = $credentials['name']; | ||
$this->firstname = $credentials['firstname']; | ||
$this->description = $credentials['description']; | ||
$this->setFullName(); | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
private function setFullName(): void | ||
{ | ||
$this->fullName = $this->firstname . ' ' . $this->name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dashboard: | ||
title: "CDN - HENRY Alexis" | ||
description: "CDN" | ||
image: "https://cdn.alexishenry.eu/shared/images/logo.png" | ||
owner: | ||
name: "Henry" | ||
firstname: "Alexis" | ||
description: "bash only" |