Skip to content

Commit 5828ae2

Browse files
authored
Merge pull request #2317 from zephir-lang/development
0.15.2
2 parents 643e639 + add0293 commit 5828ae2

11 files changed

+198
-203
lines changed

Diff for: CHANGELOG.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org).
66

77
## [Unreleased]
88

9+
## [0.15.2] - 2021-10-24
10+
### Fixed
11+
- Fixed output of `string` type INI in globals [#2312](https://github.com/zephir-lang/zephir/issues/2312)
12+
913
## [0.15.1] - 2021-10-08
1014
### Fixed
11-
- Fix support of `string` type in struct globals [#2308](https://github.com/zephir-lang/zephir/issues/2308)
15+
- Fixed support of `string` type in struct globals [#2308](https://github.com/zephir-lang/zephir/issues/2308)
1216

1317
## [0.15.0] - 2021-10-05
1418
### Added
@@ -557,7 +561,8 @@ and this project adheres to [Semantic Versioning](http://semver.org).
557561
[#1524](https://github.com/zephir-lang/zephir/issues/1524)
558562

559563

560-
[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.15.1...HEAD
564+
[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.15.2...HEAD
565+
[0.15.2]: https://github.com/zephir-lang/zephir/compare/0.15.1...0.15.2
561566
[0.15.1]: https://github.com/zephir-lang/zephir/compare/0.15.0...0.15.1
562567
[0.15.0]: https://github.com/zephir-lang/zephir/compare/0.14.0...0.15.0
563568
[0.14.0]: https://github.com/zephir-lang/zephir/compare/0.14.0-beta.3...0.14.0

Diff for: Library/AliasManager.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* This file is part of the Zephir.
75
*
@@ -11,11 +9,13 @@
119
* the LICENSE file that was distributed with this source code.
1210
*/
1311

12+
declare(strict_types=1);
13+
1414
namespace Zephir;
1515

16+
use function in_array;
17+
1618
/**
17-
* AliasManager.
18-
*
1919
* Manage aliases in a file
2020
*/
2121
final class AliasManager
@@ -117,7 +117,7 @@ public function isAliasPresentFor(string $className): bool
117117
{
118118
$extractAlias = $this->implicitAlias($className);
119119

120-
$isClassDeclared = \in_array($className, $this->aliases);
120+
$isClassDeclared = in_array($className, $this->aliases);
121121
$classAlias = array_flip($this->aliases)[$className] ?? null;
122122

123123
return $isClassDeclared && $classAlias !== $extractAlias;

Diff for: Library/ArgInfoDefinition.php

-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ class ArgInfoDefinition
5656
private bool $richFormat = true;
5757

5858
/**
59-
* ArgInfoDefinition constructor.
60-
*
6159
* @param string $name
6260
* @param ClassMethod $functionLike
6361
* @param CodePrinter $codePrinter

Diff for: Library/BranchGraph.php

+8-11
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,27 @@
99
* the LICENSE file that was distributed with this source code.
1010
*/
1111

12+
declare(strict_types=1);
13+
1214
namespace Zephir;
1315

1416
/**
15-
* BranchGraph.
16-
*
1717
* Represents a group of branch nodes
1818
*/
1919
class BranchGraph
2020
{
21-
protected $root;
21+
protected ?BranchGraphNode $root = null;
2222

23-
protected $branchMap;
23+
protected array $branchMap = [];
2424

2525
/**
2626
* Adds a leaf to the branch tree.
2727
*
2828
* @param Branch $branch
2929
*/
30-
public function addLeaf(Branch $branch)
30+
public function addLeaf(Branch $branch): void
3131
{
32-
if (isset($this->branchMap[$branch->getUniqueId()])) {
33-
$branchNode = $this->branchMap[$branch->getUniqueId()];
34-
} else {
35-
$branchNode = new BranchGraphNode($branch);
36-
}
32+
$branchNode = $this->branchMap[$branch->getUniqueId()] ?? new BranchGraphNode($branch);
3733
$branchNode->increase();
3834

3935
$tempBranch = $branch->getParentBranch();
@@ -44,6 +40,7 @@ public function addLeaf(Branch $branch)
4440
$parentBranchNode = new BranchGraphNode($tempBranch);
4541
$this->branchMap[$tempBranch->getUniqueId()] = $parentBranchNode;
4642
}
43+
4744
$parentBranchNode->insert($branchNode);
4845
$branchNode = $parentBranchNode;
4946
$tempBranch = $tempBranch->getParentBranch();
@@ -58,7 +55,7 @@ public function addLeaf(Branch $branch)
5855
*
5956
* @return BranchGraphNode
6057
*/
61-
public function getRoot()
58+
public function getRoot(): BranchGraphNode
6259
{
6360
return $this->root;
6461
}

Diff for: Library/Code/Builder/Struct.php

+11
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ public function getInitEntry(string $name, array $global, string $namespace): st
171171
$namespace.
172172
'_globals, '.
173173
$namespace.'_globals)';
174+
175+
case 'string':
176+
return sprintf(
177+
'STD_PHP_INI_ENTRY(%s, %s, %s, NULL, %s, %s, %s)',
178+
'"'.$iniName.'"',
179+
'"'.$global['default'].'"',
180+
$scope,
181+
$structName,
182+
'zend_'.$namespace.'_globals',
183+
$namespace.'_globals',
184+
);
174185
}
175186

176187
return '';

Diff for: Library/CodePrinter.php

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
namespace Zephir;
1515

1616
/**
17-
* CodePrinter.
18-
*
1917
* Buffers code, making it look pretty
2018
*/
2119
class CodePrinter

0 commit comments

Comments
 (0)