Skip to content

Commit 44ec458

Browse files
committed
Initial setup
0 parents  commit 44ec458

File tree

14 files changed

+5286
-0
lines changed

14 files changed

+5286
-0
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: MyWorkshop
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: [7.3, 7.4, 8.0]
16+
17+
name: PHP ${{ matrix.php }}
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php }}
26+
tools: composer:v2,pecl
27+
extensions: pdo_sqlite
28+
29+
- name: Install Dependencies
30+
run: composer update
31+
32+
- name: Run phpunit tests
33+
run: |
34+
mkdir -p build/logs
35+
vendor/bin/simple-phpunit --coverage-clover ./build/logs/clover.xml
36+
- name: Run phpcs
37+
run: composer cs
38+
39+
- name: Run phpstan
40+
run: composer static
41+
42+
- name: Coverage upload
43+
if: matrix.php == '8.0'
44+
run: bash <(curl -s https://codecov.io/bash)

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/vendor
2+
/.idea
3+
/program.php
4+
/solution
5+
/exercises/*/solution/vendor
6+
.phpunit.result.cache

.phpstorm.meta.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
namespace PHPSTORM_META
3+
{
4+
$STATIC_METHOD_TYPES = [
5+
\DI\Container::get('') => [
6+
"" == "@",
7+
],
8+
\Interop\Container\ContainerInterface::get('') => [
9+
"" == "@",
10+
],
11+
];
12+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Aydin Hassan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<h1 align="center">Workshop Starter Kit</h1>
2+
3+
<p align="center">If you want to build your own workshop, this repository and it't tools will help you get going</p>
4+
5+
<p align="center">
6+
<a href="https://phpschool-team.slack.com/messages">
7+
<img src="https://phpschool.herokuapp.com/badge.svg">
8+
</a>
9+
</p>
10+
----
11+
12+
## Getting Started
13+
14+
```shell
15+
composer create-project php-school/workshop-starter-kit your-workshop-name
16+
```
17+
18+
That's it! You will be prompted for some information along the way, this will be used to setup the project details in `composer.json`, setup autoloading of your classes and a few other things. A command will be dispayed towards the end of the process which will immediately allow you to run your workshop!
19+
20+
For detailed documentation on how to actually build execrises and extend the application, check the docs page on our site [www.phpschool.io/docs](https://www.phpschool.io/docs).
21+
22+
Finally, drop in the [slack channel](https://phpschool-team.slack.com/messages) if you have further questions. Also send us a PR [here](https://github.com/php-school/phpschool.io) or just drop us a message if you want your workshop featured on www.phpschool.io!

app/bootstrap.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
ini_set('display_errors', 1);
4+
date_default_timezone_set('Europe/London');
5+
switch (true) {
6+
case (file_exists(__DIR__ . '/../vendor/autoload.php')):
7+
// Installed standalone
8+
require __DIR__ . '/../vendor/autoload.php';
9+
break;
10+
case (file_exists(__DIR__ . '/../../../autoload.php')):
11+
// Installed as a Composer dependency
12+
require __DIR__ . '/../../../autoload.php';
13+
break;
14+
case (file_exists('vendor/autoload.php')):
15+
// As a Composer dependency, relative to CWD
16+
require 'vendor/autoload.php';
17+
break;
18+
default:
19+
throw new RuntimeException('Unable to locate Composer autoloader; please run "composer install".');
20+
}
21+
22+
use PhpSchool\PhpWorkshop\Application;
23+
24+
$app = new Application('PHP8 Appreciate', __DIR__ . '/config.php');
25+
26+
//$app->addExercise(...);
27+
//$app->addExercise(...);
28+
29+
$art = <<<ART
30+
_ __ _
31+
/ |..| \
32+
\/ || \/
33+
|_''_|
34+
35+
PHP SCHOOL
36+
LEARNING FOR ELEPHPANTS
37+
ART;
38+
39+
$app->setLogo($art);
40+
$app->setFgColour('green');
41+
$app->setBgColour('black');
42+
43+
return $app;

app/config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
use function DI\factory;
4+
use function DI\object;
5+
6+
return [
7+
//Define your exercise factories here
8+
];

bin/php8appreciate

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
$app = require_once __DIR__ . '/../app/bootstrap.php';
4+
exit($app->run());

composer.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"name": "php-school/php8-appreciate",
3+
"description": "2020 PHP: A showcase and classroom for the cutting edge features of PHP 8",
4+
"keywords": [
5+
"cli",
6+
"console",
7+
"terminal",
8+
"phpschool",
9+
"php-school",
10+
"workshop",
11+
"learning",
12+
"education"
13+
],
14+
"homepage": "https://www.phpschool.io",
15+
"license": "MIT",
16+
"authors": [
17+
{
18+
"name": "Aydin Hassan",
19+
"email": "aydin@hotmail.co.uk"
20+
}
21+
],
22+
"require": {
23+
"php": ">=7.3",
24+
"php-school/php-workshop": "^3.0"
25+
},
26+
"require-dev": {
27+
"phpunit/phpunit": "^9",
28+
"squizlabs/php_codesniffer": "^3.5",
29+
"phpstan/phpstan": "^0.12.52"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"PhpSchool\\PHP8Appreciate\\": "src/"
34+
}
35+
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"PhpSchool\\PHP8AppreciateTest\\": "test"
39+
}
40+
},
41+
"scripts": {
42+
"test": [
43+
"@unit-tests",
44+
"@cs",
45+
"@static"
46+
],
47+
"unit-tests": "phpunit",
48+
"cs": [
49+
"phpcs src --standard=PSR12",
50+
"phpcs test --standard=PSR12"
51+
],
52+
"cs-fix": [
53+
"phpcbf src --standard=PSR12 --encoding=UTF-8",
54+
"phpcbf test --standard=PSR12 --encoding=UTF-8"
55+
],
56+
"static": "phpstan --ansi analyse --level max src"
57+
},
58+
"bin": [
59+
"bin/php8appreciate"
60+
]
61+
}

0 commit comments

Comments
 (0)