Skip to content

Commit 8c6b676

Browse files
committed
Version 0.4.5
- Improved Inphinit\Experimental\Dir class to extended classes - Removed unused "use"s - New method: Inphinit\Helper::ksort (sort multidimensional arrays by keys) - Fixed Inphinit\Http\Request::raw() method for old PHP versions - Fixed Inphinit\Http\Response::removeHeader() method for dispatched headers - Improved Inphinit\Uri::canonquery
1 parent 19f0e97 commit 8c6b676

File tree

12 files changed

+32
-19
lines changed

12 files changed

+32
-19
lines changed

src/Experimental/Dir.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
namespace Inphinit\Experimental;
1111

12-
use Inphinit\File;
13-
1412
class Dir implements \IteratorAggregate
1513
{
1614
private $iterator;
@@ -85,7 +83,7 @@ public function getIterator()
8583
*/
8684
public static function root()
8785
{
88-
return new self(INPHINIT_ROOT);
86+
return new static(INPHINIT_ROOT);
8987
}
9088

9189
/**
@@ -95,7 +93,7 @@ public static function root()
9593
*/
9694
public static function storage()
9795
{
98-
return new self(INPHINIT_PATH . 'storage/');
96+
return new static(INPHINIT_PATH . 'storage/');
9997
}
10098

10199
/**
@@ -105,7 +103,7 @@ public static function storage()
105103
*/
106104
public static function application()
107105
{
108-
return new self(INPHINIT_PATH . 'application/');
106+
return new static(INPHINIT_PATH . 'application/');
109107
}
110108

111109
public function __destruct()

src/Experimental/Maintenance.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace Inphinit\Experimental;
1111

1212
use Inphinit\App;
13-
use Inphinit\Storage;
1413

1514
class Maintenance
1615
{

src/Experimental/Routing/Group.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace Inphinit\Experimental\Routing;
1111

12-
use Inphinit\App;
1312
use Inphinit\Regex;
1413
use Inphinit\Http\Request;
1514
use Inphinit\Routing\Router;

src/Experimental/Routing/Quick.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace Inphinit\Experimental\Routing;
1111

12-
use Inphinit\App;
1312
use Inphinit\Routing\Route;
1413
use Inphinit\Routing\Router;
1514
use Inphinit\Experimental\Exception;

src/Experimental/Routing/Redirector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace Inphinit\Experimental\Routing;
1111

12-
use Inphinit\Uri;
1312
use Inphinit\Regex;
1413
use Inphinit\Experimental\Exception;
1514
use Inphinit\Experimental\Http\Redirect;

src/Experimental/Routing/Rest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace Inphinit\Experimental\Routing;
1111

12-
use Inphinit\App;
1312
use Inphinit\Routing\Route;
1413
use Inphinit\Routing\Router;
1514
use Inphinit\Experimental\Exception;

src/Experimental/Session.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace Inphinit\Experimental;
1111

1212
use Inphinit\Storage;
13-
use Inphinit\Http\Response;
1413

1514
class Session implements \IteratorAggregate
1615
{

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.4.4';
19+
const VERSION = '0.4.5';
2020

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

src/Inphinit/Helper.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,22 @@ public static function assoc($array)
116116
{
117117
return false === self::seq($array);
118118
}
119+
120+
/**
121+
* Check if array is associative, like [ 'bar' => foo', 'baz' => 'bar']
122+
*
123+
* @param array $array
124+
* @param int $flags See details in https://www.php.net/manual/en/function.sort.php#refsect1-function.sort-parameters
125+
* @return null
126+
*/
127+
public static function ksort(array &$array, $flags = \SORT_REGULAR)
128+
{
129+
foreach ($array as &$item) {
130+
if (is_array($item)) {
131+
self::ksort($item, $flags);
132+
}
133+
}
134+
135+
ksort($array, $flags);
136+
}
119137
}

src/Inphinit/Http/Request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Inphinit\Http;
1111

1212
use Inphinit\Helper;
13+
use Inphinit\Storage;
1314

1415
class Request
1516
{

0 commit comments

Comments
 (0)