Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5f1533e
Showing
30 changed files
with
2,711 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor | ||
/.idea | ||
program.php |
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,12 @@ | ||
<?php | ||
namespace PHPSTORM_META | ||
{ | ||
$STATIC_METHOD_TYPES = [ | ||
\DI\Container::get('') => [ | ||
"" == "@", | ||
], | ||
\Interop\Container\ContainerInterface::get('') => [ | ||
"" == "@", | ||
], | ||
]; | ||
} |
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 @@ | ||
before_commands: | ||
- "composer install --prefer-source" | ||
|
||
checks: | ||
php: true |
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,26 @@ | ||
language: php | ||
|
||
php: | ||
- 5.6 | ||
- hhvm | ||
|
||
install: | ||
- composer self-update | ||
- composer install --dev --prefer-source | ||
|
||
before_script: | ||
- mkdir -p build/logs | ||
|
||
script: | ||
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml | ||
- ./vendor/bin/phpcs --standard=PSR2 ./src/ | ||
- ./vendor/bin/phpcs --standard=PSR2 ./test/ | ||
|
||
after_script: | ||
- bash <(curl -s https://codecov.io/bash) | ||
- wget https://scrutinizer-ci.com/ocular.phar | ||
- php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 Aydin Hassan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Empty file.
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,49 @@ | ||
<?php | ||
|
||
ini_set('display_errors', 1); | ||
date_default_timezone_set('Europe/London'); | ||
switch (true) { | ||
case (file_exists(__DIR__ . '/../vendor/autoload.php')): | ||
// Installed standalone | ||
require __DIR__ . '/../vendor/autoload.php'; | ||
break; | ||
case (file_exists(__DIR__ . '/../../../autoload.php')): | ||
// Installed as a Composer dependency | ||
require __DIR__ . '/../../../autoload.php'; | ||
break; | ||
case (file_exists('vendor/autoload.php')): | ||
// As a Composer dependency, relative to CWD | ||
require 'vendor/autoload.php'; | ||
break; | ||
default: | ||
throw new RuntimeException('Unable to locate Composer autoloader; please run "composer install".'); | ||
} | ||
|
||
use PhpSchool\PhpWorkshop\Application; | ||
use PhpSchool\LearnYouPhp\Exercise\BabySteps; | ||
use PhpSchool\LearnYouPhp\Exercise\FilteredLs; | ||
use PhpSchool\LearnYouPhp\Exercise\HelloWorld; | ||
use PhpSchool\LearnYouPhp\Exercise\MyFirstIo; | ||
|
||
$app = new Application(null, __DIR__ . '/config.php'); | ||
|
||
$app->addExercise(HelloWorld::class); | ||
$app->addExercise(BabySteps::class); | ||
$app->addExercise(MyFirstIo::class); | ||
$app->addExercise(FilteredLs::class); | ||
|
||
$art = <<<ART | ||
_ __ _ | ||
/ |..| \ | ||
\/ || \/ | ||
|_''_| | ||
PHP SCHOOL | ||
LEARNING FOR ELEPHPANTS | ||
ART; | ||
|
||
$app->setLogo($art); | ||
$app->setFgColour('green'); | ||
$app->setBgColour('black'); | ||
|
||
return $app; |
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,23 @@ | ||
<?php | ||
|
||
use function DI\factory; | ||
use function DI\object; | ||
use Interop\Container\ContainerInterface; | ||
use PhpSchool\LearnYouPhp\Exercise\BabySteps; | ||
use PhpSchool\LearnYouPhp\Exercise\FilteredLs; | ||
use PhpSchool\LearnYouPhp\Exercise\HelloWorld; | ||
use PhpSchool\LearnYouPhp\Exercise\MyFirstIo; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
use Faker\Factory as FakerFactory; | ||
|
||
return [ | ||
//Exercises | ||
BabySteps::class => object(BabySteps::class), | ||
HelloWorld::class => object(HelloWorld::class), | ||
MyFirstIo::class => factory(function (ContainerInterface $c) { | ||
return new MyFirstIo($c->get(Filesystem::class), FakerFactory::create()); | ||
}), | ||
FilteredLs::class => factory(function (ContainerInterface $c) { | ||
return new FilteredLs($c->get(Filesystem::class)); | ||
}), | ||
]; |
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,28 @@ | ||
build: false | ||
platform: 'x86' | ||
clone_folder: C:\projects\my-php-workshop | ||
branches: | ||
except: | ||
- gh-pages | ||
|
||
init: | ||
- SET COMPOSER_NO_INTERACTION=1 | ||
|
||
install: | ||
- SET PATH=C:\Program Files\OpenSSL;%PATH% | ||
- cinst php | ||
- cd c:\tools\php | ||
- copy php.ini-production php.ini | ||
- echo date.timezone="UTC" >> php.ini | ||
- echo extension_dir=ext >> php.ini | ||
- echo extension=php_openssl.dll >> php.ini | ||
- echo extension=php_mbstring.dll >> php.ini | ||
- SET PATH=C:\tools\php;%PATH% | ||
- cd C:\projects\my-php-workshop | ||
- php -r "readfile('http://getcomposer.org/installer');" | php | ||
- php composer.phar install --prefer-source --no-progress | ||
|
||
test_script: | ||
- ps: cd C:\projects\my-php-workshop | ||
- ps: gl | ||
- vendor\bin\phpunit.bat |
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,4 @@ | ||
<?php | ||
|
||
$app = require_once __DIR__ . '/../app/bootstrap.php'; | ||
exit($app->run()); |
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,29 @@ | ||
{ | ||
"name": "php-school/learn-you-php", | ||
"description": "Learn You PHP", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Aydin Hassan", | ||
"email": "aydin@hotmail.co.uk" | ||
} | ||
], | ||
"require" : { | ||
"php" : ">=5.6", | ||
"php-school/php-workshop": "~1.0", | ||
"nikic/php-parser": "dev-master#98d28d7aa04e2d92fea2b375373878d0b1fce992" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.1", | ||
"squizlabs/php_codesniffer": "~2.0" | ||
}, | ||
"autoload" : { | ||
"psr-4" : { | ||
"PhpSchool\\LearnYouPhp\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { "PhpSchool\\LearnYouPhpTest\\": "test/" } | ||
}, | ||
"bin": ["bin/learnyouphp"] | ||
} |
Oops, something went wrong.