"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "build/controllers/PhpDocController.php" between
yii2-2.0.36.tar.gz and yii2-2.0.37.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

PhpDocController.php  (yii2-2.0.36):PhpDocController.php  (yii2-2.0.37)
skipping to change at line 506 skipping to change at line 506
return $result; return $result;
} }
protected function checkPropertyOrder($lineInfo) protected function checkPropertyOrder($lineInfo)
{ {
// TODO // TODO
} }
protected function updateClassPropertyDocs($file, $className, $propertyDoc) protected function updateClassPropertyDocs($file, $className, $propertyDoc)
{ {
if ($this->shouldSkipClass($className)) {
$this->stderr("[INFO] Skipping class $className.\n", Console::FG_BLU
E, Console::BOLD);
return false;
}
try { try {
$ref = new \ReflectionClass($className); $ref = new \ReflectionClass($className);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->stderr("[ERR] Unable to create ReflectionClass for class '$cl assName': " . $e->getMessage() . "\n", Console::FG_RED); $this->stderr("[ERR] Unable to create ReflectionClass for class '$cl assName': " . $e->getMessage() . "\n", Console::FG_RED);
return false; return false;
} catch (\Error $e) {
$this->stderr("[ERR] Unable to create ReflectionClass for class '$cl
assName': " . $e->getMessage() . "\n", Console::FG_RED);
return false;
} }
if ($ref->getFileName() != $file) { if ($ref->getFileName() != $file) {
$this->stderr("[ERR] Unable to create ReflectionClass for class: $cl assName loaded class is not from file: $file\n", Console::FG_RED); $this->stderr("[ERR] Unable to create ReflectionClass for class: $cl assName loaded class is not from file: $file\n", Console::FG_RED);
return false; return false;
} }
if ($this->isBaseObject($className, $ref)) { if ($this->isBaseObject($className, $ref)) {
$this->stderr("[INFO] Skipping class $className as it is not a subcl ass of yii\\base\\BaseObject.\n", Console::FG_BLUE, Console::BOLD); $this->stderr("[INFO] Skipping class $className as it is not a subcl ass of yii\\base\\BaseObject.\n", Console::FG_BLUE, Console::BOLD);
return false; return false;
} }
skipping to change at line 656 skipping to change at line 664
{ {
$phpdoc = ''; $phpdoc = '';
$file = str_replace("\r", '', str_replace("\t", ' ', file_get_contents($ fileName, true))); $file = str_replace("\r", '', str_replace("\t", ' ', file_get_contents($ fileName, true)));
$ns = $this->match('#\nnamespace (?<name>[\w\\\\]+);\n#', $file); $ns = $this->match('#\nnamespace (?<name>[\w\\\\]+);\n#', $file);
$namespace = reset($ns); $namespace = reset($ns);
if ($namespace === false) { if ($namespace === false) {
$namespace = '\\'; $namespace = '\\';
} else { } else {
$namespace = $namespace['name']; $namespace = $namespace['name'];
} }
$classes = $this->match('#\n(?:abstract )(?:final )?class (?<name>\w+)( extends .+)?( implements .+)?\n\{(?<content>.*)\n\}(\n|$)#', $file); $classes = $this->match('#\n(?:abstract )?(?:final )?class (?<name>\w+)( extends .+)?( implements .+)?\n\{(?<content>.*)\n\}(\n|$)#', $file);
if (\count($classes) > 1) { if (\count($classes) > 1) {
$this->stderr("[ERR] There should be only one class in a file: $file Name\n", Console::FG_RED); $this->stderr("[ERR] There should be only one class in a file: $file Name\n", Console::FG_RED);
return false; return false;
} }
if (\count($classes) < 1) { if (\count($classes) < 1) {
$interfaces = $this->match('#\ninterface (?<name>\w+)( extends .+)?\ n\{(?<content>.*)\n\}(\n|$)#', $file); $interfaces = $this->match('#\ninterface (?<name>\w+)( extends .+)?\ n\{(?<content>.*)\n\}(\n|$)#', $file);
if (\count($interfaces) == 1) { if (\count($interfaces) == 1) {
return false; return false;
skipping to change at line 857 skipping to change at line 865
* @return bool * @return bool
*/ */
protected function isBaseObject($className, \ReflectionClass $ref) protected function isBaseObject($className, \ReflectionClass $ref)
{ {
$isDepreceatedObject = false; $isDepreceatedObject = false;
if (PHP_VERSION_ID <= 70100) { if (PHP_VERSION_ID <= 70100) {
$isDepreceatedObject = $ref->isSubclassOf('yii\base\Object') || $cla ssName === 'yii\base\Object'; $isDepreceatedObject = $ref->isSubclassOf('yii\base\Object') || $cla ssName === 'yii\base\Object';
} }
return !$isDepreceatedObject && !$ref->isSubclassOf('yii\base\BaseObject ') && $className !== 'yii\base\BaseObject'; return !$isDepreceatedObject && !$ref->isSubclassOf('yii\base\BaseObject ') && $className !== 'yii\base\BaseObject';
} }
private function shouldSkipClass($className)
{
if (PHP_VERSION_ID > 70100) {
return $className === 'yii\base\Object';
}
return false;
}
} }
 End of changes. 4 change blocks. 
1 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)