Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
Replace xp::typeOf() with typeof()
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed May 20, 2017
1 parent 2933774 commit 6621f4b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Scriptlets for the XP Framework ChangeLog
========================================================================

## 8.4.6 / 2017-05-20

* Refactored code to use `typeof()` instead of `xp::typeOf()`, see
https://github.com/xp-framework/rfc/issues/323
(@thekid)

## 8.4.5 / 2017-03-17

* Merged pull request #22: Fix for global exception handling
Expand Down
9 changes: 5 additions & 4 deletions src/main/php/scriptlet/xml/XMLScriptletRequest.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace scriptlet\xml;

use scriptlet\HttpScriptletRequest;

use lang\IllegalArgumentException;

/**
* Wraps XML request
Expand Down Expand Up @@ -35,11 +35,12 @@ class XMLScriptletRequest extends HttpScriptletRequest {
/**
* Sets request's URL
*
* @param scriptlet.xml.XMLScriptletURL url
* @param scriptlet.xml.XMLScriptletURL $url
* @throws lang.IllegalArgumentException
*/
public function setURL(\scriptlet\HttpScriptletURL $url) {
if (!$url instanceof XMLScriptletURL) throw new \lang\IllegalArgumentException(
__METHOD__.' expects instanceof scriptlet.xml.XMLScriptletURL, '.\xp::typeof($url).' given.'
if (!$url instanceof XMLScriptletURL) throw new IllegalArgumentException(
'Expecting an scriptlet.xml.XMLScriptletURL, '.typeof($url)->getName().' given'
);

with ($this->url= $url); {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function toString() {
$this->wrapper ? nameof($this->wrapper) : '(null)'
);
foreach (array_keys($this->values[HVAL_PERSISTENT]) as $key) {
$s.= sprintf(" [%-20s] %s\n", $key, \xp::typeOf($this->values[$key]));
$s.= sprintf(" [%-20s] %s\n", $key, typeof($this->values[$key])->getName());
}
return $s.'}';
}
Expand Down

0 comments on commit 6621f4b

Please sign in to comment.