diff --git a/Sieve.php b/Sieve.php index 57dac39..e7237bc 100644 --- a/Sieve.php +++ b/Sieve.php @@ -94,7 +94,7 @@ class Net_Sieve * * @var array */ - var $supportedAuthMethods = array( + var $supportedAuthMethods = [ 'DIGEST-MD5', 'CRAM-MD5', 'EXTERNAL', @@ -103,14 +103,14 @@ class Net_Sieve 'GSSAPI', 'XOAUTH2', 'OAUTHBEARER' - ); + ]; /** * SASL authentication methods that require Auth_SASL. * * @var array */ - var $supportedSASLAuthMethods = array('DIGEST-MD5', 'CRAM-MD5'); + var $supportedSASLAuthMethods = ['DIGEST-MD5', 'CRAM-MD5']; /** * The socket handle. @@ -131,7 +131,7 @@ class Net_Sieve * * @var array */ - var $_capability = array(); + var $_capability = []; /** * Current state of the connection. @@ -1055,7 +1055,7 @@ function _cmdListScripts() return $res; } - $scripts = array(); + $scripts = []; $activescript = null; $res = explode("\r\n", $res); foreach ($res as $value) { @@ -1068,7 +1068,7 @@ function _cmdListScripts() } } - return array($scripts, $activescript); + return [$scripts, $activescript]; } /** @@ -1157,7 +1157,7 @@ function _cmdCapability() function _parseCapability($data) { // Clear the cached capabilities. - $this->_capability = array('sasl' => array(), 'extensions' => array()); + $this->_capability = ['sasl' => [], 'extensions' => []]; $data = preg_split('/\r?\n/', $this->_toUpper($data), -1, PREG_SPLIT_NO_EMPTY); @@ -1535,7 +1535,7 @@ function _debug($message) { if ($this->_debug) { if ($this->_debug_handler) { - call_user_func_array($this->_debug_handler, array(&$this, $message)); + call_user_func_array($this->_debug_handler, [$this, $message]); } else { echo "$message\n"; } diff --git a/composer.json b/composer.json index f4e8af7..2737856 100644 --- a/composer.json +++ b/composer.json @@ -40,6 +40,7 @@ }, "type": "library", "require": { + "php": ">=5.6.0", "pear/pear-core-minimal": "~1.10", "pear/net_socket": "~1.2" }, diff --git a/package.xml b/package.xml index 08e9ccd..aafedd1 100644 --- a/package.xml +++ b/package.xml @@ -65,7 +65,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> - 5.0.0 + 5.6.0 1.4.0b1 diff --git a/tests/SieveTest.php b/tests/SieveTest.php index 58e4bbe..ea7294c 100644 --- a/tests/SieveTest.php +++ b/tests/SieveTest.php @@ -67,19 +67,20 @@ protected function setUp(): void // Create a new instance of Net_Sieve. $this->_pear = new PEAR(); $this->fixture = new Net_Sieve(); - $this->scripts = array( + $this->scripts = [ 'test script1' => "require \"fileinto\";\r\nif header :contains \"From\" \"@cnba.uba.ar\" \r\n{fileinto \"INBOX.Test1\";}\r\nelse \r\n{fileinto \"INBOX\";}", 'test script2' => "require \"fileinto\";\r\nif header :contains \"From\" \"@cnba.uba.ar\" \r\n{fileinto \"INBOX.Test\";}\r\nelse \r\n{fileinto \"INBOX\";}", 'test"scriptäöü3' => "require \"vacation\";\nvacation\n:days 7\n:addresses [\"matthew@de-construct.com\"]\n:subject \"This is a test\"\n\"I'm on my holiday!\nsadfafs\";", - 'test script4' => file_get_contents(dirname(__FILE__) . '/largescript.siv')); + 'test script4' => file_get_contents(dirname(__FILE__) . '/largescript.siv'), + ]; } - + protected function tearDown(): void { // Delete the instance. unset($this->fixture); } - + protected function login() { $result = $this->fixture->connect(HOST, PORT);