Skip to content

Commit

Permalink
PHP 8.2 compatibility: Can't use null where strings are expected.
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Nov 30, 2022
1 parent a970993 commit 3696b25
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.3.2 - Wednesday 30 November 2022
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- PHP 8.2 compatibility: Can't use null where strings are expected.


1.3.1 - Thursday 27 February 2019
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
13 changes: 8 additions & 5 deletions src/url.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -103,7 +103,7 @@
*
* $url = new ezcUrl( 'http://www.example.com/mydir/shop/index.php/order/Software/PHP/Version/5.2/Extension/XDebug/Extension/openssl', $urlCfg );
*
* $params = $url->getParams(); // will be array( 'Software', 'PHP', 'Version', '5.2', 'Extension', 'XDebug', 'Extension', 'openssl' )
* $params = $url->getParams(); // will be array( 'Software', 'PHP', 'Version', '5.2', 'Extension', 'XDebug', 'Extension', 'openssl' )
* </code>
*
* @property string $host
Expand Down Expand Up @@ -157,7 +157,10 @@ class ezcUrl
*/
public function __construct( $url = null, ezcUrlConfiguration $configuration = null )
{
$this->parseUrl( $url );
if ( $url !== null )
{
$this->parseUrl( $url );
}
$this->configuration = $configuration;
if ( $configuration != null )
{
Expand Down Expand Up @@ -767,7 +770,7 @@ public function setParam( $name, $value )
{
$this->properties['uparams'][$name] = array();
}

if ( is_array( $value ) )
{
$multiple = false;
Expand Down
10 changes: 6 additions & 4 deletions src/url_configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -176,8 +176,8 @@ class ezcUrlConfiguration
*/
public function __construct()
{
$this->basedir = null;
$this->script = null;
$this->basedir = '';
$this->script = '';
$this->unorderedDelimiters = array( '(', ')' );
$this->orderedParameters = array();
$this->unorderedParameters = array();
Expand Down Expand Up @@ -262,6 +262,8 @@ public function __isset( $name )
{
case 'basedir':
case 'script':
return isset( $this->properties[$name] ) && $this->properties[$name] != '';

case 'unorderedDelimiters':
case 'orderedParameters':
case 'unorderedParameters':
Expand Down
4 changes: 2 additions & 2 deletions tests/url_configuration_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down

0 comments on commit 3696b25

Please sign in to comment.