Skip to content

Commit

Permalink
Merge pull request phalcon#11 from zaets28rus/master
Browse files Browse the repository at this point in the history
refs #NA Some fixes
  • Loading branch information
Phalcon committed Oct 6, 2013
2 parents 580e731 + 95ff256 commit 3d3d134
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea/
.temp/
ext/Makefile.global
ext/acinclude.m4
Expand Down
2 changes: 1 addition & 1 deletion Library/ClassDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public function compile(CompilationContext $compilationContext)
foreach ($this->getProperties() as $property) {
$docBlock = $property->getDocBlock();
if ($docBlock) {
$codePrinter->outputDocBlock($docBlock);
$codePrinter->outputDocBlock($docBlock, false);
}
$property->compile($compilationContext);
}
Expand Down
13 changes: 10 additions & 3 deletions Library/CodePrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,22 @@ public function output($code)
/**
* Adds a comment to the output with indentation level
*
* @param string $docBlock
* @param $docblock
* @param bool $replaceTab
*/
public function outputDocBlock($docblock)
public function outputDocBlock($docblock, $replaceTab = true)
{
$code = '';
$docblock = '/' . $docblock . '/';

foreach (explode("\n", $docblock) as $line) {
$code .= preg_replace('/^[ \t]+/', ' ', $line) . PHP_EOL;
if ($replaceTab) {
$code .= preg_replace('/^[ \t]+/', ' ', $line) . PHP_EOL;
} else {
$code .= $line . PHP_EOL;
}
}

$this->_lastLine = $code;
$this->_code .= $code;
$this->_currentPrints++;
Expand Down
2 changes: 1 addition & 1 deletion Library/Statements/LetStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ public function assignDecr($variable, Variable $symbolVariable, CompilationConte
break;
case 'variable':

$dynamicType = $symbolVariable->getDynamicType();
$dynamicType = $symbolVariable->getDynamicTypes();

/**
* Variable is probably not initialized here
Expand Down

0 comments on commit 3d3d134

Please sign in to comment.