Skip to content

Commit faca206

Browse files
committed
Fixed some issues
- Fixed "raise" error in DomException - Fixed App::VERSION - Fixed description in requirements.php - Packages::version and Helper::parseVersion returns NULL if package is not available
1 parent 3ec3a48 commit faca206

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/Experimental/Dom/Document.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,12 @@ private function enableRestoreInternal($enable)
376376
}
377377
}
378378

379-
private function raise($level)
379+
private function raise($debuglvl)
380380
{
381381
$err = \libxml_get_errors();
382382

383-
if (isset($err[0]->level) && in_array($level, $this->levels, true)) {
384-
throw new DomException(null, $level);
383+
if (isset($err[0]->level) && in_array($err[0]->level, $this->levels, true)) {
384+
throw new DomException(null, $debuglvl);
385385
}
386386

387387
\libxml_clear_errors();

src/Inphinit/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class App
1717
{
1818
/** Inphinit framework version */
19-
const VERSION = '0.2.0';
19+
const VERSION = '0.4.2';
2020

2121
private static $events = array();
2222
private static $configs = array();

src/Inphinit/Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Helper
1515
* Parse version format
1616
*
1717
* @param string $version
18-
* @return array|bool
18+
* @return stdClass|null
1919
*/
2020
public static function parseVersion($version)
2121
{
@@ -28,7 +28,7 @@ public static function parseVersion($version)
2828
);
2929
}
3030

31-
return false;
31+
return null;
3232
}
3333

3434
/**

src/Inphinit/Packages.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,18 @@ private static function relativePath($path)
220220
* Get package version from composer.lock file
221221
*
222222
* @param string $name set package for detect version
223-
* @return bool|string
223+
* @return string|null
224224
*/
225225
public static function version($name)
226226
{
227227
$file = INPHINIT_ROOT . 'composer.lock';
228228
$data = is_file($file) ? json_decode(file_get_contents($file)) : false;
229229

230230
if (empty($data->packages)) {
231-
return false;
231+
return null;
232232
}
233233

234-
$version = false;
234+
$version = null;
235235

236236
foreach ($data->packages as $package) {
237237
if ($package->name === $name) {

src/requirements.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function ini_enabled($key)
4444
}
4545

4646
if (!function_exists('finfo_file')) {
47-
$error[] = 'Class Inphinit\Files (mimeType method) not work, ' .
47+
$error[] = 'Class Inphinit\File::mime method not work, ' .
4848
'"finfo" is disabled in php (if needed for you)';
4949
}
5050

0 commit comments

Comments
 (0)