| 1 |
<?php |
| 2 |
/** |
| 3 |
* Factory class for creating instances of Known_Bots with predefined bot providers. |
| 4 |
* |
| 5 |
* @package WP_Defender\Component\Known_Bots |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WP_Defender\Component\Known_Bots; |
| 9 |
|
| 10 |
use WP_Defender\Component\Known_Bots\Bots\Google_Bot; |
| 11 |
use WP_Defender\Component\Known_Bots\Bots\Bing_Bot; |
| 12 |
|
| 13 |
/** |
| 14 |
* Factory class to create a Known_Bots instance with predefined bot providers. |
| 15 |
* |
| 16 |
* This class encapsulates the creation logic for Known_Bots, allowing for easy instantiation |
| 17 |
* with a set of known bot providers. |
| 18 |
*/ |
| 19 |
class Known_Bots_Factory { |
| 20 |
/** |
| 21 |
* Creates an instance of Known_Bots with predefined bot providers. |
| 22 |
* |
| 23 |
* @return Known_Bots An instance of Known_Bots containing Google_Bot and Bing_Bot. |
| 24 |
*/ |
| 25 |
public static function create(): Known_Bots { |
| 26 |
return new Known_Bots( |
| 27 |
array( |
| 28 |
new Google_Bot(), |
| 29 |
new Bing_Bot(), |
| 30 |
) |
| 31 |
); |
| 32 |
} |
| 33 |
} |
| 34 |
|