\App\NetworkModule\EntitiesIPv4Address

IPv4 address entity

Summary

Methods
Properties
Constants
__construct()
fromMask()
fromPrefix()
getAddress()
getPrefix()
getMask()
toArray()
toString()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$address
$prefix
N/A

Properties

$address

$address : \Darsyn\IP\Version\IPv4

Type

\Darsyn\IP\Version\IPv4 — IPv4 address

$prefix

$prefix : int

Type

normal — IPv4 address prefix

Methods

__construct()

__construct(\Darsyn\IP\Version\IPv4  $address, int  $prefix) : mixed

IPv4 address entity constructor

Parameters

\Darsyn\IP\Version\IPv4 $address

IPv4 address

int $prefix

IPv4 address prefix

Returns

mixed

fromMask()

fromMask(string  $address, string  $mask) : \App\NetworkModule\Entities\IPv4Address

Creates a new IPv4 address entity from the address and the subnet mask

Parameters

string $address

IPv4 address

string $mask

IPv4 subnet mask

Returns

\App\NetworkModule\Entities\IPv4Address —

IPv4 address entity

fromPrefix()

fromPrefix(string  $string) : \App\NetworkModule\Entities\IPv4Address

Creates a new IPv4 address entity from the address with prefix

Parameters

string $string

IPv4 address with prefix

Returns

\App\NetworkModule\Entities\IPv4Address —

IPv4 address entity

getAddress()

getAddress() : \Darsyn\IP\Version\IPv4

Returns the IPv4 address

Returns

\Darsyn\IP\Version\IPv4 —

IPv4 address

getPrefix()

getPrefix() : int

Returns the IPv4 address prefix

Returns

int —

IPv4 address prefix

getMask()

getMask() : \Darsyn\IP\Version\IPv4

Returns the IPv4 address mask

Returns

\Darsyn\IP\Version\IPv4 —

IPv4 address mask

toArray()

toArray() : array<string,mixed>

Converts the IPv4 address entity to an array

Returns

array

IPv4 address entity in the array

toString()

toString() : string

COnverts the IPv4 address entity to a string

Returns

string —

IPv4 address with prefix