{"action":"closed","issue":{"url":"https://api.github.com/repos/lisachenko/php-deal/issues/3","repository_url":"https://api.github.com/repos/lisachenko/php-deal","labels_url":"https://api.github.com/repos/lisachenko/php-deal/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/lisachenko/php-deal/issues/3/comments","events_url":"https://api.github.com/repos/lisachenko/php-deal/issues/3/events","html_url":"https://github.com/lisachenko/php-deal/issues/3","id":41933086,"number":3,"title":"[Feature] Integration with beberlei/assert library","user":{"login":"lisachenko","id":640114,"avatar_url":"https://avatars.githubusercontent.com/u/640114?v=3","gravatar_id":"","url":"https://api.github.com/users/lisachenko","html_url":"https://github.com/lisachenko","followers_url":"https://api.github.com/users/lisachenko/followers","following_url":"https://api.github.com/users/lisachenko/following{/other_user}","gists_url":"https://api.github.com/users/lisachenko/gists{/gist_id}","starred_url":"https://api.github.com/users/lisachenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisachenko/subscriptions","organizations_url":"https://api.github.com/users/lisachenko/orgs","repos_url":"https://api.github.com/users/lisachenko/repos","events_url":"https://api.github.com/users/lisachenko/events{/privacy}","received_events_url":"https://api.github.com/users/lisachenko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/lisachenko/php-deal/milestones/1","html_url":"https://github.com/lisachenko/php-deal/milestones/0.3.0","labels_url":"https://api.github.com/repos/lisachenko/php-deal/milestones/1/labels","id":1656080,"number":1,"title":"0.3.0","description":"","creator":{"login":"lisachenko","id":640114,"avatar_url":"https://avatars.githubusercontent.com/u/640114?v=3","gravatar_id":"","url":"https://api.github.com/users/lisachenko","html_url":"https://github.com/lisachenko","followers_url":"https://api.github.com/users/lisachenko/followers","following_url":"https://api.github.com/users/lisachenko/following{/other_user}","gists_url":"https://api.github.com/users/lisachenko/gists{/gist_id}","starred_url":"https://api.github.com/users/lisachenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisachenko/subscriptions","organizations_url":"https://api.github.com/users/lisachenko/orgs","repos_url":"https://api.github.com/users/lisachenko/repos","events_url":"https://api.github.com/users/lisachenko/events{/privacy}","received_events_url":"https://api.github.com/users/lisachenko/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"open","created_at":"2016-03-20T18:46:10Z","updated_at":"2016-03-20T19:28:10Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-09-04T13:01:25Z","updated_at":"2016-03-20T19:28:10Z","closed_at":"2016-03-20T19:28:10Z","body":"Integration with @beberlei's assert library can give a nice tool for writing DbC conditions and assertions, see https://github.com/beberlei/assert#list-of-assertions. For example, \r\n\r\n```php\r\n    /**\r\n     * Deposits fixed amount of money to the account\r\n     *\r\n     * @param float $amount\r\n     *\r\n     * @Contract\\Ensure(\"Assert\\Assertion::integer($this->balance)\")\r\n     */\r\n    public function deposit($amount)\r\n    {\r\n        $this->balance += $amount;\r\n    }\r\n```"}}