Server IP : 104.21.14.48 / Your IP : 3.141.12.117 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wordpress-seo/vendor/yoast/whip/src/Messages/ |
Upload File : |
<?php namespace Yoast\WHIPv2\Messages; use Yoast\WHIPv2\Exceptions\EmptyProperty; use Yoast\WHIPv2\Exceptions\InvalidType; use Yoast\WHIPv2\Interfaces\Message; /** * Class BasicMessage. */ class BasicMessage implements Message { /** * Message body. * * @var string */ private $body; /** * Message constructor. * * @param string $body Message body. */ public function __construct( $body ) { $this->validateParameters( $body ); $this->body = $body; } /** * Retrieves the message body. * * @return string Message. */ public function body() { return $this->body; } /** * Validates the parameters passed to the constructor of this class. * * @param string $body Message body. * * @return void * * @throws EmptyProperty When the $body parameter is empty. * @throws InvalidType When the $body parameter is not of the expected type. */ private function validateParameters( $body ) { if ( empty( $body ) ) { throw new EmptyProperty( 'Message body' ); } if ( ! \is_string( $body ) ) { throw new InvalidType( 'Message body', $body, 'string' ); } } }