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
e2aacad8
Commit
e2aacad8
authored
Mar 07, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added links to PHP.net to apidoc
parent
f2797191
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
48 additions
and
19 deletions
+48
-19
ApiMarkdown.php
extensions/apidoc/helpers/ApiMarkdown.php
+6
-0
BaseRenderer.php
extensions/apidoc/renderers/BaseRenderer.php
+23
-0
ApiRenderer.php
extensions/apidoc/templates/html/ApiRenderer.php
+4
-4
Query.php
extensions/sphinx/Query.php
+2
-2
ArrayAccessTrait.php
framework/base/ArrayAccessTrait.php
+1
-1
Component.php
framework/base/Component.php
+2
-2
Event.php
framework/base/Event.php
+2
-2
ActionColumn.php
framework/grid/ActionColumn.php
+1
-1
BaseMailer.php
framework/mail/BaseMailer.php
+1
-1
FilterValidator.php
framework/validators/FilterValidator.php
+1
-1
AccessControl.php
framework/web/AccessControl.php
+1
-1
AccessRule.php
framework/web/AccessRule.php
+2
-2
HttpCache.php
framework/web/HttpCache.php
+2
-2
No files found.
extensions/apidoc/helpers/ApiMarkdown.php
View file @
e2aacad8
...
@@ -179,6 +179,7 @@ class ApiMarkdown extends GithubMarkdown
...
@@ -179,6 +179,7 @@ class ApiMarkdown extends GithubMarkdown
$offset
$offset
];
];
}
}
if
(
$context
!==
null
)
{
if
(
$context
!==
null
)
{
// Collection resolves relative types
// Collection resolves relative types
$object
=
(
new
Collection
([
$object
],
$context
->
phpDocContext
))
->
__toString
();
$object
=
(
new
Collection
([
$object
],
$context
->
phpDocContext
))
->
__toString
();
...
@@ -188,6 +189,11 @@ class ApiMarkdown extends GithubMarkdown
...
@@ -188,6 +189,11 @@ class ApiMarkdown extends GithubMarkdown
static
::
$renderer
->
createTypeLink
(
$type
,
null
,
$title
),
static
::
$renderer
->
createTypeLink
(
$type
,
null
,
$title
),
$offset
$offset
];
];
}
elseif
(
strpos
(
$typeLink
=
static
::
$renderer
->
createTypeLink
(
$object
,
null
,
$title
),
'<a href'
)
!==
false
)
{
return
[
$typeLink
,
$offset
];
}
}
static
::
$renderer
->
apiContext
->
errors
[]
=
[
static
::
$renderer
->
apiContext
->
errors
[]
=
[
'file'
=>
(
$context
!==
null
)
?
$context
->
sourceFile
:
null
,
'file'
=>
(
$context
!==
null
)
?
$context
->
sourceFile
:
null
,
...
...
extensions/apidoc/renderers/BaseRenderer.php
View file @
e2aacad8
...
@@ -85,7 +85,30 @@ abstract class BaseRenderer extends Component
...
@@ -85,7 +85,30 @@ abstract class BaseRenderer extends Component
}
}
}
}
if
(
!
is_object
(
$type
))
{
if
(
!
is_object
(
$type
))
{
$linkText
=
ltrim
(
$type
,
'\\'
);
if
(
$title
!==
null
)
{
$linkText
=
$title
;
}
$phpTypes
=
[
'callable'
,
'array'
,
'string'
,
'boolean'
,
'integer'
,
'float'
,
'object'
,
'resource'
,
'null'
,
];
// check if it is PHP internal class
if
(((
class_exists
(
$type
,
false
)
||
interface_exists
(
$type
,
false
)
||
trait_exists
(
$type
,
false
))
&&
(
$reflection
=
new
\ReflectionClass
(
$type
))
&&
$reflection
->
isInternal
()))
{
$links
[]
=
$this
->
generateLink
(
$linkText
,
'http://www.php.net/class.'
.
strtolower
(
ltrim
(
$type
,
'\\'
)))
.
$postfix
;
}
elseif
(
in_array
(
$type
,
$phpTypes
))
{
$links
[]
=
$this
->
generateLink
(
$linkText
,
'http://www.php.net/language.types.'
.
strtolower
(
ltrim
(
$type
,
'\\'
)))
.
$postfix
;
}
else
{
$links
[]
=
$type
;
$links
[]
=
$type
;
}
}
else
{
}
else
{
$linkText
=
$type
->
name
;
$linkText
=
$type
->
name
;
if
(
$title
!==
null
)
{
if
(
$title
!==
null
)
{
...
...
extensions/apidoc/templates/html/ApiRenderer.php
View file @
e2aacad8
...
@@ -148,7 +148,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
...
@@ -148,7 +148,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
$class
=
$this
->
apiContext
->
classes
[
$class
->
parentClass
];
$class
=
$this
->
apiContext
->
classes
[
$class
->
parentClass
];
$parents
[]
=
$this
->
createTypeLink
(
$class
);
$parents
[]
=
$this
->
createTypeLink
(
$class
);
}
else
{
}
else
{
$parents
[]
=
$
class
->
parentClass
;
// TODO link to php.net
$parents
[]
=
$
this
->
createTypeLink
(
$class
->
parentClass
);
break
;
break
;
}
}
}
}
...
@@ -167,7 +167,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
...
@@ -167,7 +167,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
if
(
isset
(
$this
->
apiContext
->
interfaces
[
$interface
]))
{
if
(
isset
(
$this
->
apiContext
->
interfaces
[
$interface
]))
{
$interfaces
[]
=
$this
->
createTypeLink
(
$this
->
apiContext
->
interfaces
[
$interface
]);
$interfaces
[]
=
$this
->
createTypeLink
(
$this
->
apiContext
->
interfaces
[
$interface
]);
}
else
{
}
else
{
$interfaces
[]
=
$
interface
;
// TODO link to php.net
$interfaces
[]
=
$
this
->
createTypeLink
(
$interface
);
}
}
}
}
return
implode
(
', '
,
$interfaces
);
return
implode
(
', '
,
$interfaces
);
...
@@ -185,7 +185,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
...
@@ -185,7 +185,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
if
(
isset
(
$this
->
apiContext
->
traits
[
$trait
]))
{
if
(
isset
(
$this
->
apiContext
->
traits
[
$trait
]))
{
$traits
[]
=
$this
->
createTypeLink
(
$this
->
apiContext
->
traits
[
$trait
]);
$traits
[]
=
$this
->
createTypeLink
(
$this
->
apiContext
->
traits
[
$trait
]);
}
else
{
}
else
{
$traits
[]
=
$t
rait
;
// TODO link to php.net
$traits
[]
=
$t
his
->
createTypeLink
(
$trait
);
}
}
}
}
return
implode
(
', '
,
$traits
);
return
implode
(
', '
,
$traits
);
...
@@ -203,7 +203,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
...
@@ -203,7 +203,7 @@ class ApiRenderer extends BaseApiRenderer implements ViewContextInterface
if
(
isset
(
$this
->
apiContext
->
classes
[
$class
]))
{
if
(
isset
(
$this
->
apiContext
->
classes
[
$class
]))
{
$classes
[]
=
$this
->
createTypeLink
(
$this
->
apiContext
->
classes
[
$class
]);
$classes
[]
=
$this
->
createTypeLink
(
$this
->
apiContext
->
classes
[
$class
]);
}
else
{
}
else
{
$classes
[]
=
$
class
;
// TODO link to php.net
$classes
[]
=
$
this
->
createTypeLink
(
$class
);
}
}
}
}
return
implode
(
', '
,
$classes
);
return
implode
(
', '
,
$classes
);
...
...
extensions/sphinx/Query.php
View file @
e2aacad8
...
@@ -99,7 +99,7 @@ class Query extends Component implements QueryInterface
...
@@ -99,7 +99,7 @@ class Query extends Component implements QueryInterface
*/
*/
public
$params
=
[];
public
$params
=
[];
/**
/**
* @var call
back
PHP callback, which should be used to fetch source data for the snippets.
* @var call
able
PHP callback, which should be used to fetch source data for the snippets.
* Such callback will receive array of query result rows as an argument and must return the
* Such callback will receive array of query result rows as an argument and must return the
* array of snippet source strings in the order, which match one of incoming rows.
* array of snippet source strings in the order, which match one of incoming rows.
* For example:
* For example:
...
@@ -642,7 +642,7 @@ class Query extends Component implements QueryInterface
...
@@ -642,7 +642,7 @@ class Query extends Component implements QueryInterface
/**
/**
* Sets the PHP callback, which should be used to retrieve the source data
* Sets the PHP callback, which should be used to retrieve the source data
* for the snippets building.
* for the snippets building.
* @param call
back
$callback PHP callback, which should be used to fetch source data for the snippets.
* @param call
able
$callback PHP callback, which should be used to fetch source data for the snippets.
* @return static the query object itself
* @return static the query object itself
* @see snippetCallback
* @see snippetCallback
*/
*/
...
...
framework/base/ArrayAccessTrait.php
View file @
e2aacad8
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
namespace
yii\base
;
namespace
yii\base
;
/**
/**
* ArrayAccessTrait provides the implementation for
`IteratorAggregate`, `ArrayAccess` and `Countable`
.
* ArrayAccessTrait provides the implementation for
[[\IteratorAggregate]], [[\ArrayAccess]] and [[\Countable]]
.
*
*
* Note that ArrayAccessTrait requires the class using it contain a property named `data` which should be an array.
* Note that ArrayAccessTrait requires the class using it contain a property named `data` which should be an array.
* The data will be exposed by ArrayAccessTrait to support accessing the class object like an array.
* The data will be exposed by ArrayAccessTrait to support accessing the class object like an array.
...
...
framework/base/Component.php
View file @
e2aacad8
...
@@ -460,7 +460,7 @@ class Component extends Object
...
@@ -460,7 +460,7 @@ class Component extends Object
* where `$event` is an [[Event]] object which includes parameters associated with the event.
* where `$event` is an [[Event]] object which includes parameters associated with the event.
*
*
* @param string $name the event name
* @param string $name the event name
* @param call
back
$handler the event handler
* @param call
able
$handler the event handler
* @param mixed $data the data to be passed to the event handler when the event is triggered.
* @param mixed $data the data to be passed to the event handler when the event is triggered.
* When the event handler is invoked, this data can be accessed via [[Event::data]].
* When the event handler is invoked, this data can be accessed via [[Event::data]].
* @see off()
* @see off()
...
@@ -475,7 +475,7 @@ class Component extends Object
...
@@ -475,7 +475,7 @@ class Component extends Object
* Detaches an existing event handler from this component.
* Detaches an existing event handler from this component.
* This method is the opposite of [[on()]].
* This method is the opposite of [[on()]].
* @param string $name event name
* @param string $name event name
* @param call
back
$handler the event handler to be removed.
* @param call
able
$handler the event handler to be removed.
* If it is null, all handlers attached to the named event will be removed.
* If it is null, all handlers attached to the named event will be removed.
* @return boolean if a handler is found and detached
* @return boolean if a handler is found and detached
* @see on()
* @see on()
...
...
framework/base/Event.php
View file @
e2aacad8
...
@@ -71,7 +71,7 @@ class Event extends Object
...
@@ -71,7 +71,7 @@ class Event extends Object
*
*
* @param string $class the fully qualified class name to which the event handler needs to attach.
* @param string $class the fully qualified class name to which the event handler needs to attach.
* @param string $name the event name.
* @param string $name the event name.
* @param call
back
$handler the event handler.
* @param call
able
$handler the event handler.
* @param mixed $data the data to be passed to the event handler when the event is triggered.
* @param mixed $data the data to be passed to the event handler when the event is triggered.
* When the event handler is invoked, this data can be accessed via [[Event::data]].
* When the event handler is invoked, this data can be accessed via [[Event::data]].
* @see off()
* @see off()
...
@@ -88,7 +88,7 @@ class Event extends Object
...
@@ -88,7 +88,7 @@ class Event extends Object
*
*
* @param string $class the fully qualified class name from which the event handler needs to be detached.
* @param string $class the fully qualified class name from which the event handler needs to be detached.
* @param string $name the event name.
* @param string $name the event name.
* @param call
back
$handler the event handler to be removed.
* @param call
able
$handler the event handler to be removed.
* If it is null, all handlers attached to the named event will be removed.
* If it is null, all handlers attached to the named event will be removed.
* @return boolean whether a handler is found and detached.
* @return boolean whether a handler is found and detached.
* @see on()
* @see on()
...
...
framework/grid/ActionColumn.php
View file @
e2aacad8
...
@@ -63,7 +63,7 @@ class ActionColumn extends Column
...
@@ -63,7 +63,7 @@ class ActionColumn extends Column
*/
*/
public
$buttons
=
[];
public
$buttons
=
[];
/**
/**
* @var call
back
a callback that creates a button URL using the specified model information.
* @var call
able
a callback that creates a button URL using the specified model information.
* The signature of the callback should be the same as that of [[createUrl()]].
* The signature of the callback should be the same as that of [[createUrl()]].
* If this property is not set, button URLs will be created using [[createUrl()]].
* If this property is not set, button URLs will be created using [[createUrl()]].
*/
*/
...
...
framework/mail/BaseMailer.php
View file @
e2aacad8
...
@@ -88,7 +88,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont
...
@@ -88,7 +88,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont
*/
*/
public
$fileTransportPath
=
'@runtime/mail'
;
public
$fileTransportPath
=
'@runtime/mail'
;
/**
/**
* @var call
back
a PHP callback that will be called by [[send()]] when [[useFileTransport]] is true.
* @var call
able
a PHP callback that will be called by [[send()]] when [[useFileTransport]] is true.
* The callback should return a file name which will be used to save the email message.
* The callback should return a file name which will be used to save the email message.
* If not set, the file name will be generated based on the current timestamp.
* If not set, the file name will be generated based on the current timestamp.
*
*
...
...
framework/validators/FilterValidator.php
View file @
e2aacad8
...
@@ -31,7 +31,7 @@ use yii\base\InvalidConfigException;
...
@@ -31,7 +31,7 @@ use yii\base\InvalidConfigException;
class
FilterValidator
extends
Validator
class
FilterValidator
extends
Validator
{
{
/**
/**
* @var call
back
the filter. This can be a global function name, anonymous function, etc.
* @var call
able
the filter. This can be a global function name, anonymous function, etc.
* The function signature must be as follows,
* The function signature must be as follows,
*
*
* ~~~
* ~~~
...
...
framework/web/AccessControl.php
View file @
e2aacad8
...
@@ -54,7 +54,7 @@ use yii\base\ActionFilter;
...
@@ -54,7 +54,7 @@ use yii\base\ActionFilter;
class
AccessControl
extends
ActionFilter
class
AccessControl
extends
ActionFilter
{
{
/**
/**
* @var call
back
a callback that will be called if the access should be denied
* @var call
able
a callback that will be called if the access should be denied
* to the current user. If not set, [[denyAccess()]] will be called.
* to the current user. If not set, [[denyAccess()]] will be called.
*
*
* The signature of the callback should be as follows:
* The signature of the callback should be as follows:
...
...
framework/web/AccessRule.php
View file @
e2aacad8
...
@@ -61,7 +61,7 @@ class AccessRule extends Component
...
@@ -61,7 +61,7 @@ class AccessRule extends Component
*/
*/
public
$verbs
;
public
$verbs
;
/**
/**
* @var call
back
a callback that will be called to determine if the rule should be applied.
* @var call
able
a callback that will be called to determine if the rule should be applied.
* The signature of the callback should be as follows:
* The signature of the callback should be as follows:
*
*
* ~~~
* ~~~
...
@@ -73,7 +73,7 @@ class AccessRule extends Component
...
@@ -73,7 +73,7 @@ class AccessRule extends Component
*/
*/
public
$matchCallback
;
public
$matchCallback
;
/**
/**
* @var call
back
a callback that will be called if this rule determines the access to
* @var call
able
a callback that will be called if this rule determines the access to
* the current action should be denied. If not set, the behavior will be determined by
* the current action should be denied. If not set, the behavior will be determined by
* [[AccessControl]].
* [[AccessControl]].
*
*
...
...
framework/web/HttpCache.php
View file @
e2aacad8
...
@@ -46,7 +46,7 @@ use yii\base\Action;
...
@@ -46,7 +46,7 @@ use yii\base\Action;
class
HttpCache
extends
ActionFilter
class
HttpCache
extends
ActionFilter
{
{
/**
/**
* @var call
back
a PHP callback that returns the UNIX timestamp of the last modification time.
* @var call
able
a PHP callback that returns the UNIX timestamp of the last modification time.
* The callback's signature should be:
* The callback's signature should be:
*
*
* ~~~
* ~~~
...
@@ -58,7 +58,7 @@ class HttpCache extends ActionFilter
...
@@ -58,7 +58,7 @@ class HttpCache extends ActionFilter
*/
*/
public
$lastModified
;
public
$lastModified
;
/**
/**
* @var call
back
a PHP callback that generates the Etag seed string.
* @var call
able
a PHP callback that generates the Etag seed string.
* The callback's signature should be:
* The callback's signature should be:
*
*
* ~~~
* ~~~
...
...
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