Skip to content

Commit

Permalink
phpDoc: added $var name to @param
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 20, 2018
1 parent f8ba527 commit 33e1e42
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 34 deletions.
10 changes: 5 additions & 5 deletions src/ComponentModel/ArrayAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ trait ArrayAccess
{
/**
* Adds the component to the container.
* @param string|int
* @param IComponent
* @param string|int $name
* @param IComponent $component
* @return void
*/
public function offsetSet($name, $component)
Expand All @@ -29,7 +29,7 @@ public function offsetSet($name, $component)

/**
* Returns component specified by name. Throws exception if component doesn't exist.
* @param string|int
* @param string|int $name
* @return IComponent
* @throws Nette\InvalidArgumentException
*/
Expand All @@ -41,7 +41,7 @@ public function offsetGet($name)

/**
* Does component specified by name exists?
* @param string|int
* @param string|int $name
* @return bool
*/
public function offsetExists($name)
Expand All @@ -52,7 +52,7 @@ public function offsetExists($name)

/**
* Removes component from the container.
* @param string|int
* @param string|int $name
* @return void
*/
public function offsetUnset($name)
Expand Down
25 changes: 12 additions & 13 deletions src/ComponentModel/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public function __construct()

/**
* Finds the closest ancestor specified by class or interface name.
* @param string|null
* @param bool
* @param string|null $type
* @param bool $throw
* @return IComponent|null
*/
public function lookup($type, $throw = true)
Expand Down Expand Up @@ -90,8 +90,8 @@ public function lookup($type, $throw = true)
/**
* Finds the closest ancestor specified by class or interface name and returns backtrace path.
* A path is the concatenation of component names separated by self::NAME_SEPARATOR.
* @param string|null
* @param bool
* @param string|null $type
* @param bool $throw
* @return string|null
*/
public function lookupPath($type = null, $throw = true)
Expand All @@ -103,7 +103,7 @@ public function lookupPath($type = null, $throw = true)

/**
* Starts monitoring of ancestors.
* @param string
* @param string $type
* @return void
*/
final public function monitor($type, callable $attached = null, callable $detached = null)
Expand All @@ -121,7 +121,7 @@ final public function monitor($type, callable $attached = null, callable $detach

/**
* Stops monitoring of ancestors.
* @param string
* @param string $type
* @return void
*/
public function unmonitor($type)
Expand All @@ -133,7 +133,7 @@ public function unmonitor($type)
/**
* This method will be called when the component (or component's parent)
* becomes attached to a monitored object. Do not call this method yourself.
* @param IComponent
* @param IComponent $obj
* @return void
* @deprecated use monitor($type, $attached)
*/
Expand All @@ -145,7 +145,7 @@ protected function attached($obj)
/**
* This method will be called before the component (or component's parent)
* becomes detached from a monitored object. Do not call this method yourself.
* @param IComponent
* @param IComponent $obj
* @return void
* @deprecated use monitor($type, null, $detached)
*/
Expand Down Expand Up @@ -179,8 +179,7 @@ public function getParent()
/**
* Sets or removes the parent of this component. This method is managed by containers and should
* not be called by applications
* @param IContainer
* @param string
* @param string $name
* @return static
* @throws Nette\InvalidStateException
* @internal
Expand Down Expand Up @@ -232,9 +231,9 @@ protected function validateParent(IContainer $parent)

/**
* Refreshes monitors.
* @param int
* @param array|null (array = attaching, null = detaching)
* @param array
* @param int $depth
* @param array|null $missing (array = attaching, null = detaching)
* @param array $listeners
* @return void
*/
private function refreshMonitors($depth, &$missing = null, &$listeners = [])
Expand Down
15 changes: 7 additions & 8 deletions src/ComponentModel/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ class Container extends Component implements IContainer

/**
* Adds the component to the container.
* @param IComponent
* @param string|int
* @param string|int
* @param string|int $name
* @param string|int $insertBefore
* @return static
* @throws Nette\InvalidStateException
*/
Expand Down Expand Up @@ -108,8 +107,8 @@ public function removeComponent(IComponent $component)

/**
* Returns component specified by name or path.
* @param string|int
* @param bool throw exception if component doesn't exist?
* @param string|int $name
* @param bool $throw throw exception if component doesn't exist?
* @return IComponent|null
*/
public function getComponent($name, $throw = true)
Expand Down Expand Up @@ -163,7 +162,7 @@ public function getComponent($name, $throw = true)

/**
* Component factory. Delegates the creation of components to a createComponent<Name> method.
* @param string
* @param string $name
* @return IComponent|null
*/
protected function createComponent($name)
Expand All @@ -183,8 +182,8 @@ protected function createComponent($name)

/**
* Iterates over descendants components.
* @param bool
* @param string
* @param bool $deep return all descendant?
* @param string $filterType class type to return
* @return \Iterator
*/
public function getComponents($deep = false, $filterType = null)
Expand Down
3 changes: 1 addition & 2 deletions src/ComponentModel/IComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function getParent();

/**
* Sets the parent of this component.
* @param IContainer
* @param string
* @param string $name
* @return static
*/
function setParent(IContainer $parent = null, $name = null);
Expand Down
10 changes: 4 additions & 6 deletions src/ComponentModel/IContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,28 @@ interface IContainer extends IComponent
{
/**
* Adds the component to the container.
* @param IComponent
* @param string|int
* @param string|int $name
* @return static
*/
function addComponent(IComponent $component, $name);

/**
* Removes the component from the container.
* @param IComponent
* @return void
*/
function removeComponent(IComponent $component);

/**
* Returns component specified by name or path.
* @param string|int
* @param string|int $name
* @return IComponent|null
*/
function getComponent($name);

/**
* Iterates over descendants components.
* @param bool
* @param string
* @param bool $deep
* @param string $filterType
* @return \Iterator
*/
function getComponents($deep = false, $filterType = null);
Expand Down

0 comments on commit 33e1e42

Please sign in to comment.