{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":336736886,"defaultBranch":"master","name":"phpstan-src","ownerLogin":"ruudk","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2021-02-07T08:20:08.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/104180?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1714999107.0","currentOid":""},"activityList":{"items":[{"before":"04fd838e7dea70532b7f1d62939bc8723021f635","after":null,"ref":"refs/heads/new-type","pushedAt":"2024-05-06T12:38:27.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"}},{"before":"d0950e6b46a330ba24e4ae7b5deb8aa01348a37d","after":"04fd838e7dea70532b7f1d62939bc8723021f635","ref":"refs/heads/new-type","pushedAt":"2024-05-06T12:22:43.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Introduce `new` type\n\nThis makes it possible that a new instance of a class-string will be returned.\n\n```php\n/**\n * @var array\n */\nprivate const TYPES = [\n\t'foo' => DateTime::class,\n\t'bar' => DateTimeImmutable::class,\n];\n\n/**\n * @template T of key-of\n * @param T $type\n *\n * @return new\n */\npublic static function get(string $type) : ?object\n{\n\t$class = self::TYPES[$type];\n\treturn new $class('now');\n}\n```\n\nSee https://github.com/phpstan/phpstan/issues/9704\n\nThe work was done by @rvanvelzen in a gist. I just created the PR for it.\n\nCo-Authored-By: Richard van Velzen ","shortMessageHtmlLink":"Introduce new type"}},{"before":"b7a8fab0be459a7bdd1dc1a5aca7b6c073957e84","after":"d0950e6b46a330ba24e4ae7b5deb8aa01348a37d","ref":"refs/heads/new-type","pushedAt":"2024-05-06T12:20:13.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Introduce `new` type\n\nThis makes it possible that a new instance of a class-string will be returned.\n\nFor example:\n```php\n/**\n * @template T of class-string\n * @param T $type\n *\n * @return new\n */\npublic static function get(string $type) : ?object\n{\n\treturn new $type;\n}\n```\n\nOr a more complex example:\n```php\n/**\n * @var array\n */\nprivate const TYPES = [\n\t'foo' => DateTime::class,\n\t'bar' => DateTimeImmutable::class,\n];\n\n/**\n * @template T of key-of\n * @param T $type\n *\n * @return new\n */\npublic static function get(string $type) : ?object\n{\n\t$class = self::TYPES[$type];\n\treturn new $class('now');\n}\n```\n\nSee https://github.com/phpstan/phpstan/issues/9704\n\nThe work was done by @rvanvelzen in a gist. I just created the PR for it.\n\nCo-Authored-By: Richard van Velzen ","shortMessageHtmlLink":"Introduce new type"}},{"before":"5d26c54719ba0690886063af71caf03e8dc04d44","after":"b7a8fab0be459a7bdd1dc1a5aca7b6c073957e84","ref":"refs/heads/new-type","pushedAt":"2024-05-06T10:03:56.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Add extra test case\n\nSee https://github.com/phpstan/phpstan-src/pull/3050#issuecomment-2095611108","shortMessageHtmlLink":"Add extra test case"}},{"before":"e3bf4901ebb7c088040fec3172b15b4525d1932c","after":"5d26c54719ba0690886063af71caf03e8dc04d44","ref":"refs/heads/new-type","pushedAt":"2024-05-06T09:44:16.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Fix CS","shortMessageHtmlLink":"Fix CS"}},{"before":"17dc05e8e2df2897e5bf120a7bc31dfa52dc253c","after":"e3bf4901ebb7c088040fec3172b15b4525d1932c","ref":"refs/heads/new-type","pushedAt":"2024-05-06T09:41:43.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Done","shortMessageHtmlLink":"Done"}},{"before":"c1803e1d71530c78d45f90e28e66048f70344647","after":"17dc05e8e2df2897e5bf120a7bc31dfa52dc253c","ref":"refs/heads/new-type","pushedAt":"2024-05-06T09:25:22.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Fix","shortMessageHtmlLink":"Fix"}},{"before":null,"after":"c1803e1d71530c78d45f90e28e66048f70344647","ref":"refs/heads/new-type","pushedAt":"2024-05-06T09:14:29.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"},"commit":{"message":"Introduce `new` type\n\nThis makes it possible that a new instance of a class-string will be returned.\n\nFor example:\n```php\n/**\n * @template T of class-string\n * @param T $type\n *\n * @return new\n */\npublic static function get(string $type) : ?object\n{\n\treturn new $type;\n}\n```\n\nOr a more complex example:\n```php\n/**\n * @var array\n */\nprivate const TYPES = [\n\t'foo' => DateTime::class,\n\t'bar' => DateTimeImmutable::class,\n];\n\n/**\n * @template T of key-of\n * @param T $type\n *\n * @return new\n */\npublic static function get(string $type) : ?object\n{\n\t$class = self::TYPES[$type];\n\treturn new $class('now');\n}\n```\n\nSee https://github.com/phpstan/phpstan/issues/9704\n\nThe work was done by @rvanvelzen in a gist. I just created the PR for it.\n\nCo-Authored-By: Richard van Velzen ","shortMessageHtmlLink":"Introduce new type"}},{"before":"fd970760fcd8c5b938e583f69a4f6b14ec5ae173","after":null,"ref":"refs/heads/keep-on-single-line","pushedAt":"2023-03-13T12:28:33.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"ruudk","name":"Ruud Kamphuis","path":"/ruudk","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/104180?s=80&v=4"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEQoOoTAA","startCursor":null,"endCursor":null}},"title":"Activity ยท ruudk/phpstan-src"}