{"id":20790392,"url":"https://github.com/paragonie/stern","last_synced_at":"2025-05-05T20:42:53.879Z","repository":{"id":52800256,"uuid":"90085191","full_name":"paragonie/stern","owner":"paragonie","description":"Stern lets you built type-safe PHP projects, even if your project's users aren't writing type-safe code","archived":false,"fork":false,"pushed_at":"2022-05-12T04:07:39.000Z","size":11,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T23:31:33.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/paragonie.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":"2017-05-02T22:52:17.000Z","updated_at":"2024-08-12T21:57:24.000Z","dependencies_parsed_at":"2022-08-23T20:50:48.472Z","dependency_job_id":null,"html_url":"https://github.com/paragonie/stern","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fstern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fstern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fstern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paragonie%2Fstern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paragonie","download_url":"https://codeload.github.com/paragonie/stern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252573411,"owners_count":21770207,"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":[],"created_at":"2024-11-17T15:34:50.501Z","updated_at":"2025-05-05T20:42:53.848Z","avatar_url":"https://github.com/paragonie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stern\n\n[![Build Status](https://github.com/paragonie/stern/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/stern/actions)\n[![Latest Stable Version](https://poser.pugx.org/paragonie/stern/v/stable)](https://packagist.org/packages/paragonie/stern)\n[![Latest Unstable Version](https://poser.pugx.org/paragonie/stern/v/unstable)](https://packagist.org/packages/paragonie/stern)\n[![License](https://poser.pugx.org/paragonie/stern/license)](https://packagist.org/packages/paragonie/stern)\n\nStern lets you built type-safe PHP projects, even if your project's users aren't writing type-safe code. \n\n**Requires PHP 7+**\n\n## Usage\n\nUsing Stern is simply:\n\n1. Make your class use the `SternTrait`.\n2. Rename your methods from `whateverName` to `strictWhateverName`.\n3. Enjoy strict-typing whether your users like it or not.\n\n## Example\n\n```diff\n  \u003c?php\n  declare(strict_types=1);\n  namespace YourVendor\\YourNamespace;\n\n  class YourClassThatUsesStrictTypes\n  {\n+      use \\ParagonIE\\Stern\\SternTrait;\n  \n      /* ... */\n  \n-     public function foo(string $param = ''): bool\n+     public function strictFoo(string $param = ''): bool\n      {\n      }\n  }\n```\n\n## Docblock Usability \n\nFor better usability (especially with type-aware IDEs like PHPStorm), make sure\nyou use [`@method`](https://docs.phpdoc.org/references/phpdoc/tags/method.html)\ndocblocks.\n\n```diff\n  \u003c?php\n  declare(strict_types=1);\n  namespace YourVendor\\YourNamespace;\n\n+   /**\n+    * @method bool foo(string $param = '')\n+    */\n  class YourClassThatUsesStrictTypes\n  {\n+      use \\ParagonIE\\Stern\\SternTrait;\n  \n      /* ... */\n  \n-     public function foo(string $param = ''): bool\n+     public function strictFoo(string $param = ''): bool\n      {\n      }\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fstern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparagonie%2Fstern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparagonie%2Fstern/lists"}