Skip to content

Commit

Permalink
V1 of the Goodthoughts Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Odole Kayode committed Oct 5, 2019
0 parents commit f582e0f
Show file tree
Hide file tree
Showing 14 changed files with 660 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This package was designed to assist developers.

# A good thought is generated each time the static method generateThought() is called.


20 changes: 20 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "kaythinks/goodthoughts",
"description": "This package generates a good thought to help you code better.",
"type": "library",
"authors": [
{
"name": "Odole Olukayode",
"email": "kaythinks@gmail.com"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0"
},
"autoload": {
"psr-0": {
"Application": "src/"
}
}
}
19 changes: 19 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions src/Application/Goodthoughts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Application;

class Goodthoughts {

/**
* This static method generates a "Good Thought" from an array of "Good Thought"
*
* @return String
*/
public static function generateThought()
{
$thoughtArray = [
"You are a great programmer",
"Relax, try again later mate !",
"Don't stop till you finish !",
"Tomorrow is another day !",
"Your codes will compile now ,Trust me !,",
"You can do this !",
"Yeah, You did it ! Congrats !"
];

$index = mt_rand(0,6);

return $thoughtArray[$index];
}

}
7 changes: 7 additions & 0 deletions tests/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

require_once __DIR__ .'/../vendor/autoload.php'; // Autoload files using Composer autoload

use Application\Goodthoughts;

echo Goodthoughts::generateThought();
7 changes: 7 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitd1a06004e8ecf5dbce5218aa071f1faf::getLoader();
Loading

0 comments on commit f582e0f

Please sign in to comment.