Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
3c400dbc
Commit
3c400dbc
authored
Apr 10, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed file PHPdoc
issue #3026
parent
c5ad45c7
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
139 additions
and
66 deletions
+139
-66
PhpDocController.php
build/controllers/PhpDocController.php
+98
-24
ApiRenderer.php
extensions/apidoc/templates/bootstrap/ApiRenderer.php
+1
-0
GuideRenderer.php
extensions/apidoc/templates/bootstrap/GuideRenderer.php
+1
-0
RendererTrait.php
extensions/apidoc/templates/bootstrap/RendererTrait.php
+3
-1
BasePage.php
extensions/codeception/BasePage.php
+5
-0
Mail.php
extensions/debug/models/search/Mail.php
+5
-0
MailPanel.php
extensions/debug/panels/MailPanel.php
+5
-0
ViewRenderer.php
extensions/smarty/ViewRenderer.php
+1
-3
IndexSchema.php
extensions/sphinx/IndexSchema.php
+1
-1
ViewRenderer.php
extensions/twig/ViewRenderer.php
+1
-3
ViewRendererStaticClassProxy.php
extensions/twig/ViewRendererStaticClassProxy.php
+1
-3
Action.php
framework/base/Action.php
+0
-0
Application.php
framework/console/Application.php
+0
-2
MessageController.php
framework/console/controllers/MessageController.php
+0
-1
MigrateController.php
framework/console/controllers/MigrateController.php
+0
-1
ActiveQuery.php
framework/db/ActiveQuery.php
+0
-1
ActiveRecord.php
framework/db/ActiveRecord.php
+0
-1
ActiveRecordInterface.php
framework/db/ActiveRecordInterface.php
+3
-3
BaseActiveRecord.php
framework/db/BaseActiveRecord.php
+0
-1
Migration.php
framework/db/Migration.php
+1
-0
TableSchema.php
framework/db/TableSchema.php
+1
-1
TableSchema.php
framework/db/mssql/TableSchema.php
+1
-1
QueryBuilder.php
framework/db/pgsql/QueryBuilder.php
+0
-1
Schema.php
framework/db/pgsql/Schema.php
+0
-1
ArrayHelper.php
framework/helpers/ArrayHelper.php
+1
-1
BaseArrayHelper.php
framework/helpers/BaseArrayHelper.php
+1
-1
BaseFileHelper.php
framework/helpers/BaseFileHelper.php
+0
-2
BaseHtmlPurifier.php
framework/helpers/BaseHtmlPurifier.php
+2
-1
BaseInflector.php
framework/helpers/BaseInflector.php
+1
-1
BaseMarkdown.php
framework/helpers/BaseMarkdown.php
+1
-1
BaseVarDumper.php
framework/helpers/BaseVarDumper.php
+1
-2
FileHelper.php
framework/helpers/FileHelper.php
+0
-2
HtmlPurifier.php
framework/helpers/HtmlPurifier.php
+1
-1
Markdown.php
framework/helpers/Markdown.php
+1
-1
VarDumper.php
framework/helpers/VarDumper.php
+1
-2
ImageValidator.php
framework/validators/ImageValidator.php
+0
-2
ActiveField.php
framework/widgets/ActiveField.php
+1
-0
No files found.
build/controllers/PhpDocController.php
View file @
3c400dbc
...
...
@@ -41,6 +41,73 @@ class PhpDocController extends Controller
*/
public
function
actionProperty
(
$root
=
null
)
{
$files
=
$this
->
findFiles
(
$root
);
$nFilesTotal
=
0
;
$nFilesUpdated
=
0
;
foreach
(
$files
as
$file
)
{
$result
=
$this
->
generateClassPropertyDocs
(
$file
);
if
(
$result
!==
false
)
{
list
(
$className
,
$phpdoc
)
=
$result
;
if
(
$this
->
updateFiles
)
{
if
(
$this
->
updateClassPropertyDocs
(
$file
,
$className
,
$phpdoc
))
{
$nFilesUpdated
++
;
}
}
elseif
(
!
empty
(
$phpdoc
))
{
$this
->
stdout
(
"
\n
[ "
.
$file
.
" ]
\n\n
"
,
Console
::
BOLD
);
$this
->
stdout
(
$phpdoc
);
}
}
$nFilesTotal
++
;
}
$this
->
stdout
(
"
\n
Parsed
$nFilesTotal
files.
\n
"
);
$this
->
stdout
(
"Updated
$nFilesUpdated
files.
\n
"
);
}
/**
* Fix some issues with PHPdoc in files
*
* @param string $root the directory to parse files from. Defaults to YII_PATH.
*/
public
function
actionFix
(
$root
=
null
)
{
$files
=
$this
->
findFiles
(
$root
);
$nFilesTotal
=
0
;
$nFilesUpdated
=
0
;
foreach
(
$files
as
$file
)
{
$contents
=
file_get_contents
(
$file
);
$sha
=
sha1
(
$contents
);
// fix line endings
$lines
=
preg_split
(
'/(\r\n|\n|\r)/'
,
$contents
);
$this
->
fixFileDoc
(
$lines
);
$newContent
=
implode
(
"
\n
"
,
$lines
);
if
(
$sha
!==
sha1
(
$newContent
))
{
$nFilesUpdated
++
;
}
file_put_contents
(
$file
,
$newContent
);
$nFilesTotal
++
;
}
$this
->
stdout
(
"
\n
Parsed
$nFilesTotal
files.
\n
"
);
$this
->
stdout
(
"Updated
$nFilesUpdated
files.
\n
"
);
}
/**
* @inheritdoc
*/
public
function
options
(
$actionId
)
{
return
array_merge
(
parent
::
options
(
$actionId
),
[
'updateFiles'
]);
}
protected
function
findFiles
(
$root
)
{
$except
=
[];
if
(
$root
===
null
)
{
$root
=
dirname
(
YII_PATH
);
...
...
@@ -89,35 +156,42 @@ class PhpDocController extends Controller
'vendor/'
,
]),
];
$files
=
FileHelper
::
findFiles
(
$root
,
$options
);
$nFilesTotal
=
0
;
$nFilesUpdated
=
0
;
foreach
(
$files
as
$file
)
{
$result
=
$this
->
generateClassPropertyDocs
(
$file
);
if
(
$result
!==
false
)
{
list
(
$className
,
$phpdoc
)
=
$result
;
if
(
$this
->
updateFiles
)
{
if
(
$this
->
updateClassPropertyDocs
(
$file
,
$className
,
$phpdoc
))
{
$nFilesUpdated
++
;
}
}
elseif
(
!
empty
(
$phpdoc
))
{
$this
->
stdout
(
"
\n
[ "
.
$file
.
" ]
\n\n
"
,
Console
::
BOLD
);
$this
->
stdout
(
$phpdoc
);
return
FileHelper
::
findFiles
(
$root
,
$options
);
}
protected
function
fixFileDoc
(
&
$lines
)
{
// find namespace
$namespace
=
false
;
$namespaceLine
=
''
;
$contentAfterNamespace
=
false
;
foreach
(
$lines
as
$i
=>
$line
)
{
if
(
substr
(
trim
(
$line
),
0
,
9
)
===
'namespace'
)
{
$namespace
=
$i
;
$namespaceLine
=
trim
(
$line
);
}
elseif
(
$namespace
!==
false
&&
trim
(
$line
)
!==
''
)
{
$contentAfterNamespace
=
$i
;
break
;
}
$nFilesTotal
++
;
}
$this
->
stdout
(
"
\n
Parsed
$nFilesTotal
files.
\n
"
);
$this
->
stdout
(
"Updated
$nFilesUpdated
files.
\n
"
);
if
(
$namespace
!==
false
&&
$contentAfterNamespace
!==
false
)
{
while
(
$contentAfterNamespace
>
0
)
{
array_shift
(
$lines
);
$contentAfterNamespace
--
;
}
$lines
=
array_merge
([
"<?php"
,
"/**"
,
" * @link http://www.yiiframework.com/"
,
" * @copyright Copyright (c) 2008 Yii Software LLC"
,
" * @license http://www.yiiframework.com/license/"
,
" */"
,
""
,
$namespaceLine
,
""
],
$lines
);
}
/**
* @inheritdoc
*/
public
function
options
(
$actionId
)
{
return
array_merge
(
parent
::
options
(
$actionId
),
[
'updateFiles'
]);
}
protected
function
updateClassPropertyDocs
(
$file
,
$className
,
$propertyDoc
)
...
...
extensions/apidoc/templates/bootstrap/ApiRenderer.php
View file @
3c400dbc
...
...
@@ -6,6 +6,7 @@
*/
namespace
yii\apidoc\templates\bootstrap
;
use
yii\apidoc\models\Context
;
use
yii\console\Controller
;
use
Yii
;
...
...
extensions/apidoc/templates/bootstrap/GuideRenderer.php
View file @
3c400dbc
...
...
@@ -6,6 +6,7 @@
*/
namespace
yii\apidoc\templates\bootstrap
;
use
Yii
;
use
yii\helpers\Html
;
...
...
extensions/apidoc/templates/bootstrap/RendererTrait.php
View file @
3c400dbc
<?php
/**
* @author Carsten Brandt <mail@cebe.cc>
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\apidoc\templates\bootstrap
;
...
...
extensions/codeception/BasePage.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\codeception
;
...
...
extensions/debug/models/search/Mail.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\debug\models\search
;
...
...
extensions/debug/panels/MailPanel.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\debug\panels
;
...
...
extensions/smarty/ViewRenderer.php
View file @
3c400dbc
<?php
/**
* Smarty view renderer class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright
©
2008 Yii Software LLC
* @copyright Copyright
(c)
2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
extensions/sphinx/IndexSchema.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright
© 2008-2011
Yii Software LLC
* @copyright Copyright
(c) 2008
Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
extensions/twig/ViewRenderer.php
View file @
3c400dbc
<?php
/**
* Twig view renderer class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright
©
2008 Yii Software LLC
* @copyright Copyright
(c)
2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
extensions/twig/ViewRendererStaticClassProxy.php
View file @
3c400dbc
<?php
/**
* Twig ViewRendererStaticClassProxy class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright
©
2008 Yii Software LLC
* @copyright Copyright
(c)
2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/base/Action.php
View file @
3c400dbc
framework/console/Application.php
View file @
3c400dbc
<?php
/**
* Console Application class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/console/controllers/MessageController.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/console/controllers/MigrateController.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/db/ActiveQuery.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/db/ActiveRecord.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/db/ActiveRecordInterface.php
View file @
3c400dbc
<?php
/**
*
*
* @
author Carsten Brandt <mail@cebe.cc>
*
@link http://www.yiiframework.com/
*
@copyright Copyright (c) 2008 Yii Software LLC
* @
license http://www.yiiframework.com/license/
*/
namespace
yii\db
;
...
...
framework/db/BaseActiveRecord.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/db/Migration.php
View file @
3c400dbc
...
...
@@ -6,6 +6,7 @@
*/
namespace
yii\db
;
use
yii\di\Instance
;
/**
...
...
framework/db/TableSchema.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright
© 2008-2011
Yii Software LLC
* @copyright Copyright
(c) 2008
Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/db/mssql/TableSchema.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright
© 2008-2011
Yii Software LLC
* @copyright Copyright
(c) 2008
Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/db/pgsql/QueryBuilder.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
...
...
framework/db/pgsql/Schema.php
View file @
3c400dbc
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
...
...
framework/helpers/ArrayHelper.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/BaseArrayHelper.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/BaseFileHelper.php
View file @
3c400dbc
<?php
/**
* Filesystem helper class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/helpers/BaseHtmlPurifier.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\helpers
;
/**
...
...
framework/helpers/BaseInflector.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/BaseMarkdown.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/BaseVarDumper.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright
© 2008-2011
Yii Software LLC
* @copyright Copyright
(c) 2008
Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/FileHelper.php
View file @
3c400dbc
<?php
/**
* Filesystem helper class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/helpers/HtmlPurifier.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/Markdown.php
View file @
3c400dbc
<?php
/**
* @copyright Copyright (c) 2008 Yii Software LLC
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/helpers/VarDumper.php
View file @
3c400dbc
<?php
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright Copyright
© 2008-2011
Yii Software LLC
* @copyright Copyright
(c) 2008
Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
...
...
framework/validators/ImageValidator.php
View file @
3c400dbc
<?php
/**
* Image validator class file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
...
...
framework/widgets/ActiveField.php
View file @
3c400dbc
...
...
@@ -4,6 +4,7 @@
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\widgets
;
use
Yii
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment