{"id":16676036,"url":"https://github.com/marvin255/optional","last_synced_at":"2025-07-16T23:35:11.453Z","repository":{"id":62551403,"uuid":"509222851","full_name":"marvin255/optional","owner":"marvin255","description":"PHP implementation of Java's Optional object","archived":false,"fork":false,"pushed_at":"2025-05-10T11:20:11.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-10T11:31:35.330Z","etag":null,"topics":["optional","php"],"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/marvin255.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-30T20:22:30.000Z","updated_at":"2025-05-10T11:01:29.000Z","dependencies_parsed_at":"2023-12-21T11:57:48.662Z","dependency_job_id":"810b34ca-7e84-420c-849f-7a79f391c62f","html_url":"https://github.com/marvin255/optional","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"e949c6efa91323e820a513ce73174e7281996faa"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/marvin255/optional","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Foptional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Foptional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Foptional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Foptional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marvin255","download_url":"https://codeload.github.com/marvin255/optional/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvin255%2Foptional/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265550393,"owners_count":23786564,"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":["optional","php"],"created_at":"2024-10-12T13:08:51.953Z","updated_at":"2025-07-16T23:35:11.435Z","avatar_url":"https://github.com/marvin255.png","language":"PHP","readme":"# Optional\n\n[![Latest Stable Version](https://poser.pugx.org/marvin255/optional/v)](https://packagist.org/packages/marvin255/optional)\n[![Total Downloads](https://poser.pugx.org/marvin255/optional/downloads)](https://packagist.org/packages/marvin255/optional)\n[![License](https://poser.pugx.org/marvin255/optional/license)](https://packagist.org/packages/marvin255/optional)\n[![Build Status](https://github.com/marvin255/optional/workflows/marvin255_optional/badge.svg)](https://github.com/marvin255/optional/actions?query=workflow%3A%22marvin255_optional%22)\n\nPHP implementation of Java's Optional object.\n\nA container object which may or may not contain a non-null value. If a value is present, isPresent() will return true and get() will return the value.\n\n\n\n## Installation\n\nInstall via composer:\n\n```bash\ncomposer req marvin255/optional\n```\n\n\n\n## Usage\n\n```php\nuse Marvin255\\Optional\\Optional;\n\n$optional = Optional::of($input);\nif ($optional-\u003eisPresent()) {\n    $value = $optional-\u003eget();\n    // do something\n}\n```\n\nWith lambda\n\n```php\nuse Marvin255\\Optional\\Optional;\n\nOptional::of($input)-\u003eifPresent(function ($item): void {/* do something */});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvin255%2Foptional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarvin255%2Foptional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvin255%2Foptional/lists"}