Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

cs fixes for Zend\Code #7048

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions library/Zend/Code/Generator/FileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,12 @@ public function generate()
if ($namespace) {
$namespace = sprintf('namespace %s;%s', $namespace, str_repeat(self::LINE_FEED, 2));
if (preg_match('#/\* Zend_Code_Generator_FileGenerator-NamespaceMarker \*/#m', $output)) {
$output = preg_replace('#/\* Zend_Code_Generator_FileGenerator-NamespaceMarker \*/#m', $namespace,
$output, 1);
$output = preg_replace(
'#/\* Zend_Code_Generator_FileGenerator-NamespaceMarker \*/#m',
$namespace,
$output,
1
);
} else {
$output .= $namespace;
}
Expand Down Expand Up @@ -505,8 +509,12 @@ public function generate()
$useOutput .= self::LINE_FEED;

if (preg_match('#/\* Zend_Code_Generator_FileGenerator-UseMarker \*/#m', $output)) {
$output = preg_replace('#/\* Zend_Code_Generator_FileGenerator-UseMarker \*/#m', $useOutput,
$output, 1);
$output = preg_replace(
'#/\* Zend_Code_Generator_FileGenerator-UseMarker \*/#m',
$useOutput,
$output,
1
);
} else {
$output .= $useOutput;
}
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Code/Generator/ValueGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class ValueGenerator extends AbstractGenerator
*/
public function __construct($value = null, $type = self::TYPE_AUTO, $outputMode = self::OUTPUT_MULTIPLE_LINE, ArrayObject $constants = null)
{
if ($value !== null) { // strict check is important here if $type = AUTO
// strict check is important here if $type = AUTO
if ($value !== null) {
$this->setValue($value);
}
if ($type !== self::TYPE_AUTO) {
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Code/Reflection/MethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function getBody()
* @param bool $bodyOnly
* @return string
*/
protected function extractMethodContents($bodyOnly=false)
protected function extractMethodContents($bodyOnly = false)
{
$fileName = $this->getDeclaringClass()->getFileName();

Expand Down Expand Up @@ -438,7 +438,7 @@ protected function isValidFunction($haystack, $position, $functionName = null)
{
$isValid = false;
$count = count($haystack);
for ($i = $position+1;$i < $count; $i++) {
for ($i = $position+1; $i < $count; $i++) {
$tokenType = (is_array($haystack[$i])) ? token_name($haystack[$i][0]) : $haystack[$i];
$tokenValue = (is_array($haystack[$i])) ? $haystack[$i][1] : $haystack[$i];

Expand Down