Skip to content

Commit

Permalink
Merge pull request #2317 from zephir-lang/development
Browse files Browse the repository at this point in the history
0.15.2
  • Loading branch information
Jeckerson authored Oct 24, 2021
2 parents 643e639 + add0293 commit 5828ae2
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 203 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org).

## [Unreleased]

## [0.15.2] - 2021-10-24
### Fixed
- Fixed output of `string` type INI in globals [#2312](https://github.com/zephir-lang/zephir/issues/2312)

## [0.15.1] - 2021-10-08
### Fixed
- Fix support of `string` type in struct globals [#2308](https://github.com/zephir-lang/zephir/issues/2308)
- Fixed support of `string` type in struct globals [#2308](https://github.com/zephir-lang/zephir/issues/2308)

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


[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.15.1...HEAD
[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.15.2...HEAD
[0.15.2]: https://github.com/zephir-lang/zephir/compare/0.15.1...0.15.2
[0.15.1]: https://github.com/zephir-lang/zephir/compare/0.15.0...0.15.1
[0.15.0]: https://github.com/zephir-lang/zephir/compare/0.14.0...0.15.0
[0.14.0]: https://github.com/zephir-lang/zephir/compare/0.14.0-beta.3...0.14.0
Expand Down
10 changes: 5 additions & 5 deletions Library/AliasManager.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of the Zephir.
*
Expand All @@ -11,11 +9,13 @@
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Zephir;

use function in_array;

/**
* AliasManager.
*
* Manage aliases in a file
*/
final class AliasManager
Expand Down Expand Up @@ -117,7 +117,7 @@ public function isAliasPresentFor(string $className): bool
{
$extractAlias = $this->implicitAlias($className);

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

return $isClassDeclared && $classAlias !== $extractAlias;
Expand Down
2 changes: 0 additions & 2 deletions Library/ArgInfoDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class ArgInfoDefinition
private bool $richFormat = true;

/**
* ArgInfoDefinition constructor.
*
* @param string $name
* @param ClassMethod $functionLike
* @param CodePrinter $codePrinter
Expand Down
19 changes: 8 additions & 11 deletions Library/BranchGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,27 @@
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Zephir;

/**
* BranchGraph.
*
* Represents a group of branch nodes
*/
class BranchGraph
{
protected $root;
protected ?BranchGraphNode $root = null;

protected $branchMap;
protected array $branchMap = [];

/**
* Adds a leaf to the branch tree.
*
* @param Branch $branch
*/
public function addLeaf(Branch $branch)
public function addLeaf(Branch $branch): void
{
if (isset($this->branchMap[$branch->getUniqueId()])) {
$branchNode = $this->branchMap[$branch->getUniqueId()];
} else {
$branchNode = new BranchGraphNode($branch);
}
$branchNode = $this->branchMap[$branch->getUniqueId()] ?? new BranchGraphNode($branch);
$branchNode->increase();

$tempBranch = $branch->getParentBranch();
Expand All @@ -44,6 +40,7 @@ public function addLeaf(Branch $branch)
$parentBranchNode = new BranchGraphNode($tempBranch);
$this->branchMap[$tempBranch->getUniqueId()] = $parentBranchNode;
}

$parentBranchNode->insert($branchNode);
$branchNode = $parentBranchNode;
$tempBranch = $tempBranch->getParentBranch();
Expand All @@ -58,7 +55,7 @@ public function addLeaf(Branch $branch)
*
* @return BranchGraphNode
*/
public function getRoot()
public function getRoot(): BranchGraphNode
{
return $this->root;
}
Expand Down
11 changes: 11 additions & 0 deletions Library/Code/Builder/Struct.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,17 @@ public function getInitEntry(string $name, array $global, string $namespace): st
$namespace.
'_globals, '.
$namespace.'_globals)';

case 'string':
return sprintf(
'STD_PHP_INI_ENTRY(%s, %s, %s, NULL, %s, %s, %s)',
'"'.$iniName.'"',
'"'.$global['default'].'"',
$scope,
$structName,
'zend_'.$namespace.'_globals',
$namespace.'_globals',
);
}

return '';
Expand Down
2 changes: 0 additions & 2 deletions Library/CodePrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
namespace Zephir;

/**
* CodePrinter.
*
* Buffers code, making it look pretty
*/
class CodePrinter
Expand Down
Loading

0 comments on commit 5828ae2

Please sign in to comment.