{"id":23038983,"url":"https://github.com/candasm/hypno","last_synced_at":"2025-04-02T23:45:30.334Z","repository":{"id":62499340,"uuid":"311466458","full_name":"candasm/hypno","owner":"candasm","description":"Delay execution package for PHP","archived":false,"fork":false,"pushed_at":"2020-11-16T14:38:02.000Z","size":1085,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T14:12:27.640Z","etag":null,"topics":["delay-execution","hypno","php","sleep","usleep"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/candasm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-09T21:13:29.000Z","updated_at":"2020-11-16T14:38:04.000Z","dependencies_parsed_at":"2022-11-02T09:45:52.657Z","dependency_job_id":null,"html_url":"https://github.com/candasm/hypno","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Fhypno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Fhypno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Fhypno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candasm%2Fhypno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/candasm","download_url":"https://codeload.github.com/candasm/hypno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911488,"owners_count":20853654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delay-execution","hypno","php","sleep","usleep"],"created_at":"2024-12-15T18:26:50.418Z","updated_at":"2025-04-02T23:45:30.273Z","avatar_url":"https://github.com/candasm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eHypno (Delay execution package for PHP)\u003c/h1\u003e\nHypno is a wrapper of \u003ca href=\"https://www.php.net/manual/en/function.sleep.php\"\u003ePHP delay execution commands\u003c/a\u003e package. \n\nThis package created to write less complex unit test when delaying methods used in the application logic.\n\n\u003cdiv align=\"center\"\u003e\n\n![Image of Hypno](./assets/hypno.gif)\n\n![Travis (.org)](https://img.shields.io/travis/candasm/hypno)\n[![Coverage Status](https://coveralls.io/repos/github/candasm/hypno/badge.svg?branch=master)](https://coveralls.io/github/candasm/hypno?branch=master)\n![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/candasm/hypno)\n\n\u003c/div\u003e\n\n## Installation\n\n```bash\n$ composer require candasm/hypno\n```\n\n## Basic Usage\nPackage covers sleep, usleep, time_nanosleep and time_sleep_until functions. Camelcased methods can be seen on [Hypnotize](./src/Hypnotize.php) interface.\n\n```php\n\u003c?php\n\nuse Candasm\\Hypno;\n\n$hypno = new Hypno\\Hypnosis();\n$hypno-\u003esleep(5);\n```\n\n## Unit Testing\n\nWhen you use your DI just inject [Hypnotize](src/Hypnotize.php) interface then you can do this easily with [Mockery](https://github.com/mockery/mockery) or any other mock library.\n\n```php\n\u003c?php\n\nuse Candasm\\Hypno;\n\n$hypno = \\Mockery::mock(Hypno\\Hypnotize::class, function(\\Mockery\\MockInterface $m) {\n    $m-\u003eshouldReceive('sleep')-\u003ewith(1)-\u003ereturnNull();\n});\n\n```\n\n## Documentation\n\nYou can check [Hypnosis](src/Hypnosis.php) class to see how methods are working.\n\n### Requirements\n\nPHP 5.6+ ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandasm%2Fhypno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandasm%2Fhypno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandasm%2Fhypno/lists"}