Skip to content

Commit

Permalink
#2283 - Review StringsManager class
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Oct 2, 2021
1 parent 7932a48 commit a4c4d88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
29 changes: 3 additions & 26 deletions Library/Backends/ZendEngine3/StringsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,19 @@
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Zephir\Backends\ZendEngine3;

use Zephir\StringsManager as BaseStringsManager;

use function Zephir\file_put_contents_ex;

/**
* Class StringsManager.
*
* Manages the concatenation keys for the extension and the interned strings
*/
class StringsManager extends BaseStringsManager
{
/**
* List of headers.
*
* @var array
*/
protected $concatKeys = [
'vv' => true,
'vs' => true,
'sv' => true,
];

/**
* Adds a concatenation combination to the manager.
*
Expand All @@ -45,10 +34,8 @@ public function addConcatKey($key)

/**
* Generates the concatenation code.
*
* @return array
*/
public function genConcatCode()
public function genConcatCode(): void
{
$code = '
#ifdef HAVE_CONFIG_H
Expand Down Expand Up @@ -209,14 +196,4 @@ public function genConcatCode()
file_put_contents_ex($contents, 'ext/kernel/concat.h');
file_put_contents_ex($code, 'ext/kernel/concat.c');
}

/**
* Obtains the existing concatenation keys.
*
* @return array
*/
public function getConcatKeys()
{
return $this->concatKeys;
}
}
4 changes: 2 additions & 2 deletions Library/StringsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function addConcatKey(string $key)
/**
* Generates the concatenation code.
*
* @return array
* @return void
*/
abstract public function genConcatCode(): array;
abstract public function genConcatCode(): void;

/**
* Obtains the existing concatenation keys.
Expand Down

0 comments on commit a4c4d88

Please sign in to comment.