From 15627da05cb2347aa1fee51ad7f86df2b87cf0cd Mon Sep 17 00:00:00 2001 From: sikofitt Date: Mon, 11 Jul 2016 14:56:40 -0700 Subject: [PATCH] Added resume.js, updated gruntfile --- .php_cs | 7 +- Gruntfile.js | 37 +- app/App.php | 8 +- app/config/config.yml | 3 + app/providers.php | 99 +- app/views/resume.html.twig | 37 +- app/views/uikit.html.twig | 17 +- bin/console | 36 +- composer.json | 6 +- composer.lock | 1256 ++++++++++++++++- package.json | 1 + src/Sikofitt/Config/ConfigServiceProvider.php | 78 +- .../MissingConfigurationItemException.php | 16 + .../Controller/ApiControllerProvider.php | 6 +- src/Sikofitt/Form/Type/ContactType.php | 38 +- src/Sikofitt/js/resume.js | 33 + src/Sikofitt/less/resume.less | 5 + 17 files changed, 1512 insertions(+), 171 deletions(-) create mode 100644 src/Sikofitt/Config/MissingConfigurationItemException.php create mode 100644 src/Sikofitt/js/resume.js diff --git a/.php_cs b/.php_cs index e691cb4..dbe6e8a 100644 --- a/.php_cs +++ b/.php_cs @@ -22,11 +22,11 @@ $finder = Symfony\CS\Finder\DefaultFinder::create() ->in(__DIR__) ; - return Symfony\CS\Config\Config::create() ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) ->fixers( [ + 'symfony', 'header_comment', 'ordered_use', 'php_unit_construct', @@ -38,9 +38,8 @@ return Symfony\CS\Config\Config::create() 'phpdoc_order', 'short_array_syntax', 'short_echo_tag', - - + '-multiple_use' ] ) ->finder($finder) - ; \ No newline at end of file + ; diff --git a/Gruntfile.js b/Gruntfile.js index d1b1217..6f8b010 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,12 +1,14 @@ module.exports = function (grunt) { grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), bower: { js: { dest: 'web/js/vendor', options: { - checkExistence: false, - debugging: true, + cleanTargetDir: true, + checkExistence: true, + debugging: false, paths: { bowerDirectory: 'vendor/bower', bowerrc: '.bowerrc', @@ -46,19 +48,42 @@ module.exports = function (grunt) { } }, watch: { - + configFiles: { + files: ['Gruntfile.js'], + options: { + reload: true + } + }, + dev: { + files: ['src/Sikofitt/less/*', 'src/Sikofitt/js/*'], + tasks: ['dev'] + } + }, + uglify: { + options: { + mangle: true, + compress: { + drop_console: true + }, + banner: '/*! Resume.PHP - v<%= pkg.version %> - ' + + '<%= grunt.template.today("dddd, mmmm dS, yyyy, h:MM:ss tt") %> */', + nameCache: '.tmp/grunt-uglify-cache.json' + }, + dist: { + files: {'web/js/resume.min.js': ['src/Sikofitt/js/resume.js']} + } } }); - - grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('main-bower-files'); grunt.loadNpmTasks('grunt-phpunit'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.registerTask('dist', ['bower', 'less']); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.registerTask('dist', ['bower', 'less', 'uglify', 'copy']); + grunt.registerTask('dev', ['less', 'uglify']) grunt.registerTask('default', 'dist'); }; \ No newline at end of file diff --git a/app/App.php b/app/App.php index 1d3f8c2..5e17e65 100644 --- a/app/App.php +++ b/app/App.php @@ -14,7 +14,7 @@ use Sikofitt\Json\JsonFileTrait; use Sikofitt\Json\JsonTrait; use Silex\Application; -require '../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; /** * Class App @@ -31,6 +31,7 @@ class App extends Application use Application\TranslationTrait; use Application\UrlGeneratorTrait; + private $debug; /** * Returns the application directory. * @@ -108,6 +109,11 @@ class App extends Application $this['env'] = null !== $this->config('app.environment') ? $this->config('app.environment') : 'dev'; } } + + public function getDebug() + { + return $this['debug']; + } public function registerExtenders() { if (!$this['debug']) { diff --git a/app/config/config.yml b/app/config/config.yml index 4f5be1e..ceedbfe 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -5,6 +5,9 @@ app: email: eric@rewiv.com phone: 510-646-2135 schema: https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json + captcha: true + captcha_sitekey: 6LcvmSQTAAAAAMmf9w6mhCbpdLvknuD9SGVHT0q- + captcha_secret: 6LcvmSQTAAAAAITkvYJjgLar1LqGGLz-ic0ZMiXo twig: paths: - views diff --git a/app/providers.php b/app/providers.php index f53edbe..8ee1520 100644 --- a/app/providers.php +++ b/app/providers.php @@ -9,51 +9,72 @@ * file that was distributed with this source code. */ -use Silex\Provider\CsrfServiceProvider; -use Silex\Provider\LocaleServiceProvider; -use Silex\Provider\TranslationServiceProvider; -use Silex\Provider\ValidatorServiceProvider; +use Knp\Provider\ConsoleServiceProvider; +use Sikofitt\Config\ConfigServiceProvider; +use Sikofitt\Json\JsonServiceProvider; +use Silex\Provider\{ + AssetServiceProvider, + CsrfServiceProvider, + FormServiceProvider, + HttpFragmentServiceProvider, + HttpKernelServiceProvider, + LocaleServiceProvider, + MonologServiceProvider, + RoutingServiceProvider, + ServiceControllerServiceProvider, + SessionServiceProvider, + TranslationServiceProvider, + TwigServiceProvider, + ValidatorServiceProvider, + VarDumperServiceProvider, + WebProfilerServiceProvider +}; +use Symfony\Bridge\Monolog\Logger; +use WhoopsPimple\WhoopsServiceProvider; -$app->register(new \Sikofitt\Config\ConfigServiceProvider(), [ +$app->register(new ConfigServiceProvider(), [ 'config.path' => $app->getConfDirectory(), ]); $app->setDebug(); +$app + ->register(new TwigServiceProvider(), [ + 'twig.path' => [ + $app->getRootDirectory() . '/app/views', + ], + ]) + ->register(new JsonServiceProvider()) + ->register(new AssetServiceProvider()) + ->register(new MonologServiceProvider()) + ->register(new SessionServiceProvider()) + ->register(new HttpKernelServiceProvider()) + ->register(new FormServiceProvider()) + ->register(new LocaleServiceProvider()) + ->register(new TranslationServiceProvider()) + ->register(new ValidatorServiceProvider()) + ->register(new CsrfServiceProvider()) + ->register(new MonologServiceProvider(), [ + 'monolog.logfile' => sprintf('%s/%s.log', $app->getLogDirectory(), $app['env']), + 'monolog.name' => 'Resume.PHP', + 'monolog.level' => $app->getDebug() ? Logger::DEBUG : Logger::INFO, + ]) + ->register(new RoutingServiceProvider()) + ->register(new ServiceControllerServiceProvider()) + ->register(new HttpFragmentServiceProvider()); + +if ($app['debug'] || 0 === strcasecmp($app['env'], 'dev')) { + $app->register(new WebProfilerServiceProvider(), [ + 'profiler.cache_dir' => $app->getDataDirectory() . '/cache/profiler', + ]) + ->register(new WhoopsServiceProvider()) + ->register(new VarDumperServiceProvider()) + ->register(new ConsoleServiceProvider(), [ + 'console.name' => 'Resume.PHP', + 'console.version' => '0.0.1', + 'console.project_directory' => $app->getAppDirectory(), + ]); +} if (null === $app->config('app.schema')) { $app->config('app.schema', 'https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json'); } - -$app->register(new \Silex\Provider\TwigServiceProvider(), [ - 'twig.path' => [ - $app->getRootDirectory() . '/app/views', - ], -]); -$app->register(new \Sikofitt\Json\JsonServiceProvider()); - - -$app->register(new \Silex\Provider\AssetServiceProvider()); -$app->register(new \Silex\Provider\MonologServiceProvider()); -$app->register(new \Silex\Provider\SessionServiceProvider()); -$app->register(new \Silex\Provider\HttpKernelServiceProvider()); -$app->register(new \Silex\Provider\FormServiceProvider()); -$app->register(new LocaleServiceProvider()); -$app->register(new TranslationServiceProvider()); -$app->register(new ValidatorServiceProvider()); -$app->register(new CsrfServiceProvider()); - -$app->register(new \Silex\Provider\MonologServiceProvider(), - [ - 'monolog.logfile' => sprintf('%s/%s.log', $app->getLogDirectory(), $app['env']), - ] -); -$app->register(new \Silex\Provider\RoutingServiceProvider()); -$app->register(new \Silex\Provider\ServiceControllerServiceProvider()); -$app->register(new \Silex\Provider\HttpFragmentServiceProvider()); -if ($app['debug'] || 0 === strcasecmp($app['env'], 'dev')) { - $app->register(new \Silex\Provider\WebProfilerServiceProvider(), [ - 'profiler.cache_dir' => $app->getDataDirectory() . '/cache/profiler', - ]); - $app->register(new \WhoopsSilex\WhoopsServiceProvider()); - $app->register(new \Silex\Provider\VarDumperServiceProvider()); -} diff --git a/app/views/resume.html.twig b/app/views/resume.html.twig index 7f66243..ebc040f 100644 --- a/app/views/resume.html.twig +++ b/app/views/resume.html.twig @@ -263,40 +263,5 @@ {% endblock %} {% block javascripts_foot %} + {% endblock %} -{% block inline_js_foot %} - -{% endblock %} \ No newline at end of file diff --git a/app/views/uikit.html.twig b/app/views/uikit.html.twig index 964644d..bea3f1a 100644 --- a/app/views/uikit.html.twig +++ b/app/views/uikit.html.twig @@ -1,5 +1,5 @@ - + @@ -7,18 +7,18 @@ {% block meta %}{% endblock %} {% block title %}Resume{% endblock %} {% block shortcut_icon %} - + {# #} {% endblock %} {% block apple_meta %} - + {# #} {% endblock %} - + {% block stylesheets %}{% endblock %} {% block inline_styles %}{% endblock %} - - - - + + + + {% block javascripts_head %}{% endblock %} {% block inline_js_head %}{% endblock %} @@ -29,6 +29,7 @@ {% block body %} {% endblock %} + {% block javascripts_foot %}{% endblock %} {% block inline_js_foot %}{% endblock %} diff --git a/bin/console b/bin/console index 728a6b7..bc903bb 100755 --- a/bin/console +++ b/bin/console @@ -2,15 +2,13 @@ getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); -$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; -if ($debug) { - Debug::enable(); +$app = new App(); +require_once $app->getAppDirectory() . '/providers.php'; +if($app->getDebug()) { + Debug::enable(); } - -//$kernel = new AppKernel($env, $debug); -$application = new Application(); +$application = $app['console']; +$application->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', 'dev')); +$application->setDispatcher($app['dispatcher']); +$twigDebugCommand = new Symfony\Bridge\Twig\Command\DebugCommand('twig:debug'); +$twigDebugCommand->setTwigEnvironment($app['twig']); +$twigLintCommand = new \Symfony\Bridge\Twig\Command\LintCommand('twig:lint'); +$twigLintCommand->setTwigEnvironment($app['twig']); $application->add(new SchemaValidationCommand()); +$application->add($twigDebugCommand); +$application->add($twigLintCommand); +$application->add(new \Symfony\CS\Console\Command\FixCommand()); $application->run($input); + diff --git a/composer.json b/composer.json index 84fd4f6..dab99cd 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,8 @@ "silex/web-profiler": "^2.0", "twig/extensions": "^1.3", "symfony/config": "^3.1", - "symfony/security-csrf": "^3.1" + "symfony/security-csrf": "^3.1", + "knplabs/console-service-provider": "^2.0" }, "require-dev": { "symfony/debug": "~2.8|^3.0", @@ -53,7 +54,8 @@ "texthtml/whoops-silex": "^1.0", "symfony/debug-bundle": "^3.1", "friendsofphp/php-cs-fixer": "^1.11", - "heroku/heroku-buildpack-php": "^108.0" + "heroku/heroku-buildpack-php": "^108.0", + "phpunit/phpunit": "^5.4" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 1bb562c..73699dd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "0f425f962f6394440cbbb321ce807262", - "content-hash": "647b11b24de59ee68972bdfae7495819", + "hash": "25287502f3d13d81e204c1bb9189f7d3", + "content-hash": "fe01ca158705636b3b5be2fd4c277edb", "packages": [ { "name": "google/recaptcha", @@ -255,6 +255,48 @@ ], "time": "2016-01-25 15:43:01" }, + { + "name": "knplabs/console-service-provider", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/ConsoleServiceProvider.git", + "reference": "ac3498030bb54ec1d7e79043fe984fc3aeb48bfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/ConsoleServiceProvider/zipball/ac3498030bb54ec1d7e79043fe984fc3aeb48bfb", + "reference": "ac3498030bb54ec1d7e79043fe984fc3aeb48bfb", + "shasum": "" + }, + "require": { + "php": ">=5.3.2", + "symfony/console": "~2.3|~3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Knp\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KnpLabs", + "homepage": "http://knplabs.com" + } + ], + "description": "console service provider for Silex", + "homepage": "http://knplabs.com", + "keywords": [ + "console", + "silex" + ], + "time": "2016-06-01 05:51:46" + }, { "name": "knplabs/knp-snappy", "version": "0.4.3", @@ -878,6 +920,66 @@ "homepage": "https://symfony.com", "time": "2016-06-29 05:41:56" }, + { + "name": "symfony/console", + "version": "v3.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "747154aa69b0f83cd02fc9aa554836dee417631a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/747154aa69b0f83cd02fc9aa554836dee417631a", + "reference": "747154aa69b0f83cd02fc9aa554836dee417631a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2016-06-29 07:02:31" + }, { "name": "symfony/debug", "version": "v3.1.2", @@ -2780,6 +2882,60 @@ } ], "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14 21:17:01" + }, { "name": "filp/whoops", "version": "2.1.2", @@ -2942,6 +3098,746 @@ ], "time": "2016-07-08 21:43:10" }, + { + "name": "myclabs/deep-copy", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "a8773992b362b58498eed24bf85005f363c34771" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", + "reference": "a8773992b362b58498eed24bf85005f363c34771", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2015-11-20 12:04:31" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-06-10 09:48:41" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" + }, + { + "name": "phpspec/prophecy", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2016-06-07 08:13:47" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/900370c81280cc0d942ffbc5912d80464eaee7e9", + "reference": "900370c81280cc0d942ffbc5912d80464eaee7e9", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "^1.4.2", + "sebastian/code-unit-reverse-lookup": "~1.0", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0|~2.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.4.0", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2016-06-03 05:03:56" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21 13:08:43" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21 13:50:34" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2016-05-12 18:03:57" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-09-15 10:49:45" + }, + { + "name": "phpunit/phpunit", + "version": "5.4.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", + "reference": "2f1fc94b77ea6418bd6a06c64a1dac0645fbce59", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "^4.0", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "^1.3 || ^2.0", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/object-enumerator": "~1.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0|~2.0", + "symfony/yaml": "~2.1|~3.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2016-06-16 06:01:15" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "3.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "b13d0d9426ced06958bd32104653526a6c998a52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b13d0d9426ced06958bd32104653526a6c998a52", + "reference": "b13d0d9426ced06958bd32104653526a6c998a52", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2016-06-12 07:37:26" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2016-02-13 06:45:14" + }, + { + "name": "sebastian/comparator", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26 15:48:44" + }, { "name": "sebastian/diff", "version": "1.4.1", @@ -2995,64 +3891,356 @@ "time": "2015-12-08 07:14:41" }, { - "name": "symfony/console", - "version": "v3.1.2", + "name": "sebastian/environment", + "version": "1.3.7", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "747154aa69b0f83cd02fc9aa554836dee417631a" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/747154aa69b0f83cd02fc9aa554836dee417631a", - "reference": "747154aa69b0f83cd02fc9aa554836dee417631a", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=5.3.3" }, "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2016-06-29 07:02:31" + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-05-17 03:18:57" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17 09:04:28" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12 03:26:01" + }, + { + "name": "sebastian/object-enumerator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2016-01-28 13:25:10" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-11-11 19:50:13" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" + }, + { + "name": "sebastian/version", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-02-04 12:56:52" }, { "name": "symfony/debug-bundle", diff --git a/package.json b/package.json index f4d61f2..430f9a8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "resume.php", + "version": "0.0.1", "author": "R. Eric Wheeler ", "private": true, "homepage": "https://code.reric.me", diff --git a/src/Sikofitt/Config/ConfigServiceProvider.php b/src/Sikofitt/Config/ConfigServiceProvider.php index e31865f..f398bdd 100644 --- a/src/Sikofitt/Config/ConfigServiceProvider.php +++ b/src/Sikofitt/Config/ConfigServiceProvider.php @@ -14,22 +14,84 @@ namespace Sikofitt\Config; use Noodlehaus\Config; use Pimple\Container; use Pimple\ServiceProviderInterface; +use Silex\Api\BootableProviderInterface; use Silex\Application; +use Symfony\Component\Validator\Constraints\Collection; +use Symfony\Component\Validator\Constraints\Email; +use Symfony\Component\Validator\Constraints\Length; +use Symfony\Component\Validator\Constraints\NotBlank; +use Symfony\Component\Validator\Constraints\NotNull; +use Symfony\Component\Validator\Constraints\Regex; /** * Class ConfigServiceProvider + * * @package Sikofitt\Config */ -class ConfigServiceProvider implements ServiceProviderInterface +class ConfigServiceProvider implements ServiceProviderInterface, BootableProviderInterface { + /** - * @param Container $app - */ - public function register(Container $app) + * @param Container $app + */ + public function register(Container $app) + { + $app['config'] = function ($app) { + $config = Config::load($app['config.path']); + + return $config; + }; + } + + public function boot(Application $app) { - $app['config'] = function ($app) { - $config = Config::load($app['config.path']); - return $config; - }; + $configItems = [ + 'email' => $app->config('app.email'), + 'phone' => $app->config('app.phone'), + ]; + + + + $constraints = [ + 'email' => [ + new NotNull(['message' => 'Email value in app config is not present.']), + new NotBlank(['message' => 'Email should cannot be blank in config.']), + new Email(['message' => sprintf('Invalid email address in config. (%s)', $configItems['email'])]), + ], + 'phone' => [ + new NotNull(['message' => 'Phone number value in app config is not present.']), + new NotBlank(['message' => 'Phone number cannot be blank in config.']), + new Length([ + 'min' => 10, + 'minMessage' => sprintf('Invalid phone number, it should have at least 10 characters. %s given.', count($configItems['phone'])), + ]), + ], + ]; + + $captcha = $app->config('app.captcha'); + if (isset($captcha) && $captcha) { + $configItems['captcha_sitekey'] = $app->config('app.captcha_sitekey'); + $configItems['captcha_secret'] = $app->config('app.captcha_secret'); + + $constraints['captcha_sitekey'] = [ + new NotNull(['message' => 'ReCaptcha sitekey is a required value to use the captcha, this check can be disabled by removing or setting the captcha config item to false.']), + new NotBlank(), + new Length(['min' => 40]), + ]; + $constraints['captcha_secret'] = [ + new NotNull(), + new NotBlank(), + new Length(['min' => 40]), + ]; + } + $errors = $app['validator']->validate($configItems, new Collection($constraints)); + $validationErrors = []; + foreach ($errors->getIterator() as $error) { + $validationErrors[] = $error->getMessage(); + } + if (count($validationErrors) > 0) { + throw new MissingConfigurationItemException($validationErrors[0]); + } + } } diff --git a/src/Sikofitt/Config/MissingConfigurationItemException.php b/src/Sikofitt/Config/MissingConfigurationItemException.php new file mode 100644 index 0000000..d29b8aa --- /dev/null +++ b/src/Sikofitt/Config/MissingConfigurationItemException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sikofitt\Config; + +class MissingConfigurationItemException extends \InvalidArgumentException +{ +} diff --git a/src/Sikofitt/Controller/ApiControllerProvider.php b/src/Sikofitt/Controller/ApiControllerProvider.php index 33aae98..549a0f3 100644 --- a/src/Sikofitt/Controller/ApiControllerProvider.php +++ b/src/Sikofitt/Controller/ApiControllerProvider.php @@ -27,10 +27,10 @@ namespace Sikofitt\Controller; use ReCaptcha\ReCaptcha; use Silex\Api\ControllerProviderInterface; use Silex\Application; - use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; + class ApiControllerProvider implements ControllerProviderInterface { /** @@ -46,13 +46,13 @@ class ApiControllerProvider implements ControllerProviderInterface - $controllers->get('/v1/schema', function () use($app) { + $controllers->get('/v1/schema', function () use ($app) { $response = new Response(file_get_contents($app->getDataDirectory() . '/schema/schema.v1.json'), Response::HTTP_OK); $response->headers->set('Content-Type', 'application/schema+json'); return $response; }); - $controllers->match('/v1/message', function(Request $request) use ($app) { + $controllers->match('/v1/message', function (Request $request) use ($app) { /*$app->mail(\Swift_Message::newInstance() ->setSubject('[YourSite] Feedback') ->setFrom(array('noreply@yoursite.com')) diff --git a/src/Sikofitt/Form/Type/ContactType.php b/src/Sikofitt/Form/Type/ContactType.php index cb0a9b2..8b45c1a 100644 --- a/src/Sikofitt/Form/Type/ContactType.php +++ b/src/Sikofitt/Form/Type/ContactType.php @@ -1,21 +1,29 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Sikofitt\Form\Type; -use Symfony\Component\Form\{ - FormBuilderInterface, AbstractType, Extension\Core\Type\SubmitType, Extension\Core\Type\EmailType, Extension\Core\Type\TextareaType, Extension\Core\Type\TextType, FormConfigInterface, FormInterface -}; - -use Symfony\Component\Security\Csrf\CsrfToken; -use Symfony\Component\Validator\Constraints\{ - Email, - Length, - NotBlank -}; - +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\EmailType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormConfigInterface; +use Symfony\Component\Form\FormInterface; use Symfony\Component\OptionsResolver\OptionsResolver; - +use Symfony\Component\Security\Csrf\CsrfToken; +use Symfony\Component\Validator\Constraints\Email; +use Symfony\Component\Validator\Constraints\Length; +use Symfony\Component\Validator\Constraints\NotBlank; /** * Class ContactType @@ -29,7 +37,7 @@ class ContactType extends AbstractType * @param FormBuilderInterface $builder * @param array $options */ - public function buildForm (FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('name', TextType::class, [ @@ -96,7 +104,7 @@ class ContactType extends AbstractType * * @param OptionsResolver $resolver */ - public function configureOptions (OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ 'attr' => [ @@ -104,4 +112,4 @@ class ContactType extends AbstractType ], ]); } -} \ No newline at end of file +} diff --git a/src/Sikofitt/js/resume.js b/src/Sikofitt/js/resume.js new file mode 100644 index 0000000..71437fc --- /dev/null +++ b/src/Sikofitt/js/resume.js @@ -0,0 +1,33 @@ +jQuery(document).ready(function ($) { + $('form#recaptcha').on('submit', function (event) { + event.stopImmediatePropagation(); + event.stopPropagation(); + jQuery.post(jQuery(this).attr('action'), jQuery(this).serialize(), function (response) { + + data = JSON.parse(response); + if (false === data.valid) { + data.message.every(function (d) { + UIkit.notify(' ' + d, { + pos: 'bottom-center', + status: 'danger' + }); + }) + } else if (true === data.valid) { + var divRoot = jQuery('
'), + h1 = jQuery('

'), + href = jQuery(''), + phone = jQuery('.hidden-phone'); + href + .attr('href', 'tel:' + data.message.phone) + .text(data.message.phone); + + h1.append(href); + + phone.attr('href', 'tel:' + data.message.phone); + phone.text(data.message.phone); + divRoot.append(h1); + jQuery('#recaptcha-wrapper').replaceWith(divRoot); + } + }); + }); +}); \ No newline at end of file diff --git a/src/Sikofitt/less/resume.less b/src/Sikofitt/less/resume.less index 6cd3e96..a212e53 100644 --- a/src/Sikofitt/less/resume.less +++ b/src/Sikofitt/less/resume.less @@ -48,4 +48,9 @@ a.profile-link { margin-bottom: 16px; border-bottom: 1px solid #ccc; padding-bottom: 12px; +} +.uk-close { + &:after { + font-size:30px; + } } \ No newline at end of file