{"id":27091708,"url":"https://github.com/dgame/php-conditional","last_synced_at":"2025-06-17T03:05:24.981Z","repository":{"id":56967356,"uuid":"60739065","full_name":"Dgame/php-conditional","owner":"Dgame","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-09T18:36:39.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-10T01:18:10.996Z","etag":null,"topics":["conditional","debug","php","version"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dgame.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-09T00:05:56.000Z","updated_at":"2021-10-23T19:48:38.000Z","dependencies_parsed_at":"2022-08-21T06:10:26.251Z","dependency_job_id":null,"html_url":"https://github.com/Dgame/php-conditional","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Dgame/php-conditional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dgame%2Fphp-conditional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dgame%2Fphp-conditional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dgame%2Fphp-conditional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dgame%2Fphp-conditional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dgame","download_url":"https://codeload.github.com/Dgame/php-conditional/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dgame%2Fphp-conditional/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260281567,"owners_count":22985627,"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":["conditional","debug","php","version"],"created_at":"2025-04-06T07:53:28.326Z","updated_at":"2025-06-17T03:05:24.947Z","avatar_url":"https://github.com/Dgame.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-conditional\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Dgame/php-conditional/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Dgame/php-conditional/?branch=master)\n\n[![Build Status](https://travis-ci.org/Dgame/php-conditional.svg?branch=master)](https://travis-ci.org/Dgame/php-conditional)\n\n## enjoy conditional php-programming\n\n```php\n\u003c?php\n\nuse function Dgame\\Conditional\\debug;\nuse function Dgame\\Conditional\\version;\n\nrequire_once 'vendor/autoload.php';\n\ndebug('foo')-\u003eenable();\ndebug('foo')-\u003eoutput('Hello, foo');\ndebug('foo')-\u003ethen(function(string $label) {\n    print 'Debug of ' . $label . ' is enabled' . PHP_EOL;\n});\n\nversion('7.0.8')-\u003eisEqualTo(PHP_VERSION)-\u003eoutput('Hello PHP 7');\nversion('7')-\u003eisLowerOrEqualTo(PHP_VERSION)-\u003ethen(function(string $version) {\n    print 'Version ' . $version . ' is verified' . PHP_EOL;\n});\n\nversion('7.0.9')-\u003eisEqualTo(PHP_VERSION)-\u003eoutput('Production')-\u003eotherwise(function(string $version) {\n    print $version . ' does not match ' . PHP_VERSION . PHP_EOL;\n});\n\n//debug('foo')-\u003eoutput('This is 100% the end')-\u003eabort();\n//debug('foo')-\u003eoutput('This may be the end')-\u003eabortIf(!isset($result));\n\nversion('7.1.0alpha2')-\u003eisProduction()-\u003eoutput('Production');\n\nclass FooBar\n{\n    public function test(string $label, string $note)\n    {\n        print __METHOD__ . ' [' . $label . '] : ' . $note . PHP_EOL;\n    }\n}\n\n$fb = new FooBar();\n\ndebug('bar')-\u003eenable();\ndebug('bar')-\u003ethen([$fb, 'test'], 'yay');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgame%2Fphp-conditional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgame%2Fphp-conditional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgame%2Fphp-conditional/lists"}