$this->expires = strtotime( $attr['expires'] );
}
- if ( isset( $attr['path'] ) ) {
- $this->path = $attr['path'];
- } else {
- $this->path = '/';
- }
+ $this->path = $attr['path'] ?? '/';
if ( isset( $attr['domain'] ) ) {
if ( self::validateCookieDomain( $attr['domain'] ) ) {
* not a big problem in practice, but there are test cases)
*
* @param string $domain The domain to validate
- * @param string $originDomain (optional) the domain the cookie originates from
+ * @param string|null $originDomain (optional) the domain the cookie originates from
* @return bool
*/
public static function validateCookieDomain( $domain, $originDomain = null ) {