Skip to content

Commit b41bca4

Browse files
committed
Release v4.3.5
1 parent 5d3d4b2 commit b41bca4

24 files changed

+185
-124
lines changed

app/Config/App.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ class App extends BaseConfig
9494
* by the application in descending order of priority. If no match is
9595
* found, the first locale will be used.
9696
*
97+
* IncomingRequest::setLocale() also uses this list.
98+
*
9799
* @var string[]
98100
*/
99101
public array $supportedLocales = ['en'];

app/Config/Generators.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Generators extends BaseConfig
2727
*/
2828
public array $views = [
2929
'make:cell' => 'CodeIgniter\Commands\Generators\Views\cell.tpl.php',
30+
'make:cell_view' => 'CodeIgniter\Commands\Generators\Views\cell_view.tpl.php',
3031
'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php',
3132
'make:config' => 'CodeIgniter\Commands\Generators\Views\config.tpl.php',
3233
'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php',

system/API/ResponseTrait.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313

1414
use CodeIgniter\Format\FormatterInterface;
1515
use CodeIgniter\HTTP\IncomingRequest;
16-
use CodeIgniter\HTTP\RequestInterface;
1716
use CodeIgniter\HTTP\ResponseInterface;
1817
use Config\Services;
1918

2019
/**
2120
* Provides common, more readable, methods to provide
2221
* consistent HTTP responses under a variety of common
2322
* situations when working as an API.
24-
*
25-
* @property RequestInterface $request
26-
* @property ResponseInterface $response
2723
*/
2824
trait ResponseTrait
2925
{

system/CLI/GeneratorTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ protected function qualifyClassName(): string
235235
$component = singular($this->component);
236236

237237
/**
238-
* @see https://regex101.com/r/a5KNCR/1
238+
* @see https://regex101.com/r/a5KNCR/2
239239
*/
240-
$pattern = sprintf('/([a-z][a-z0-9_\/\\\\]+)(%s)/i', $component);
240+
$pattern = sprintf('/([a-z][a-z0-9_\/\\\\]+)(%s)$/i', $component);
241241

242242
if (preg_match($pattern, $class, $matches) === 1) {
243243
$class = $matches[1] . ucfirst($matches[2]);
244244
}
245245

246-
if ($this->enabledSuffixing && $this->getOption('suffix') && ! strripos($class, $component)) {
246+
if ($this->enabledSuffixing && $this->getOption('suffix') && preg_match($pattern, $class) !== 1) {
247247
$class .= ucfirst($component);
248248
}
249249

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CodeIgniter
4747
/**
4848
* The current version of CodeIgniter Framework
4949
*/
50-
public const CI_VERSION = '4.3.4';
50+
public const CI_VERSION = '4.3.5';
5151

5252
/**
5353
* App startup time.

system/Commands/Generators/CellGenerator.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class CellGenerator extends BaseCommand
6565
*/
6666
protected $options = [
6767
'--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
68-
'--suffix' => 'Append the component title to the class name (e.g. User => UserCell).',
6968
'--force' => 'Force overwrite existing file.',
7069
];
7170

@@ -74,27 +73,26 @@ class CellGenerator extends BaseCommand
7473
*/
7574
public function run(array $params)
7675
{
77-
// Generate the Class first
78-
$this->component = 'Cell';
79-
$this->directory = 'Cells';
76+
$this->component = 'Cell';
77+
$this->directory = 'Cells';
78+
79+
$params = array_merge($params, ['suffix' => null]);
80+
8081
$this->template = 'cell.tpl.php';
8182
$this->classNameLang = 'CLI.generator.className.cell';
82-
8383
$this->generateClass($params);
8484

85-
// Generate the View
85+
$this->name = 'make:cell_view';
86+
$this->template = 'cell_view.tpl.php';
8687
$this->classNameLang = 'CLI.generator.viewName.cell';
8788

88-
// Form the view name
89-
$segments = explode('\\', $this->qualifyClassName());
90-
91-
$view = array_pop($segments);
92-
$view = decamelize($view);
93-
$segments[] = $view;
94-
$view = implode('\\', $segments);
89+
$className = $this->qualifyClassName();
90+
$viewName = decamelize(class_basename($className));
91+
$viewName = preg_replace('/([a-z][a-z0-9_\/\\\\]+)(_cell)$/i', '$1', $viewName) ?? $viewName;
92+
$namespace = substr($className, 0, strrpos($className, '\\') + 1);
9593

96-
$this->template = 'cell_view.tpl.php';
94+
$this->generateView($namespace . $viewName, $params);
9795

98-
$this->generateView($view, $params);
96+
return 0;
9997
}
10098
}

system/Database/BaseConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
* @property bool $transFailure
4747
* @property bool $transStatus
4848
*
49-
* @template TConnection of object|resource
50-
* @template TResult of object|resource
49+
* @template TConnection
50+
* @template TResult
5151
*
5252
* @implements ConnectionInterface<TConnection, TResult>
5353
*/

system/Database/BasePreparedQuery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use ErrorException;
1919

2020
/**
21-
* @template TConnection of object|resource
22-
* @template TStatement of object|resource
23-
* @template TResult of object|resource
21+
* @template TConnection
22+
* @template TStatement
23+
* @template TResult
2424
*
2525
* @implements PreparedQueryInterface<TConnection, TStatement, TResult>
2626
*/

system/Database/BaseResult.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
use stdClass;
1616

1717
/**
18-
* @template TConnection of object|resource
19-
* @template TResult of object|resource
18+
* @template TConnection
19+
* @template TResult
2020
*
2121
* @implements ResultInterface<TConnection, TResult>
2222
*/
@@ -499,6 +499,8 @@ abstract public function getFieldData(): array;
499499

500500
/**
501501
* Frees the current result.
502+
*
503+
* @return void
502504
*/
503505
abstract public function freeResult();
504506

@@ -525,7 +527,7 @@ abstract protected function fetchAssoc();
525527
*
526528
* Overridden by child classes.
527529
*
528-
* @return object
530+
* @return Entity|false|object|stdClass
529531
*/
530532
abstract protected function fetchObject(string $className = 'stdClass');
531533
}

system/Database/ConnectionInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace CodeIgniter\Database;
1313

1414
/**
15-
* @template TConnection of object|resource
16-
* @template TResult of object|resource
15+
* @template TConnection
16+
* @template TResult
1717
*/
1818
interface ConnectionInterface
1919
{

system/Database/MySQLi/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function getFieldData(): array
103103

104104
/**
105105
* Frees the current result.
106+
*
107+
* @return void
106108
*/
107109
public function freeResult()
108110
{

system/Database/OCI8/Result.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use CodeIgniter\Database\BaseResult;
1515
use CodeIgniter\Entity\Entity;
16+
use stdClass;
1617

1718
/**
1819
* Result for OCI8

system/Database/Postgre/Connection.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,16 @@ public function getVersion(): string
128128
return $this->dataCache['version'];
129129
}
130130

131-
if (! $this->connID || ($pgVersion = pg_version($this->connID)) === false) {
131+
if (! $this->connID) {
132132
$this->initialize();
133133
}
134134

135-
return isset($pgVersion['server']) ? $this->dataCache['version'] = $pgVersion['server'] : false;
135+
$pgVersion = pg_version($this->connID);
136+
$this->dataCache['version'] = isset($pgVersion['server']) ?
137+
(preg_match('/^(\d+\.\d+)/', $pgVersion['server'], $matches) ? $matches[1] : '') :
138+
'';
139+
140+
return $this->dataCache['version'];
136141
}
137142

138143
/**

system/Database/Postgre/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ public function getFieldData(): array
6969

7070
/**
7171
* Frees the current result.
72+
*
73+
* @return void
7274
*/
7375
public function freeResult()
7476
{

system/Database/PreparedQueryInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use BadMethodCallException;
1515

1616
/**
17-
* @template TConnection of object|resource
18-
* @template TStatement of object|resource
19-
* @template TResult of object|resource
17+
* @template TConnection
18+
* @template TStatement
19+
* @template TResult
2020
*/
2121
interface PreparedQueryInterface
2222
{

system/Database/ResultInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use stdClass;
1515

1616
/**
17-
* @template TConnection of object|resource
18-
* @template TResult of object|resource
17+
* @template TConnection
18+
* @template TResult
1919
*/
2020
interface ResultInterface
2121
{

system/Database/SQLSRV/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public function getFieldData(): array
103103

104104
/**
105105
* Frees the current result.
106+
*
107+
* @return void
106108
*/
107109
public function freeResult()
108110
{

system/Database/SQLite3/Result.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public function getFieldData(): array
8080

8181
/**
8282
* Frees the current result.
83+
*
84+
* @return void
8385
*/
8486
public function freeResult()
8587
{

0 commit comments

Comments
 (0)