diff --git a/README.md b/README.md index 52eb022..3647345 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,7 @@ For more info read [API reference](http://public.innomdc.com/inno-helper/) ## Changelog ### [0.0.4] - 2016-05-20 -- Fixing versions of dependencies \ No newline at end of file +- Fixing versions of dependencies + +### [0.0.5] - 2017-02-07 +- Preparing for remove the modifiedAt properties. \ No newline at end of file diff --git a/composer.json b/composer.json index 174aaa7..24061b9 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "library", "description": "Innometrics helper", "homepage": "http://www.innometrics.com", - "version": "0.0.4", + "version": "0.0.5", "require": { "php": ">=5.3.2", "illuminate/container": "v5.0.33", diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..f0d7622 --- /dev/null +++ b/composer.lock @@ -0,0 +1,901 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "153ba2cbee2dbc6df64b9385f983cc63", + "packages": [ + { + "name": "danielstjules/stringy", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/danielstjules/Stringy.git", + "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", + "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Stringy\\": "src/" + }, + "files": [ + "src/Create.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel St. Jules", + "email": "danielst.jules@gmail.com", + "homepage": "http://www.danielstjules.com" + } + ], + "description": "A string manipulation library with multibyte support", + "homepage": "https://github.com/danielstjules/Stringy", + "keywords": [ + "UTF", + "helpers", + "manipulation", + "methods", + "multibyte", + "string", + "utf-8", + "utility", + "utils" + ], + "time": "2015-07-23T00:54:12+00:00" + }, + { + "name": "doctrine/inflector", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", + "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Common\\Inflector\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2015-11-06T14:35:42+00:00" + }, + { + "name": "illuminate/cache", + "version": "v5.0.33", + "source": { + "type": "git", + "url": "https://github.com/illuminate/cache.git", + "reference": "84883c5f48295b1f5a9683e9d0a1e3bdd0f0d860" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/cache/zipball/84883c5f48295b1f5a9683e9d0a1e3bdd0f0d860", + "reference": "84883c5f48295b1f5a9683e9d0a1e3bdd0f0d860", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.0.*", + "illuminate/support": "5.0.*", + "nesbot/carbon": "~1.0", + "php": ">=5.4.0" + }, + "suggest": { + "illuminate/database": "Required to use the database cache driver (5.0.*).", + "illuminate/filesystem": "Required to use the file cache driver (5.0.*).", + "illuminate/redis": "Required to use the redis cache driver (5.0.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "The Illuminate Cache package.", + "homepage": "http://laravel.com", + "time": "2015-04-07T17:53:27+00:00" + }, + { + "name": "illuminate/container", + "version": "v5.0.33", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "aa85c752eb7c6ccc2c6ffc5bfffb3ba8dd9719d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/aa85c752eb7c6ccc2c6ffc5bfffb3ba8dd9719d6", + "reference": "aa85c752eb7c6ccc2c6ffc5bfffb3ba8dd9719d6", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.0.*", + "php": ">=5.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "http://laravel.com", + "time": "2015-05-29T20:16:27+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v5.0.33", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "b8b11d78724a6f8a62be3b1dfa20fa372f861398" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/b8b11d78724a6f8a62be3b1dfa20fa372f861398", + "reference": "b8b11d78724a6f8a62be3b1dfa20fa372f861398", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "http://laravel.com", + "time": "2015-05-15T07:22:28+00:00" + }, + { + "name": "illuminate/filesystem", + "version": "v5.0.33", + "source": { + "type": "git", + "url": "https://github.com/illuminate/filesystem.git", + "reference": "04c31739a153122c64feebf2ac37cfe1901e2da7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/04c31739a153122c64feebf2ac37cfe1901e2da7", + "reference": "04c31739a153122c64feebf2ac37cfe1901e2da7", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.0.*", + "illuminate/support": "5.0.*", + "league/flysystem": "~1.0", + "php": ">=5.4.0", + "symfony/finder": "2.6.*" + }, + "suggest": { + "league/flysystem-aws-s3-v2": "Required to use the Flysystem S3 driver (~1.0).", + "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Filesystem\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "The Illuminate Filesystem package.", + "homepage": "http://laravel.com", + "time": "2015-05-15T07:22:28+00:00" + }, + { + "name": "illuminate/support", + "version": "v5.0.33", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "32a12f97029b624fc0f9454e7ca69eaafef49c5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/32a12f97029b624fc0f9454e7ca69eaafef49c5d", + "reference": "32a12f97029b624fc0f9454e7ca69eaafef49c5d", + "shasum": "" + }, + "require": { + "danielstjules/stringy": "~1.8", + "doctrine/inflector": "~1.0", + "ext-mbstring": "*", + "illuminate/contracts": "5.0.*", + "php": ">=5.4.0" + }, + "suggest": { + "jeremeamia/superclosure": "Required to be able to serialize closures (~2.0).", + "symfony/var-dumper": "Required to use the dd function (2.6.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "http://laravel.com", + "time": "2015-06-04T12:15:51+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", + "reference": "8dc9b9d85ab639ca60ab4608b34c1279d6ae7bce", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "json-schema/json-schema-test-suite": "1.1.0", + "phpdocumentor/phpdocumentor": "~2", + "phpunit/phpunit": "~3.7" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "JsonSchema": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2015-07-14T16:29:50+00:00" + }, + { + "name": "league/flysystem", + "version": "1.0.34", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "469ad53c13ea19a0e54e3e5d70f61227ddcc0299" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/469ad53c13ea19a0e54e3e5d70f61227ddcc0299", + "reference": "469ad53c13ea19a0e54e3e5d70f61227ddcc0299", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "ext-fileinfo": "*", + "mockery/mockery": "~0.9", + "phpspec/phpspec": "^2.2", + "phpunit/phpunit": "~4.8" + }, + "suggest": { + "ext-fileinfo": "Required for MimeType", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-copy": "Allows you to use Copy.com storage", + "league/flysystem-dropbox": "Allows you to use Dropbox storage", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "time": "2017-01-30T17:41:17+00:00" + }, + { + "name": "nesbot/carbon", + "version": "1.22.1", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", + "reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/translation": "~2.6 || ~3.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "~4.0 || ~5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.23-dev" + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + } + ], + "description": "A simple API extension for DateTime.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "time": "2017-01-16T07:55:07+00:00" + }, + { + "name": "symfony/finder", + "version": "v2.6.13", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "203a10f928ae30176deeba33512999233181dd28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/203a10f928ae30176deeba33512999233181dd28", + "reference": "203a10f928ae30176deeba33512999233181dd28", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "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 Finder Component", + "homepage": "https://symfony.com", + "time": "2015-07-09T16:02:48+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14T01:06:16+00:00" + }, + { + "name": "symfony/translation", + "version": "v3.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "ca032cc56976d88b85e7386b17020bc6dc95dbc5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/ca032cc56976d88b85e7386b17020bc6dc95dbc5", + "reference": "ca032cc56976d88b85e7386b17020bc6dc95dbc5", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<2.8" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.8|~3.0", + "symfony/intl": "~2.8|~3.0", + "symfony/yaml": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "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 Translation Component", + "homepage": "https://symfony.com", + "time": "2017-01-21T17:06:35+00:00" + } + ], + "packages-dev": [ + { + "name": "hamcrest/hamcrest-php", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "hamcrest" + ], + "files": [ + "hamcrest/Hamcrest.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2015-05-11T14:41:42+00:00" + }, + { + "name": "mockery/mockery", + "version": "0.9.7", + "source": { + "type": "git", + "url": "https://github.com/padraic/mockery.git", + "reference": "4de7969f4664da3cef1ccd83866c9f59378c3371" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/padraic/mockery/zipball/4de7969f4664da3cef1ccd83866c9f59378c3371", + "reference": "4de7969f4664da3cef1ccd83866c9f59378c3371", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~1.1", + "lib-pcre": ">=7.0", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/padraic/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2016-12-19T14:50:55+00:00" + }, + { + "name": "tcz/phpunit-mockfunction", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/tcz/phpunit-mockfunction.git", + "reference": "87340f714620d7d6f8bb7fdd1f0ae50533acdcc3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tcz/phpunit-mockfunction/zipball/87340f714620d7d6f8bb7fdd1f0ae50533acdcc3", + "reference": "87340f714620d7d6f8bb7fdd1f0ae50533acdcc3", + "shasum": "" + }, + "require": { + "ext-runkit": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "description": "PHPUnit extension that uses runkit to mock PHP functions (both user-defined and system)", + "keywords": [ + "mock", + "phpunit", + "runkit", + "testing", + "unit" + ], + "time": "2014-03-20T18:50:53+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.2" + }, + "platform-dev": [] +} diff --git a/lib/Innometrics/Profile.php b/lib/Innometrics/Profile.php index af725b0..3aaf2dd 100644 --- a/lib/Innometrics/Profile.php +++ b/lib/Innometrics/Profile.php @@ -267,8 +267,8 @@ public function getSession ($sessionId) { $session = $sess; } } - - return $session; + + return $session; } /** @@ -352,7 +352,7 @@ protected function serializeSessions ($onlyChanges = false) { } /** - * Sort sessions by modifiedAt property + * Sort sessions by last event into the sessions * @return Profile */ protected function sortSessions () { diff --git a/lib/Innometrics/Session.php b/lib/Innometrics/Session.php index d81b283..d573d31 100644 --- a/lib/Innometrics/Session.php +++ b/lib/Innometrics/Session.php @@ -32,12 +32,6 @@ class Session { */ protected $createdAt = null; - /** - * Timestamp in ms when session was changed - * @var double - */ - protected $modifiedAt = null; - /** * Session data object * @var array @@ -61,9 +55,9 @@ class Session { * @var bool */ protected $dataDirty = false; - + /** - * @param array $config equals to {id: id, section: sectionId, collectApp: collectApp, data: data, events: events, createdAt: timestamp, modifiedAt: modifiedAt } + * @param array $config equals to {id: id, section: sectionId, collectApp: collectApp, data: data, events: events, createdAt: timestamp } */ public function __construct($config = array()) { $now = round(microtime(true) * 1000); @@ -73,10 +67,9 @@ public function __construct($config = array()) { $this->setCollectApp(isset($config['collectApp']) ? $config['collectApp'] : null); $this->setSection(isset($config['section']) ? $config['section'] : null); $this->setCreatedAt(isset($config['createdAt']) ? $config['createdAt'] : $now); - $this->modifiedAt = isset($config['modifiedAt']) ? $config['modifiedAt'] : $now; - $this->initEvents(isset($config['events']) ? $config['events'] : array()); + $this->initEvents(isset($config['events']) ? $config['events'] : array()); } - + /** * Set session property and mark it as dirty * @param string $field Property to be set @@ -89,8 +82,8 @@ protected function setField ($field, $value) { $this->setDirty(); } return $this; - } - + } + /** * Set session id * @param string $id @@ -99,7 +92,7 @@ protected function setField ($field, $value) { public function setId ($id) { return $this->setField('id', $id); } - + /** * Set session application name * @param string $collectApp @@ -108,7 +101,7 @@ public function setId ($id) { public function setCollectApp ($collectApp) { return $this->setField('collectApp', $collectApp); } - + /** * Set session section name * @param string $section @@ -117,7 +110,7 @@ public function setCollectApp ($collectApp) { public function setSection ($section) { return $this->setField('section', $section); } - + /** * Set timestamp when session was created * Passed argument should be a number or Date instance @@ -133,7 +126,7 @@ public function setCreatedAt ($date) { if (!is_numeric($date) && !($date instanceof \DateTime)) { throw new \ErrorException('Wrong date "' . $date . '". It should be an double or a DateTime instance.'); } - + if ($date instanceof \DateTime) { $ts = $date->getTimestamp(); $date = $ts * 1000; @@ -149,7 +142,7 @@ protected function isTimestampWithMilliseconds ($ts) { $nowLength = strval(microtime(true)); return $tsLength >= $nowLength; } - + /** * Update session data with values * Data is an array with key=>value pair(s). @@ -159,7 +152,7 @@ protected function isTimestampWithMilliseconds ($ts) { public function setData ($data) { return $this->setField('data', array_merge($this->data, $data)); } - + /** * Set single value of session data * @param string $name @@ -171,7 +164,7 @@ public function setDataValue ($name, $value) { $this->setDataDirty(); return $this; } - + /** * Get session id * @return string @@ -179,7 +172,7 @@ public function setDataValue ($name, $value) { public function getId () { return $this->id; } - + /** * Get session application name * @return string @@ -187,7 +180,7 @@ public function getId () { public function getCollectApp () { return $this->collectApp; } - + /** * Get session section name * @return string @@ -195,7 +188,7 @@ public function getCollectApp () { public function getSection () { return $this->section; } - + /** * Get timestamp in ms when session was created * @return double @@ -203,15 +196,16 @@ public function getSection () { public function getCreatedAt () { return $this->createdAt; } - + /** * Get timestamp in ms when session was changed * @return double */ public function getModifiedAt () { - return $this->modifiedAt; + $lastEvent = $this->getLastEvent(); + return $lastEvent ? $lastEvent->getCreatedAt() : $this->createdAt; } - + /** * Get session data object * @return array @@ -219,7 +213,7 @@ public function getModifiedAt () { public function getData () { return $this->data; } - + /** * Get single value from session data object * @return mixed @@ -252,9 +246,9 @@ public function addEvent ($event) { $events = $this->getEvents(); $events[] = $event; - + $this->events = $events; - + $this->setDirty(); return $event; @@ -270,7 +264,7 @@ public function getEvent ($eventId) { return $event->getId() === $eventId; }); $keys = array_keys($events); - return count($keys) ? $events[$keys[0]] : null; + return count($keys) ? $events[$keys[0]] : null; } /** @@ -300,16 +294,16 @@ public function getEvents ($eventDefinitionId = null) { return $events; } - + /** * Check if session is valid (all required fields are present) * @return bool */ public function isValid () { - return Validator::isSessionValid($this->serialize()) && + return Validator::isSessionValid($this->serialize()) && !!$this->getId() && !!$this->getSection() && !!$this->getCollectApp() && !!$this->getCreatedAt(); } - + /** * Serialize session from Session instance to array * @param bool $onlyChanges @@ -322,15 +316,14 @@ public function serialize ($onlyChanges = false) { if (!$onlyChanges || $this->hasDataChanges()) { $data = $this->getData(); } - + return (object) array( 'id' => $this->getId(), 'section' => $this->getSection(), 'collectApp' => $this->getCollectApp(), 'data' => (object) $data, 'events' => $events, - 'createdAt' => $this->getCreatedAt(), - 'modifiedAt' => $this->getModifiedAt() + 'createdAt' => $this->getCreatedAt() ); } @@ -358,11 +351,6 @@ public function merge (Session $session) { throw new \ErrorException('Session IDs should be similar'); } - // update last changed date - if ($session->modifiedAt > $this->modifiedAt) { - $this->modifiedAt = $session->modifiedAt; - } - // merge data $this->setData($session->getData()); @@ -371,7 +359,7 @@ public function merge (Session $session) { foreach ($this->getEvents() as $event) { $eventsMap[$event->getId()] = $event; } - + foreach ($session->getEvents() as $event) { $id = $event->getId(); if (!isset($eventsMap[$id])) { @@ -421,18 +409,18 @@ private function createEvent ($rawEventData) { */ private function serializeEvents ($onlyChanges = false) { $eventsMap = array(); - + foreach ($this->getEvents() as $event) { if ($onlyChanges && !$event->hasChanges()) { continue; } - + $eventsMap[] = $event->serialize(); } - - return $eventsMap; + + return $eventsMap; } - + /** * Mark attribute as "dirty" * @return Session @@ -441,7 +429,7 @@ protected function setDirty () { $this->dirty = true; return $this; } - + /** * Resets "dirty" status * @return Session @@ -449,14 +437,14 @@ protected function setDirty () { public function resetDirty () { $this->dirty = false; $this->dataDirty = false; - + foreach ($this->getEvents() as $event) { $event->resetDirty(); } - + return $this; } - + /** * Mark session data as "dirty" * @return Session @@ -473,7 +461,7 @@ protected function setDataDirty () { public function hasChanges () { return !!$this->dirty || $this->hasDataChanges() || $this->hasEventsChanges(); } - + /** * Check if session has changes in data property * @return bool @@ -492,8 +480,8 @@ protected function hasEventsChanges () { return true; } } - + return false; } - + } diff --git a/schema/attribute.json b/schema/attribute.json index 4f9c7fe..1ac90e4 100644 --- a/schema/attribute.json +++ b/schema/attribute.json @@ -10,9 +10,6 @@ }, "data": { "type": "object" - }, - "modifiedAt": { - "type": "number" } }, "required": ["collectApp", "section", "data"] diff --git a/schema/session.json b/schema/session.json index 48495f0..0954308 100644 --- a/schema/session.json +++ b/schema/session.json @@ -57,10 +57,7 @@ }, "events": { "$ref": "events.json" - }, - "modifiedAt": { - "type": "number" } }, - "required": ["id", "createdAt", "collectApp", "section", "data", "events", "modifiedAt"] + "required": ["id", "createdAt", "collectApp", "section", "data", "events"] } \ No newline at end of file diff --git a/tests/EventTest.php b/tests/EventTest.php index b0e4755..0d6c7dc 100644 --- a/tests/EventTest.php +++ b/tests/EventTest.php @@ -24,7 +24,7 @@ public function testShouldNotThrowErrorWhenCreateWithEmptyData () { public function testShouldGenerateOnlySomePropsByDefault () { $event = $this->createEvent(); $this->assertStringMatchesFormat("%s", $event->getId()); - $this->assertInternalType('double', $event->getCreatedAt()); + $this->assertInternalType('float', $event->getCreatedAt()); $this->assertInternalType('array', $event->getData()); $this->assertEmpty($event->getDefinitionId()); $this->assertFalse($event->isValid()); diff --git a/tests/Profile/ProfileTest.php b/tests/Profile/ProfileTest.php index 7d59003..fa46647 100644 --- a/tests/Profile/ProfileTest.php +++ b/tests/Profile/ProfileTest.php @@ -5,7 +5,7 @@ require_once('vendor/autoload.php'); class ProfileTest extends Base { - + protected $profileData = array( 'id' => 'pid', 'attributes' => array( @@ -31,18 +31,16 @@ class ProfileTest extends Base { 'collectApp' => 'app1', 'section' => 'sec1', 'createdAt' => 1442476047267, - 'modifiedAt' => 1442476047267, 'data' => array( 'data1' => 'value1' ), 'events' => array() - ), + ), array( 'id' => 'sid2', 'collectApp' => 'app2', 'section' => 'sec2', 'createdAt' => 1442476047267, - 'modifiedAt' => 1442476047267, 'data' => array(), 'events' => array( array( @@ -54,19 +52,18 @@ class ProfileTest extends Base { ) ) ) - ), + ), array( 'id' => 'sid3', 'collectApp' => 'app3', 'section' => 'sec3', 'createdAt' => 1442476047267, - 'modifiedAt' => 1442476047267, 'data' => array(), 'events' => array() ) ) ); - + /** * TODO: should be splitted */ @@ -126,42 +123,42 @@ public function testShouldReturnSomeData () { $this->assertEquals(1, count($sessions)); $session = $profile->getSession('sid'); $this->assertEquals('value1', $session->getDataValue('name1')); - } - + } + public function testShouldNotThrowErrorOnEmptyConfig () { $this->assertInstanceOf('Innometrics\Profile', $this->createProfile()); $this->assertInstanceOf('Innometrics\Profile', $this->createProfile(array())); } - + public function testShouldBeInitedWithDefaultData () { $profile = $this->createProfile(); $sessions = $profile->getSessions(); $attributes = $profile->getAttributes(); - + $profileId = $profile->getId(); $this->assertTrue(is_string($profileId)); $this->assertEquals(32, strlen($profileId)); - + $this->assertTrue(is_array($sessions)); $this->assertCount(0, $sessions); - + $this->assertTrue(is_array($attributes)); $this->assertCount(0, $attributes); } - + public function testShouldUseIdFromConfig () { $profileId = 'pid'; $profile = $this->createProfile(array( 'id' => $profileId )); - + $this->assertEquals($profileId, $profile->getId()); } - + public function testShouldProperlySerializeProfile () { $profileData = $this->profileData; $profile = $this->createProfile($profileData); - + $serializedData = $profileData; foreach ($serializedData['attributes'] as $key => $item) { $item['data'] = (object) $item['data']; @@ -170,29 +167,29 @@ public function testShouldProperlySerializeProfile () { } foreach ($serializedData['sessions'] as $key => $item) { $item['data'] = (object) $item['data']; - + foreach ($item['events'] as $key2 => $item2) { $item2['data'] = (object) $item2['data']; $item2 = (object) $item2; $item['events'][$key2] = $item2; } - + $item = (object) $item; $serializedData['sessions'][$key] = $item; } - + $this->assertEquals((object) $serializedData, $profile->serialize()); } - + public function testShouldSerializeOnlyChangedDataOfProfile () { $profileData = $this->profileData; $profile = $this->createProfile($profileData); - + $profile->resetDirty(); $this->assertFalse($profile->hasChanges()); - + $profile->getAttribute('test', 'app1', 'sec1')->setValue('babar'); - + $profile->getSession('sid1')->addEvent(array( 'id' => 'a', 'definitionId' => 'b', @@ -201,9 +198,9 @@ public function testShouldSerializeOnlyChangedDataOfProfile () { $profile->getSession('sid2')->setDataValue('dd', 'bb'); $this->assertTrue($profile->hasChanges()); - + $now = round(microtime(true) * 1000); - + $this->assertEquals((object) array( 'id' => 'pid', 'attributes' => array( @@ -221,7 +218,6 @@ public function testShouldSerializeOnlyChangedDataOfProfile () { 'collectApp' => 'app1', 'section' => 'sec1', 'createdAt' => 1442476047267, - 'modifiedAt' => 1442476047267, 'data' => (object) array(), 'events' => array( (object) array( @@ -237,19 +233,18 @@ public function testShouldSerializeOnlyChangedDataOfProfile () { 'collectApp' => 'app2', 'section' => 'sec2', 'createdAt' => 1442476047267, - 'modifiedAt' => 1442476047267, 'data' => (object) array( 'dd' => 'bb' ), 'events' => array() ) - ) + ) ), $profile->serialize(true)); - } - + } + public function testShouldReturnErrorIfProfileIsNotInstanceOfProfileWhileProfileMerging () { $profile = $this->createProfile(); - + foreach (array(null, true, array()) as $value) { try { $profile->merge($value); @@ -257,19 +252,19 @@ public function testShouldReturnErrorIfProfileIsNotInstanceOfProfileWhileProfile $this->assertStringStartsWith('Argument 1 passed to Innometrics\Profile::merge() must be an instance of Innometrics\Profile', $e->getMessage()); } } - } - + } + /** * @expectedException ErrorException * @expectedExceptionMessage Profile IDs should be similar - */ + */ public function testShouldReturnErrorIfIdsAreDifferentWhileProfileMerging () { $profile1 = $this->createProfile('pid1'); $profile2 = $this->createProfile('pid2'); - + $profile1->merge($profile2); - } - + } + public function testShouldProperlyMergeDataFromProfileToOtherOne () { $profile1 = $this->createProfile(array( "id" => 'pid', @@ -312,7 +307,7 @@ public function testShouldProperlyMergeDataFromProfileToOtherOne () { ) ) )); - + $profile2 = $this->createProfile(array( "id" => 'pid', "attributes" => array( @@ -361,23 +356,23 @@ public function testShouldProperlyMergeDataFromProfileToOtherOne () { ) ) )); - + $profile1->merge($profile2); - + $this->assertCount(3, $profile1->getAttributes()); $this->assertEquals('baz', $profile1->getAttribute('foo', 'app1', 'sec1')->getValue()); - + $this->assertCount(3, $profile1->getSessions()); $this->assertEquals(array( 'test1' => 'e', 'test2' => 'w' ), $profile1->getSession('sid2')->getData()); } - + public function testShouldBeChangedIfHasChangedAttribute () { $profile = $this->createProfile(); $this->assertFalse($profile->hasChanges()); - + $profile->setAttribute(array( 'collectApp' => 'web', 'section' => 'sec', @@ -386,11 +381,11 @@ public function testShouldBeChangedIfHasChangedAttribute () { )); $this->assertTrue($profile->hasChanges()); } - + public function testShouldBeChangedIfHasChangedSession() { $profile = $this->createProfile(); $this->assertFalse($profile->hasChanges()); - + $profile->setSession(array( 'collectApp' => 'web', 'section' => 'sec', @@ -398,7 +393,7 @@ public function testShouldBeChangedIfHasChangedSession() { )); $this->assertTrue($profile->hasChanges()); } - + public function testShouldNotChangedAfterResetDirty() { $profile = $this->createProfile(array( 'attributes' => array( @@ -412,9 +407,9 @@ public function testShouldNotChangedAfterResetDirty() { ) )); $this->assertTrue($profile->hasChanges()); - + $profile->resetDirty(); $this->assertFalse($profile->hasChanges()); } - + } diff --git a/tests/Profile/SessionsTest.php b/tests/Profile/SessionsTest.php index 772a866..69616d8 100644 --- a/tests/Profile/SessionsTest.php +++ b/tests/Profile/SessionsTest.php @@ -20,11 +20,11 @@ public function testShouldCreateSessionsFromConfig () { ) ) )); - + $sessions = $profile->getSessions(); - + $this->assertCount(1, $sessions); - + $session = $sessions[0]; $this->assertEquals($session->getCollectApp(), 'app'); $this->assertEquals($session->getSection(), 'sec'); @@ -184,13 +184,27 @@ public function testShouldReturnLastSession () { 'id' => 'sid1', 'collectApp'=> 'app1', 'section' => 'sec1', - 'modifiedAt' => 100 + 'createdAt' => 1000000000000 ]); $profile->setSession([ 'id' => 'sid2', 'collectApp'=> 'app2', 'section' => 'sec2', - 'modifiedAt' => 50 + 'createdAt' => 1000000000001 + ]); + + $session = $profile->getLastSession(); + $this->assertEquals('sid2', $session->getId()); + + $profile->getSession('sid1')->addEvent([ + 'id' => 'e1', + 'definitionId' => 'b1', + 'createdAt' => 1000000000004 + ]); + $profile->getSession('sid2')->addEvent([ + 'id' => 'e2', + 'definitionId' => 'b2', + 'createdAt' => 1000000000003 ]); $session = $profile->getLastSession(); diff --git a/tests/SessionTest.php b/tests/SessionTest.php index 795e83e..cfd3eff 100644 --- a/tests/SessionTest.php +++ b/tests/SessionTest.php @@ -93,8 +93,7 @@ public function testShouldReceiveSerializeData () { 'createdAt' => $now ) ), - 'createdAt' => $now, - 'modifiedAt' => $now + 'createdAt' => $now )); $this->assertEquals((object) array( @@ -110,8 +109,7 @@ public function testShouldReceiveSerializeData () { 'createdAt' => $now ) ), - 'createdAt' => $now, - 'modifiedAt' => $now + 'createdAt' => $now ), $session->serialize(), 'serialize test'); } @@ -131,8 +129,7 @@ public function testShouldBeCanWorkWithEvents () { 'createdAt' => $now ) ), - 'createdAt' => $now, - 'modifiedAt' => $now + 'createdAt' => $now )); $session->setDataValue('name2', 'value2');