{"id":21288980,"url":"https://github.com/hollodotme/crontab-validator","last_synced_at":"2025-10-14T12:55:23.876Z","repository":{"id":56985429,"uuid":"66876206","full_name":"hollodotme/crontab-validator","owner":"hollodotme","description":"A validator for crontab expressions","archived":false,"fork":false,"pushed_at":"2019-08-04T20:20:50.000Z","size":40,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T14:28:06.591Z","etag":null,"topics":["crontab","crontab-syntax","expression","php","validator"],"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/hollodotme.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-29T20:00:11.000Z","updated_at":"2023-12-18T07:46:12.000Z","dependencies_parsed_at":"2022-08-21T09:10:28.906Z","dependency_job_id":null,"html_url":"https://github.com/hollodotme/crontab-validator","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hollodotme/crontab-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollodotme%2Fcrontab-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollodotme%2Fcrontab-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollodotme%2Fcrontab-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollodotme%2Fcrontab-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hollodotme","download_url":"https://codeload.github.com/hollodotme/crontab-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollodotme%2Fcrontab-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018583,"owners_count":26086583,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["crontab","crontab-syntax","expression","php","validator"],"created_at":"2024-11-21T12:32:48.254Z","updated_at":"2025-10-14T12:55:23.861Z","avatar_url":"https://github.com/hollodotme.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/hollodotme/crontab-validator.svg?branch=master)](https://travis-ci.org/hollodotme/crontab-validator)\n[![Coverage Status](https://coveralls.io/repos/github/hollodotme/crontab-validator/badge.svg?branch=master)](https://coveralls.io/github/hollodotme/crontab-validator?branch=master)\n[![Latest Stable Version](https://poser.pugx.org/hollodotme/crontab-validator/v/stable)](https://packagist.org/packages/hollodotme/crontab-validator) \n[![Total Downloads](https://poser.pugx.org/hollodotme/crontab-validator/downloads)](https://packagist.org/packages/hollodotme/crontab-validator) \n[![License](https://poser.pugx.org/hollodotme/crontab-validator/license)](https://packagist.org/packages/hollodotme/crontab-validator)\n\n# CrontabValidator\n\nA validator for crontab expressions.\n\nSources used to determine the allowed expressions:\n\n* https://crontab.guru/\n* https://en.wikipedia.org/wiki/Cron\n\n## Features\n\n* Validation of crontab expressions like \u003ckbd\u003e6,21,36,51 7-23/1 * FEB-NOV/2 *\u003c/kbd\u003e.\n\n## Requirements\n\n* PHP \u003e= 7.1\n\n## Installation\n\n```\ncomposer require \"hollodotme/crontab-validator\"\n```\n\n## Usage\n\n### Boolean validation\n\n```php\n\u003c?php declare(strict_types=1);\n\nnamespace MyVendor\\MyProject;\n\nuse hollodotme\\CrontabValidator\\CrontabValidator;\n\n$validator = new CrontabValidator();\n\nif ( $validator-\u003eisExpressionValid( '6,21,36,51 7-23/1 * FEB-NOV/2 *' ) )\n{\n\techo 'Expression is valid.';\n}\nelse\n{\n\techo 'Expression is invalid.';\t\n}\n```\n\n### Guarding\n\n```php\n\u003c?php declare(strict_types=1);\n\nnamespace MyVendor\\MyProject;\n\nuse hollodotme\\CrontabValidator\\CrontabValidator;\nuse hollodotme\\CrontabValidator\\Exceptions\\InvalidExpressionException;\n\n$validator = new CrontabValidator();\n\ntry \n{\n\t# =\u003e All fine, execution continues\n\t$validator-\u003eguardExpressionIsValid( '6,21,36,51 7-23/1 * FEB-NOV/2 *' );\n\t\n\t# =\u003e This will raise an InvalidExpressionException\n\t$validator-\u003eguardExpressionIsValid( 'this is not a valid interval' );\n}\ncatch ( InvalidExpressionException $e )\n{\n\techo $e-\u003egetMessage();\n}\n```\n\n**Prints:**\n\n\tInvalid crontab expression: \"this is not a valid interval\"\n\t\n\n---\n\nFeedback and contributions welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollodotme%2Fcrontab-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhollodotme%2Fcrontab-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollodotme%2Fcrontab-validator/lists"}