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
3437c571
Commit
3437c571
authored
Apr 26, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phpdoc controller did not find some setters
fixes #3255
parent
c259f4e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
PhpDocController.php
build/controllers/PhpDocController.php
+18
-9
BaseMailer.php
framework/mail/BaseMailer.php
+1
-1
No files found.
build/controllers/PhpDocController.php
View file @
3437c571
...
...
@@ -416,11 +416,11 @@ class PhpDocController extends Controller
$gets
=
$this
->
match
(
'#\* @return (?<type>[\w\\|\\\\\\[\\]]+)(?: (?<comment>(?:(?!\*/|\* @).)+?)(?:(?!\*/).)+|[\s\n]*)\*/'
.
'[\s\n]{2,}public function (?<kind>get)(?<name>\w+)\((?:,? ?\$\w+ ?= ?[^,]+)*\)#'
,
$class
[
'content'
]);
$class
[
'content'
]
,
true
);
$sets
=
$this
->
match
(
'#\* @param (?<type>[\w\\|\\\\\\[\\]]+) \$\w+(?: (?<comment>(?:(?!\*/|\* @).)+?)(?:(?!\*/).)+|[\s\n]*)\*/'
.
'[\s\n]{2,}public function (?<kind>set)(?<name>\w+)\(\$\w+(?:, ?\$\w+ ?= ?[^,]+)*\)#'
,
$class
[
'content'
]);
$class
[
'content'
]
,
true
);
// check for @property annotations in getter and setter
$properties
=
$this
->
match
(
'#\* @(?<kind>property) (?<type>[\w\\|\\\\\\[\\]]+)(?: (?<comment>(?:(?!\*/|\* @).)+?)(?:(?!\*/).)+|[\s\n]*)\*/'
.
...
...
@@ -500,15 +500,24 @@ class PhpDocController extends Controller
return
[
$className
,
$phpdoc
];
}
protected
function
match
(
$pattern
,
$subject
)
protected
function
match
(
$pattern
,
$subject
,
$split
=
false
)
{
$sets
=
[];
preg_match_all
(
$pattern
.
'suU'
,
$subject
,
$sets
,
PREG_SET_ORDER
);
foreach
(
$sets
as
&
$set
)
foreach
(
$set
as
$i
=>
$match
)
if
(
is_numeric
(
$i
)
/*&& $i != 0*/
)
unset
(
$set
[
$i
]);
// split subject by double newlines because regex sometimes has problems with matching
// in the complete set of methods
// example: yii\di\ServiceLocator setComponents() is not recognized in the whole but in
// a part of the class.
$parts
=
$split
?
explode
(
"
\n\n
"
,
$subject
)
:
[
$subject
];
foreach
(
$parts
as
$part
)
{
preg_match_all
(
$pattern
.
'suU'
,
$part
,
$matches
,
PREG_SET_ORDER
);
foreach
(
$matches
as
&
$set
)
{
foreach
(
$set
as
$i
=>
$match
)
if
(
is_numeric
(
$i
)
/*&& $i != 0*/
)
unset
(
$set
[
$i
]);
$sets
[]
=
$set
;
}
}
return
$sets
;
}
...
...
framework/mail/BaseMailer.php
View file @
3437c571
...
...
@@ -24,7 +24,7 @@ use yii\base\MailEvent;
* @property View $view View instance. Note that the type of this property differs in getter and setter. See
* [[getView()]] and [[setView()]] for details.
* @property string $viewPath The directory that contains the view files for composing mail messages Defaults
* to '@app/mail'.
This property is read-only.
* to '@app/mail'.
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
...
...
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