{"id":19838835,"url":"https://github.com/kunicmarko20/idea-helpable-plugin","last_synced_at":"2026-04-17T17:31:05.384Z","repository":{"id":96403486,"uuid":"204357963","full_name":"kunicmarko20/idea-helpable-plugin","owner":"kunicmarko20","description":"PHPStorm plugin that generates all the boileplate code","archived":false,"fork":false,"pushed_at":"2021-02-06T22:20:24.000Z","size":128,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-07T04:03:26.843Z","etag":null,"topics":["java","php","phpstorm-plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","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/kunicmarko20.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}},"created_at":"2019-08-25T22:43:32.000Z","updated_at":"2021-02-06T22:17:17.000Z","dependencies_parsed_at":"2023-03-12T13:30:50.298Z","dependency_job_id":null,"html_url":"https://github.com/kunicmarko20/idea-helpable-plugin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kunicmarko20/idea-helpable-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunicmarko20%2Fidea-helpable-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunicmarko20%2Fidea-helpable-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunicmarko20%2Fidea-helpable-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunicmarko20%2Fidea-helpable-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kunicmarko20","download_url":"https://codeload.github.com/kunicmarko20/idea-helpable-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunicmarko20%2Fidea-helpable-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31938584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["java","php","phpstorm-plugin"],"created_at":"2024-11-12T12:19:12.227Z","updated_at":"2026-04-17T17:31:05.363Z","avatar_url":"https://github.com/kunicmarko20.png","language":"Java","readme":"Helpable\n========\n\nA PHPStorm plugin that handles all the boilerplate code at [Lendable](https://github.com/Lendable).\n\n## What does this plugin do\n\nThis plugin generates code snippets and creates new files.\n\n## Actions\n\n* [With*](#with)\n* [To*](#to)\n* [Equals](#equals)\n* [Factory Method](#factory-method)\n* [Enum](#enum)\n* [JMS Serializer XML Configuration](#jms-serialize-xml-configuration)\n* [JMS Serializer Handler](#jms-serializer-handler)\n\n### With*\n\nIf there is only 1 property in your class, `With*` Generator will that property and generate a `wither` method\nthat looks like:\n\n```php\npublic function withName(string $name):self\n{\n    $instance = clone $this;\n    $instance-\u003ename = $name;\n\n    return $instance;\n}\n```\n\nIf there is more than 1 field, it will let you choose one or multiple fields for which you want to generate a wither.\n\n### To*\n\n`To*` will generate a representation method for your class based on selected property that looks like:\n\n```php\npublic function toString(): string\n{\n    return $this-\u003ename;\n}\n```\n\nIf there is more than 1 property it will let you choose which property you want, if there is only 1 it will take that one.\n\n### Equals\n\nEquals takes all properties in the class and generates an equals method that looks like:\n \n```php\npublic function equals(Name $other): bool\n{\n    return $this-\u003ename === $other-\u003ename;\n}\n```\n\n### Factory Method\n\nFactory Method takes all properties in the class and creates generic factory method that looks like:\n\n```php\npublic static function with(\n    FirstName $firstName,\n    LastName $lastName\n): self {\n    $instance = new self();\n\n    $instance-\u003efirstName = $firstName;\n    $instance-\u003elastName = $lastName;\n\n    return $instance;\n}\n```\n### Enum\n\nEnum method requires you to have a class with only constants that represent enum variants and adds all needed\ncode to it, it converts:\n\n```php\nfinal class Light\n{\n    private const GREEN = 'green';\n\n    private const YELLOW = 'yellow';\n\n    private const RED = 'red';\n}\n```\n\ninto:\n\n```php\nfinal class Light\n{\n    private const GREEN = 'green';\n\n    private const YELLOW = 'yellow';\n\n    private const RED = 'red';\n\n    private const ALL = [\n        self::GREEN,\n        self::YELLOW,\n        self::RED,\n    ];\n    \n    /**\n    * @var string\n    */\n    private $value;\n    \n    /**\n    * @var array\u003cstring, Light\u003e\n    */\n    private static $lazyLoad = [];\n    \n    private function __construct(string $value)\n    {\n        \\Assert\\Assert::that($value)-\u003einArray(self::ALL);\n    \n        $this-\u003evalue = $value;\n    }\n    \n    public static function fromString(string $value): self\n    {\n        return new self($value);\n    }\n\n    public static function green(): self\n    {\n        return self::lazyLoad(self::GREEN);\n    }\n\n    public static function yellow(): self\n    {\n        return self::lazyLoad(self::YELLOW);\n    }\n\n    public static function red(): self\n    {\n        return self::lazyLoad(self::RED);\n    }\n\n    private static function lazyLoad(string $value): self\n    {\n        if (isset(self::$lazyLoad[$value])) {\n            return self::$lazyLoad[$value];\n        }\n    \n        return self::$lazyLoad[$value] = new self($value);\n    }\n    \n    public function toString(): string\n    {\n        return $this-\u003evalue;\n    }\n    \n    public function equals(Light $other): bool\n    {\n        return $this-\u003evalue === $other-\u003evalue;\n    }\n}\n```\n\n### JMS Serialize XML Configuration\n\nThis action creates a new XML JMS Configuration file based on selected class. You get a dialog\nwith a textbox that autocompletes php classes in your project, after you select a class you get\na file like:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\u003cserializer\u003e\n    \u003cclass name=\"MyProject\\Name\" exclusion-policy=\"ALL\"\u003e\n        \u003cproperty name=\"firstName\" type=\"MyProject\\FirstName\" expose=\"true\" /\u003e\n        \u003cproperty name=\"lastName\" type=\"MyProject\\LastName\" expose=\"true\" /\u003e\n    \u003c/class\u003e\n\u003c/serializer\u003e\n```\n\n### JMS Serializer Handler\n\nThis action creates a new JMS Handler file based on selected class. You get a dialog\nwith a textbox that autocompletes php classes in your project, after you select a class you get\na file like:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace MyProject\\JMSSerializer;\n\nuse JMS\\Serializer\\GraphNavigatorInterface;\nuse JMS\\Serializer\\Handler\\SubscribingHandlerInterface;\nuse JMS\\Serializer\\JsonDeserializationVisitor;\nuse JMS\\Serializer\\JsonSerializationVisitor;\nuse MyProject\\FirstName;\n\nfinal class FirstNameHandler implements SubscribingHandlerInterface\n{\n    public static function getSubscribingMethods(): array\n    {\n        return [\n            [\n                'type' =\u003e FirstName::class,\n                'direction' =\u003e GraphNavigatorInterface::DIRECTION_DESERIALIZATION,\n                'format' =\u003e 'json',\n                'method' =\u003e 'deserialize',\n            ],\n            [\n                'type' =\u003e FirstName::class,\n                'direction' =\u003e GraphNavigatorInterface::DIRECTION_SERIALIZATION,\n                'format' =\u003e 'json',\n                'method' =\u003e 'serialize',\n            ],\n        ];\n    }\n\n    public function deserialize(JsonDeserializationVisitor $visitor, string $firstName, array $type): FirstName\n    {\n        return FirstName::fromString($firstName);\n    }\n\n    public function serialize(JsonSerializationVisitor $visitor, FirstName $firstName, array $type): string\n    {\n        return $firstName-\u003etoString();\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunicmarko20%2Fidea-helpable-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkunicmarko20%2Fidea-helpable-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunicmarko20%2Fidea-helpable-plugin/lists"}