Skip to content

Commit f47ed35

Browse files
committed
Made Factory::make() static
1 parent c5c2abb commit f47ed35

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Entities/ChatMember/Factory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<?php
22

3-
43
namespace Longman\TelegramBot\Entities\ChatMember;
54

6-
75
use Longman\TelegramBot\Entities\Entity;
86
use Longman\TelegramBot\Exception\TelegramException;
97

108
class Factory extends \Longman\TelegramBot\Entities\Factory
119
{
12-
public function make(array $data, string $bot_username): Entity
10+
public static function make(array $data, string $bot_username): Entity
1311
{
1412
$type = [
1513
'creator' => ChatMemberOwner::class,

src/Entities/Factory.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<?php
22

3-
43
namespace Longman\TelegramBot\Entities;
54

6-
75
abstract class Factory
86
{
9-
abstract public function make(array $data, string $bot_username): Entity;
7+
abstract public static function make(array $data, string $bot_username): Entity;
108

119
public static function resolveEntityClass(string $class, array $property, string $bot_username = ''): Entity
1210
{
1311
if (is_subclass_of($class, Factory::class)) {
14-
return $class->make($property, $bot_username);
12+
return $class::make($property, $bot_username);
1513
}
1614

1715
return new $class($property, $bot_username);

0 commit comments

Comments
 (0)