PHP Class Spatie\Crawler\Url

Show file Open project: spatie/crawler Class Usage Examples

Public Properties

Property Type Description
$host null | string
$path null | string
$port integer
$query null | string
$scheme null | string

Public Methods

Method Description
__construct ( $url ) Url constructor.
__construct ( string $url )
__toString ( ) : string
create ( $url ) : static
create ( string $url ) : static
hasCrawlableScheme ( ) : boolean
isEmailUrl ( ) : boolean Determine if this is a mailto-link.
isEqual ( Url $otherUrl ) : boolean
isJavascript ( ) : boolean Determine if this is an inline javascript.
isProtocolIndependent ( ) : boolean
isRelative ( ) : boolean
isTelUrl ( ) : boolean Determine if this is a tel-link.
path ( ) : null | string
removeFragment ( )
segment ( integer $index ) : string | null
segments ( integer $index = null ) : array | null | string
segments ( integer | null $index = null ) : array | null | string
setHost ( string $host )
setPort ( integer $port )
setScheme ( string $scheme )
startsWith ( string | null $haystack, string | array $needles ) : boolean

Method Details

__construct() public method

Url constructor.
public __construct ( $url )
$url

__construct() public method

public __construct ( string $url )
$url string

__toString() public method

public __toString ( ) : string
return string

create() public static method

public static create ( $url ) : static
$url
return static

create() public static method

public static create ( string $url ) : static
$url string
return static

hasCrawlableScheme() public method

public hasCrawlableScheme ( ) : boolean
return boolean

isEmailUrl() public method

Determine if this is a mailto-link.
public isEmailUrl ( ) : boolean
return boolean

isEqual() public method

public isEqual ( Url $otherUrl ) : boolean
$otherUrl Url
return boolean

isJavascript() public method

Determine if this is an inline javascript.
public isJavascript ( ) : boolean
return boolean

isProtocolIndependent() public method

public isProtocolIndependent ( ) : boolean
return boolean

isRelative() public method

public isRelative ( ) : boolean
return boolean

isTelUrl() public method

Determine if this is a tel-link.
public isTelUrl ( ) : boolean
return boolean

path() public method

public path ( ) : null | string
return null | string

removeFragment() public method

public removeFragment ( )

segment() public method

public segment ( integer $index ) : string | null
$index integer
return string | null

segments() public method

public segments ( integer $index = null ) : array | null | string
$index integer
return array | null | string

segments() public method

public segments ( integer | null $index = null ) : array | null | string
$index integer | null
return array | null | string

setHost() public method

public setHost ( string $host )
$host string

setPort() public method

public setPort ( integer $port )
$port integer

setScheme() public method

public setScheme ( string $scheme )
$scheme string

startsWith() public method

public startsWith ( string | null $haystack, string | array $needles ) : boolean
$haystack string | null
$needles string | array
return boolean

Property Details

$host public property

public null|string $host
return null | string

$path public property

public null|string $path
return null | string

$port public property

public int $port
return integer

$query public property

public null|string $query
return null | string

$scheme public property

public null|string $scheme
return null | string