Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate option setters and getters in Hostname #299

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,18 @@
</PropertyNotSetInConstructor>
</file>
<file src="src/Hostname.php">
<DeprecatedMethod>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[getIdnCheck]]></code>
<code><![CDATA[getIpValidator]]></code>
<code><![CDATA[getIpValidator]]></code>
<code><![CDATA[getTldCheck]]></code>
</DeprecatedMethod>
<DocblockTypeContradiction>
<code><![CDATA[is_array($options)]]></code>
<code><![CDATA[is_string($value)]]></code>
Expand Down Expand Up @@ -2473,6 +2485,10 @@
</PossiblyUnusedMethod>
</file>
<file src="test/EmailAddressTest.php">
<DeprecatedMethod>
<code><![CDATA[useIdnCheck]]></code>
<code><![CDATA[useTldCheck]]></code>
</DeprecatedMethod>
<InvalidArgument>
<code><![CDATA[Hostname::ALLOW_ALL]]></code>
<code><![CDATA[Hostname::ALLOW_ALL]]></code>
Expand Down Expand Up @@ -2839,6 +2855,11 @@
</PossiblyUnusedMethod>
</file>
<file src="test/HostnameTest.php">
<DeprecatedMethod>
<code><![CDATA[getAllow]]></code>
<code><![CDATA[useIdnCheck]]></code>
<code><![CDATA[useTldCheck]]></code>
</DeprecatedMethod>
<InvalidArgument>
<code><![CDATA[$option]]></code>
<code><![CDATA[$option]]></code>
Expand Down
22 changes: 19 additions & 3 deletions src/Hostname.php
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,8 @@ public function __construct($options = [])
/**
* Returns the set ip validator
*
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @return Ip
*/
public function getIpValidator()
Expand All @@ -1841,6 +1843,8 @@ public function getIpValidator()
}

/**
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @param Ip $ipValidator OPTIONAL
* @return self
*/
Expand All @@ -1857,6 +1861,8 @@ public function setIpValidator(?Ip $ipValidator = null)
/**
* Returns the allow option
*
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @return int
*/
public function getAllow()
Expand All @@ -1867,7 +1873,9 @@ public function getAllow()
/**
* Sets the allow option
*
* @param int $allow
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @param int $allow
* @return $this Provides a fluent interface
*/
public function setAllow($allow)
Expand All @@ -1879,6 +1887,8 @@ public function setAllow($allow)
/**
* Returns the set idn option
*
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @return bool
*/
public function getIdnCheck()
Expand All @@ -1891,7 +1901,9 @@ public function getIdnCheck()
*
* This only applies when DNS hostnames are validated
*
* @param bool $useIdnCheck Set to true to validate IDN domains
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @param bool $useIdnCheck Set to true to validate IDN domains
* @return $this
*/
public function useIdnCheck($useIdnCheck)
Expand All @@ -1903,6 +1915,8 @@ public function useIdnCheck($useIdnCheck)
/**
* Returns the set tld option
*
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @return bool
*/
public function getTldCheck()
Expand All @@ -1915,7 +1929,9 @@ public function getTldCheck()
*
* This only applies when DNS hostnames are validated
*
* @param bool $useTldCheck Set to true to validate TLD elements
* @deprecated Since 2.61.0 all options getters and setters will be removed in 3.0
*
* @param bool $useTldCheck Set to true to validate TLD elements
* @return $this
*/
public function useTldCheck($useTldCheck)
Expand Down